Skip to content

Commit

Permalink
Reclaim scala package (#527)
Browse files Browse the repository at this point in the history
* scala => scalarules so that we can refer to scala std lib in java

* few more package renames
  • Loading branch information
softprops authored and johnynek committed Jun 20, 2018
1 parent 8c48398 commit 93a2ad9
Show file tree
Hide file tree
Showing 157 changed files with 338 additions and 338 deletions.
2 changes: 1 addition & 1 deletion test/A.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package scala.test
package scalarules.test

object A {
def main(args: Array[String]) {
Expand Down
98 changes: 49 additions & 49 deletions test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ load(
java_binary(
name = "JavaBinary",
srcs = ["JavaBinary.java"],
main_class = "scala.test.JavaBinary",
main_class = "scalarules.test.JavaBinary",
runtime_deps = [
":OtherJavaLib",
"@scala//:scala-library",
Expand All @@ -39,7 +39,7 @@ java_binary(
java_binary(
name = "JavaBinary2",
srcs = ["JavaBinary.java"],
main_class = "scala.test.JavaBinary",
main_class = "scalarules.test.JavaBinary",
deps = [
":Exported",
":HelloLib",
Expand All @@ -51,7 +51,7 @@ java_binary(
scala_binary(
name = "ScalaBinary",
srcs = ["ScalaBinary.scala"],
main_class = "scala.test.ScalaBinary",
main_class = "scalarules.test.ScalaBinary",
print_compile_time = True,
deps = [
":HelloLib",
Expand Down Expand Up @@ -159,38 +159,38 @@ java_library(

scala_library(
name = "ScalaLibResources",
srcs = ["src/main/scala/scala/test/ScalaLibResources.scala"],
srcs = ["src/main/scala/scalarules/test/ScalaLibResources.scala"],
resources = [
"//test/data:some.txt",
"//test/src/main/resources/scala/test:byes",
"//test/src/main/resources/scala/test:hellos",
"//test/src/main/resources/scalarules/test:byes",
"//test/src/main/resources/scalarules/test:hellos",
],
)

scala_library(
name = "ResourcesStripScalaLib",
srcs = ["src/main/scala/scala/test/ResourcesStripScalaLib.scala"],
srcs = ["src/main/scala/scalarules/test/ResourcesStripScalaLib.scala"],
resource_strip_prefix = "test/",
resources = [
"//test/data:foo.txt",
"//test/data:more.txt",
"//test/src/main/resources/scala/test:generated-hello",
"//test/src/main/resources/scala/test:more-byes",
"//test/src/main/resources/scala/test:more-hellos",
"//test/src/main/resources/scalarules/test:generated-hello",
"//test/src/main/resources/scalarules/test:more-byes",
"//test/src/main/resources/scalarules/test:more-hellos",
],
)

scala_binary(
name = "ScalaLibBinary",
srcs = ["src/main/scala/scala/test/ScalaLibBinary.scala"],
main_class = "scala.test.ScalaLibBinary",
srcs = ["src/main/scala/scalarules/test/ScalaLibBinary.scala"],
main_class = "scalarules.test.ScalaLibBinary",
deps = ["ScalaLibResources"],
)

scala_binary(
name = "ResourcesStripScalaBinary",
srcs = ["src/main/scala/scala/test/ResourcesStripScalaBinary.scala"],
main_class = "scala.test.ResourcesStripScalaBinary",
srcs = ["src/main/scala/scalarules/test/ResourcesStripScalaBinary.scala"],
main_class = "scalarules.test.ResourcesStripScalaBinary",
deps = ["ResourcesStripScalaLib"],
)

Expand Down Expand Up @@ -224,8 +224,8 @@ scala_library(
#Mix java scala
scala_library(
name = "MixJavaScalaLib",
srcs = glob(["src/main/scala/scala/test/mix_java_scala/*.scala"]) + glob([
"src/main/scala/scala/test/mix_java_scala/*.java",
srcs = glob(["src/main/scala/scalarules/test/mix_java_scala/*.scala"]) + glob([
"src/main/scala/scalarules/test/mix_java_scala/*.java",
]),
jvm_flags = [
"-Xms1G",
Expand All @@ -236,18 +236,18 @@ scala_library(
#needed to test java sources are compiled
scala_binary(
name = "MixJavaScalaLibBinary",
srcs = ["src/main/scala/scala/test/MixJavaScalaLibBinary.scala"],
main_class = "scala.test.MixJavaScalaLibBinary",
srcs = ["src/main/scala/scalarules/test/MixJavaScalaLibBinary.scala"],
main_class = "scalarules.test.MixJavaScalaLibBinary",
deps = ["MixJavaScalaLib"],
)

#Mix java scala (srcjar), much like above only the java is provided via srcjar
scala_library(
name = "MixJavaScalaSrcjarLib",
srcs = glob([
"src/main/scala/scala/test/mix_java_scala/*.scala",
"src/main/scala/scalarules/test/mix_java_scala/*.scala",
# srcjar created with `jar -cfM Baz.srcjar Baz.java`
"src/main/scala/scala/test/mix_java_scala/*.srcjar",
"src/main/scala/scalarules/test/mix_java_scala/*.srcjar",
]),
jvm_flags = [
"-Xms1G",
Expand All @@ -258,31 +258,31 @@ scala_library(
#needed to test java sources are compiled
scala_binary(
name = "MixJavaScalaSrcjarLibBinary",
srcs = ["src/main/scala/scala/test/MixJavaScalaLibBinary.scala"],
main_class = "scala.test.MixJavaScalaLibBinary",
srcs = ["src/main/scala/scalarules/test/MixJavaScalaLibBinary.scala"],
main_class = "scalarules.test.MixJavaScalaLibBinary",
deps = ["MixJavaScalaSrcjarLib"],
)

scala_binary(
name = "JavaOnlySources",
srcs = ["src/main/scala/scala/test/only_java/Alpha.java"],
main_class = "scala.test.Alpha",
srcs = ["src/main/scala/scalarules/test/only_java/Alpha.java"],
main_class = "scalarules.test.Alpha",
)

scala_library(
name = "JUnitCompileTimeDep",
srcs = ["src/main/scala/scala/test/junit/support/JUnitCompileTimeDep.scala"],
srcs = ["src/main/scala/scalarules/test/junit/support/JUnitCompileTimeDep.scala"],
)

scala_library(
name = "JUnitRuntimeDep",
srcs = ["src/main/scala/scala/test/junit/support/JUnitRuntimeDep.scala"],
srcs = ["src/main/scala/scalarules/test/junit/support/JUnitRuntimeDep.scala"],
)

scala_junit_test(
name = "JunitTestWithDeps",
size = "small",
srcs = ["src/main/scala/scala/test/junit/JunitTests.scala"],
srcs = ["src/main/scala/scalarules/test/junit/JunitTests.scala"],
jvm_flags = ["-XX:HeapDumpPath=/some/custom/path"],
suffixes = ["Test"],
runtime_deps = [":JUnitRuntimeDep"],
Expand All @@ -292,7 +292,7 @@ scala_junit_test(
scala_junit_test(
name = "JunitMultipleSuffixes",
size = "small",
srcs = ["src/main/scala/scala/test/junit/JunitMultipleSuffixes.scala"],
srcs = ["src/main/scala/scalarules/test/junit/JunitMultipleSuffixes.scala"],
print_discovered_classes = True,
suffixes = [
"E2E",
Expand All @@ -303,7 +303,7 @@ scala_junit_test(
scala_junit_test(
name = "JunitMultiplePrefixes",
size = "small",
srcs = ["src/main/scala/scala/test/junit/JunitMultiplePrefixes.scala"],
srcs = ["src/main/scala/scalarules/test/junit/JunitMultiplePrefixes.scala"],
prefixes = [
"Test",
"OtherCustomPrefix",
Expand All @@ -315,8 +315,8 @@ scala_junit_test(
name = "JunitPrefixesAndSuffixes",
size = "small",
srcs = [
"src/main/scala/scala/test/junit/JunitMultiplePrefixes.scala",
"src/main/scala/scala/test/junit/JunitMultipleSuffixes.scala",
"src/main/scala/scalarules/test/junit/JunitMultiplePrefixes.scala",
"src/main/scala/scalarules/test/junit/JunitMultipleSuffixes.scala",
],
prefixes = ["Test"],
print_discovered_classes = True,
Expand All @@ -326,14 +326,14 @@ scala_junit_test(
scala_junit_test(
name = "JunitJavaTest",
size = "small",
srcs = ["src/main/scala/scala/test/junit/JunitJavaTest.java"],
srcs = ["src/main/scala/scalarules/test/junit/JunitJavaTest.java"],
suffixes = ["Test"],
)

scala_specs2_junit_test(
name = "Specs2Tests",
size = "small",
srcs = ["src/main/scala/scala/test/junit/specs2/Specs2Tests.scala"],
srcs = ["src/main/scala/scalarules/test/junit/specs2/Specs2Tests.scala"],
print_discovered_classes = True,
suffixes = ["Test"],
deps = [":JUnitCompileTimeDep"],
Expand All @@ -355,7 +355,7 @@ scala_specs2_junit_test(
"ScalaLibBinary",
"ResourcesStripScalaBinary",
"ScalaBinary_dependent_on_binary_with_java",
"//test/src/main/scala/scala/test/classpath_resources:classpath_resource",
"//test/src/main/scala/scalarules/test/classpath_resources:classpath_resource",
]]

# Make sure scala_binary works in genrule environment
Expand All @@ -376,7 +376,7 @@ sh_test(
scala_specs2_junit_test(
name = "data_location_expansion",
size = "small",
srcs = ["src/main/scala/scala/test/location_expansion/LocationExpansionTest.scala"],
srcs = ["src/main/scala/scalarules/test/location_expansion/LocationExpansionTest.scala"],
data = ["//src/java/com/google/devtools/build/lib:worker"],
jvm_flags = ["-Dlocation.expanded=$(location //src/java/com/google/devtools/build/lib:worker)"],
suffixes = ["Test"],
Expand All @@ -385,70 +385,70 @@ scala_specs2_junit_test(
scala_junit_test(
name = "JunitFiltersAbstractClassesAndInterfaces",
size = "small",
srcs = ["src/main/scala/scala/test/junit/JunitAbstractClassAndInterface.scala"],
srcs = ["src/main/scala/scalarules/test/junit/JunitAbstractClassAndInterface.scala"],
print_discovered_classes = True,
suffixes = ["Test"],
)

scala_junit_test(
name = "JunitFiltersInnerClasses",
size = "small",
srcs = ["src/main/scala/scala/test/junit/JunitInnerClass.scala"],
srcs = ["src/main/scala/scalarules/test/junit/JunitInnerClass.scala"],
prefixes = ["Test"],
print_discovered_classes = True,
)

scala_junit_test(
name = "JunitFiltersClassesWithoutTests",
size = "small",
srcs = ["src/main/scala/scala/test/junit/JunitNoTests.scala"],
srcs = ["src/main/scala/scalarules/test/junit/JunitNoTests.scala"],
print_discovered_classes = True,
suffixes = ["Test"],
)

scala_junit_test(
name = "JunitIncludesClassesWithTestsFromParent",
size = "small",
srcs = ["src/main/scala/scala/test/junit/JunitIncludesTestHierarchies.scala"],
srcs = ["src/main/scala/scalarules/test/junit/JunitIncludesTestHierarchies.scala"],
print_discovered_classes = True,
suffixes = ["Test"],
)

scala_junit_test(
name = "JunitCustomRunner",
size = "small",
srcs = ["src/main/scala/scala/test/junit/JunitCustomRunnerTest.scala"],
srcs = ["src/main/scala/scalarules/test/junit/JunitCustomRunnerTest.scala"],
suffixes = ["Test"],
deps = [":customJunitRunner"],
)

scala_junit_test(
name = "JunitIncludesClassesWithRunWith",
size = "small",
srcs = ["src/main/scala/scala/test/junit/JunitIncludesRunWith.scala"],
srcs = ["src/main/scala/scalarules/test/junit/JunitIncludesRunWith.scala"],
print_discovered_classes = True,
suffixes = ["Test"],
)

scala_junit_test(
name = "JunitFilterTest",
size = "small",
srcs = ["src/main/scala/scala/test/junit/FilterTest.scala"],
srcs = ["src/main/scala/scalarules/test/junit/FilterTest.scala"],
print_discovered_classes = True,
suffixes = ["Test"],
)

scala_library(
name = "filesWithUtf8",
srcs = [
"src/main/scala/scala/test/utf8/JavaClassWithUtf8.java",
"src/main/scala/scala/test/utf8/ScalaClassWithUtf8.scala",
"src/main/scala/scalarules/test/utf8/JavaClassWithUtf8.java",
"src/main/scala/scalarules/test/utf8/ScalaClassWithUtf8.scala",
],
)

scala_library(
name = "customJunitRunner",
srcs = ["src/main/scala/scala/test/junit/JunitCustomRunner.java"],
srcs = ["src/main/scala/scalarules/test/junit/JunitCustomRunner.java"],
deps = ["//external:io_bazel_rules_scala/dependency/junit/junit"],
)

Expand All @@ -461,7 +461,7 @@ java_import(
scala_binary(
name = "ScalaBinary_with_fake",
srcs = ["ScalaBinary.scala"],
main_class = "scala.test.ScalaBinary",
main_class = "scalarules.test.ScalaBinary",
deps = [
":HelloLib",
":MacroTest",
Expand Down Expand Up @@ -490,7 +490,7 @@ sh_test(
scala_binary(
name = "ScalaBinary_with_service_manifest_srcs",
srcs = ["A.scala"],
main_class = "scala.test.A",
main_class = "scalarules.test.A",
deps = [
"//test/example_jars:example_jar1",
"//test/example_jars:example_jar2",
Expand All @@ -499,8 +499,8 @@ scala_binary(

scala_binary(
name = "ScalaBinary_dependent_on_binary_with_java",
srcs = ["src/main/scala/scala/test/BinaryDependentOnJava.scala"],
main_class = "scala.test.BinaryDependentOnJava",
srcs = ["src/main/scala/scalarules/test/BinaryDependentOnJava.scala"],
main_class = "scalarules.test.BinaryDependentOnJava",
deps = [":JavaOnlySources"],
)

Expand Down
2 changes: 1 addition & 1 deletion test/D.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package scala.test
package scalarules.test

object D {
def main(args: Array[String]) {
Expand Down
2 changes: 1 addition & 1 deletion test/DataRoot1.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package scala.test
package scalarules.test


object TestPointA {
Expand Down
2 changes: 1 addition & 1 deletion test/DataRoot2.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package scala.test
package scalarules.test


object TestPointB {
Expand Down
4 changes: 2 additions & 2 deletions test/Exported.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package scala.test
package scalarules.test

object Exported {
def message: String = {
// terrible, don't do this in real code:
val msg = Class.forName("scala.test.Runtime")
val msg = Class.forName("scalarules.test.Runtime")
.newInstance
.toString
"you all, everybody. " + msg
Expand Down
2 changes: 1 addition & 1 deletion test/HelloLib.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package scala.test
package scalarules.test

object HelloLib {
// This is to check the linter, which will recommend changing this
Expand Down
2 changes: 1 addition & 1 deletion test/HelloLibTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package scala.test
package scalarules.test

import org.scalatest._

Expand Down
2 changes: 1 addition & 1 deletion test/HelloLibTest2.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package scala.test
package scalarules.test

import org.scalatest._

Expand Down
2 changes: 1 addition & 1 deletion test/JavaBinary.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package scala.test;
package scalarules.test;

/** Example class */
public class JavaBinary {
Expand Down
Loading

0 comments on commit 93a2ad9

Please sign in to comment.