From a4e902d33504b9a3fe2c46901c67973a74b50f40 Mon Sep 17 00:00:00 2001 From: hsyed Date: Fri, 17 Aug 2018 17:36:47 +0100 Subject: [PATCH] consolate all srcs under src --- .bazelproject | 9 +- BUILD | 7 +- kotlin/builder/integrationtests/BUILD | 19 ---- .../KotlinBuilderActionTests.java | 13 --- .../KotlinBuilderTestSuite.java | 8 -- kotlin/builder/unittests/BUILD | 26 ------ .../kotlin/workers/BuilderUnitTestSuite.java | 25 ------ kotlin/internal/toolchains.bzl | 2 +- scripts/gen_proto_jars | 2 +- {kotlin/builder => src/main/kotlin}/BUILD | 15 ++-- .../builder => src/main/kotlin}/bootstrap.bzl | 9 +- .../kotlin}/io/bazel/kotlin/builder/BUILD | 12 +-- .../builder/KotlinBuilderComponent.java | 0 .../kotlin/builder/KotlinBuilderMain.java | 0 .../bazel/kotlin/builder/tasks/BazelWorker.kt | 0 .../kotlin/builder/tasks/KotlinBuilder.kt | 0 .../builder/tasks/js/Kotlin2JsTaskExecutor.kt | 0 .../builder/tasks/jvm/JDepsGenerator.kt | 0 .../kotlin/builder/tasks/jvm/JavaCompiler.kt | 0 .../kotlin/builder/tasks/jvm/JdepsParser.kt | 0 .../tasks/jvm/KotlinJvmTaskExecutor.kt | 0 .../builder/toolchain/KotlinToolException.kt | 0 .../builder/toolchain/KotlinToolchain.kt | 2 +- .../io/bazel/kotlin/builder/utils/ArgMap.kt | 0 .../builder/utils/CompilationTaskContext.kt | 0 .../io/bazel/kotlin/builder/utils/IOUtils.kt | 0 .../utils/KotlinCompilerPluginArgsEncoder.kt | 0 .../bazel/kotlin/builder/utils/MiscUtils.kt | 0 .../bazel/kotlin/builder/utils/TaskUtils.kt | 0 .../kotlin/builder/utils/jars/JarCreator.kt | 0 .../kotlin/builder/utils/jars/JarExtractor.kt | 0 .../kotlin/builder/utils/jars/JarHelper.kt | 0 .../builder/utils/jars/SourceJarCreator.kt | 0 .../builder/utils/jars/SourceJarExtractor.kt | 0 .../kotlin/compiler/BazelK2JVMCompiler.kt | 0 .../builder/proto => src/main/protobuf}/BUILD | 0 .../proto => src/main/protobuf}/deps.proto | 0 .../protobuf}/jars/libdeps_proto-speed.jar | Bin 48307 -> 48305 bytes .../jars/libkotlin_model_proto-speed.jar | Bin 177899 -> 177894 bytes .../jars/libworker_protocol_proto-speed.jar | Bin 38108 -> 38102 bytes .../main/protobuf}/kotlin_model.proto | 0 .../main/protobuf}/worker_protocol.proto | 0 {tests => src/test}/Bazel_all_local_tests.xml | 0 .../test/data}/jvm/basic/BUILD | 21 ++--- .../src/main/resources/main.txt | 0 .../src/test/resources/test.txt | 0 .../test/data}/jvm/basic/helloworld/Main.kt | 0 .../propagation/CompileTimeDependent.java | 0 .../basic/propagation/RuntimeDependent.java | 0 .../test/data}/jvm/basic/propagation/Stub.kt | 0 .../data}/jvm/basic/resourcejar/pkg/file.txt | 0 .../data}/jvm/basic/test_friends/Service.kt | 0 .../testresources/resources/one/alsoAFile.txt | 0 .../testresources/resources/one/two/aFile.txt | 0 .../jvm/basic/testresources/src/AClass.kt | 0 .../test/data}/jvm/kapt/BUILD | 4 +- .../jvm/kapt/java/TestAPNoGenReferences.java | 0 .../data}/jvm/kapt/java/TestAutoValue.java | 0 .../data}/jvm/kapt/java/TestJavaService.java | 0 .../jvm/kapt/kotlin/TestKtAPNoGenReference.kt | 0 .../data}/jvm/kapt/kotlin/TestKtService.kt | 0 .../test/data}/jvm/kapt/kotlin/TestKtValue.kt | 0 src/test/kotlin/io/bazel/kotlin/BUILD | 82 ++++++++++++++++++ .../bazel/kotlin/KotlinAssertionTestCase.kt | 4 +- .../kotlin/KotlinJvmBasicAssertionTest.kt | 13 ++- .../kotlin/KotlinJvmDaggerExampleTest.kt | 5 +- .../kotlin/KotlinJvmFriendsVisibilityTest.kt | 18 ++++ .../kotlin/KotlinJvmKaptAssertionTest.kt | 5 +- .../KotlinNormalizationAssertionTest.kt | 11 ++- src/test/kotlin/io/bazel/kotlin/builder/BUILD | 49 +++++++++++ .../builder}/KotlinBuilderTestCase.java | 8 +- .../builder}/tasks/jvm/JdepsParserTest.java | 0 .../tasks/jvm/KotlinBuilderJvmTest.java | 5 +- .../utils/jars/SourceJarCreatorTest.java | 2 +- src/test/kotlin/io/bazel/kotlin/defs.bzl | 39 +++++++++ tests/integrationtests/BUILD | 28 ------ tests/integrationtests/jvm/BUILD | 58 ------------- .../jvm/basic/test_friends/TestFriendsTest.kt | 13 --- tests/rules/BUILD | 27 ------ tests/rules/defs.bzl | 33 ------- 80 files changed, 249 insertions(+), 325 deletions(-) delete mode 100644 kotlin/builder/integrationtests/BUILD delete mode 100644 kotlin/builder/integrationtests/KotlinBuilderActionTests.java delete mode 100644 kotlin/builder/integrationtests/KotlinBuilderTestSuite.java delete mode 100644 kotlin/builder/unittests/BUILD delete mode 100644 kotlin/builder/unittests/io/bazel/kotlin/workers/BuilderUnitTestSuite.java rename {kotlin/builder => src/main/kotlin}/BUILD (80%) rename {kotlin/builder => src/main/kotlin}/bootstrap.bzl (90%) rename {kotlin/builder/src => src/main/kotlin}/io/bazel/kotlin/builder/BUILD (81%) rename {kotlin/builder/src => src/main/kotlin}/io/bazel/kotlin/builder/KotlinBuilderComponent.java (100%) rename {kotlin/builder/src => src/main/kotlin}/io/bazel/kotlin/builder/KotlinBuilderMain.java (100%) rename {kotlin/builder/src => src/main/kotlin}/io/bazel/kotlin/builder/tasks/BazelWorker.kt (100%) rename {kotlin/builder/src => src/main/kotlin}/io/bazel/kotlin/builder/tasks/KotlinBuilder.kt (100%) rename {kotlin/builder/src => src/main/kotlin}/io/bazel/kotlin/builder/tasks/js/Kotlin2JsTaskExecutor.kt (100%) rename {kotlin/builder/src => src/main/kotlin}/io/bazel/kotlin/builder/tasks/jvm/JDepsGenerator.kt (100%) rename {kotlin/builder/src => src/main/kotlin}/io/bazel/kotlin/builder/tasks/jvm/JavaCompiler.kt (100%) rename {kotlin/builder/src => src/main/kotlin}/io/bazel/kotlin/builder/tasks/jvm/JdepsParser.kt (100%) rename {kotlin/builder/src => src/main/kotlin}/io/bazel/kotlin/builder/tasks/jvm/KotlinJvmTaskExecutor.kt (100%) rename {kotlin/builder/src => src/main/kotlin}/io/bazel/kotlin/builder/toolchain/KotlinToolException.kt (100%) rename {kotlin/builder/src => src/main/kotlin}/io/bazel/kotlin/builder/toolchain/KotlinToolchain.kt (98%) rename {kotlin/builder/src => src/main/kotlin}/io/bazel/kotlin/builder/utils/ArgMap.kt (100%) rename {kotlin/builder/src => src/main/kotlin}/io/bazel/kotlin/builder/utils/CompilationTaskContext.kt (100%) rename {kotlin/builder/src => src/main/kotlin}/io/bazel/kotlin/builder/utils/IOUtils.kt (100%) rename {kotlin/builder/src => src/main/kotlin}/io/bazel/kotlin/builder/utils/KotlinCompilerPluginArgsEncoder.kt (100%) rename {kotlin/builder/src => src/main/kotlin}/io/bazel/kotlin/builder/utils/MiscUtils.kt (100%) rename {kotlin/builder/src => src/main/kotlin}/io/bazel/kotlin/builder/utils/TaskUtils.kt (100%) rename {kotlin/builder/src => src/main/kotlin}/io/bazel/kotlin/builder/utils/jars/JarCreator.kt (100%) rename {kotlin/builder/src => src/main/kotlin}/io/bazel/kotlin/builder/utils/jars/JarExtractor.kt (100%) rename {kotlin/builder/src => src/main/kotlin}/io/bazel/kotlin/builder/utils/jars/JarHelper.kt (100%) rename {kotlin/builder/src => src/main/kotlin}/io/bazel/kotlin/builder/utils/jars/SourceJarCreator.kt (100%) rename {kotlin/builder/src => src/main/kotlin}/io/bazel/kotlin/builder/utils/jars/SourceJarExtractor.kt (100%) rename {kotlin/builder/src => src/main/kotlin}/io/bazel/kotlin/compiler/BazelK2JVMCompiler.kt (100%) rename {kotlin/builder/proto => src/main/protobuf}/BUILD (100%) rename {kotlin/builder/proto => src/main/protobuf}/deps.proto (100%) rename {kotlin/builder/proto => src/main/protobuf}/jars/libdeps_proto-speed.jar (92%) rename {kotlin/builder/proto => src/main/protobuf}/jars/libkotlin_model_proto-speed.jar (95%) rename {kotlin/builder/proto => src/main/protobuf}/jars/libworker_protocol_proto-speed.jar (92%) rename {kotlin/builder/proto => src/main/protobuf}/kotlin_model.proto (100%) rename {kotlin/builder/proto => src/main/protobuf}/worker_protocol.proto (100%) rename {tests => src/test}/Bazel_all_local_tests.xml (100%) rename {tests/integrationtests => src/test/data}/jvm/basic/BUILD (85%) rename {tests/integrationtests => src/test/data}/jvm/basic/conventional_strip_resources/src/main/resources/main.txt (100%) rename {tests/integrationtests => src/test/data}/jvm/basic/conventional_strip_resources/src/test/resources/test.txt (100%) rename {tests/integrationtests => src/test/data}/jvm/basic/helloworld/Main.kt (100%) rename {tests/integrationtests => src/test/data}/jvm/basic/propagation/CompileTimeDependent.java (100%) rename {tests/integrationtests => src/test/data}/jvm/basic/propagation/RuntimeDependent.java (100%) rename {tests/integrationtests => src/test/data}/jvm/basic/propagation/Stub.kt (100%) rename {tests/integrationtests => src/test/data}/jvm/basic/resourcejar/pkg/file.txt (100%) rename {tests/integrationtests => src/test/data}/jvm/basic/test_friends/Service.kt (100%) rename {tests/integrationtests => src/test/data}/jvm/basic/testresources/resources/one/alsoAFile.txt (100%) rename {tests/integrationtests => src/test/data}/jvm/basic/testresources/resources/one/two/aFile.txt (100%) rename {tests/integrationtests => src/test/data}/jvm/basic/testresources/src/AClass.kt (100%) rename {tests/integrationtests => src/test/data}/jvm/kapt/BUILD (98%) rename {tests/integrationtests => src/test/data}/jvm/kapt/java/TestAPNoGenReferences.java (100%) rename {tests/integrationtests => src/test/data}/jvm/kapt/java/TestAutoValue.java (100%) rename {tests/integrationtests => src/test/data}/jvm/kapt/java/TestJavaService.java (100%) rename {tests/integrationtests => src/test/data}/jvm/kapt/kotlin/TestKtAPNoGenReference.kt (100%) rename {tests/integrationtests => src/test/data}/jvm/kapt/kotlin/TestKtService.kt (100%) rename {tests/integrationtests => src/test/data}/jvm/kapt/kotlin/TestKtValue.kt (100%) create mode 100644 src/test/kotlin/io/bazel/kotlin/BUILD rename tests/rules/AssertionTestCase.kt => src/test/kotlin/io/bazel/kotlin/KotlinAssertionTestCase.kt (97%) rename tests/integrationtests/jvm/JvmBasicFunctionalTests.kt => src/test/kotlin/io/bazel/kotlin/KotlinJvmBasicAssertionTest.kt (81%) rename tests/integrationtests/jvm/JvmExampleTests.kt => src/test/kotlin/io/bazel/kotlin/KotlinJvmDaggerExampleTest.kt (86%) create mode 100644 src/test/kotlin/io/bazel/kotlin/KotlinJvmFriendsVisibilityTest.kt rename tests/integrationtests/jvm/KaptTests.kt => src/test/kotlin/io/bazel/kotlin/KotlinJvmKaptAssertionTest.kt (96%) rename tests/integrationtests/jvm/JvmBasicLocalTests.kt => src/test/kotlin/io/bazel/kotlin/KotlinNormalizationAssertionTest.kt (78%) create mode 100644 src/test/kotlin/io/bazel/kotlin/builder/BUILD rename {kotlin/builder/integrationtests => src/test/kotlin/io/bazel/kotlin/builder}/KotlinBuilderTestCase.java (95%) rename {kotlin/builder/unittests/io/bazel/kotlin/workers => src/test/kotlin/io/bazel/kotlin/builder}/tasks/jvm/JdepsParserTest.java (100%) rename kotlin/builder/integrationtests/KotlinBuilderTests.java => src/test/kotlin/io/bazel/kotlin/builder/tasks/jvm/KotlinBuilderJvmTest.java (93%) rename kotlin/builder/unittests/io/bazel/kotlin/workers/utils/jars/SourceJarCreatorUnitTests.java => src/test/kotlin/io/bazel/kotlin/builder/utils/jars/SourceJarCreatorTest.java (97%) create mode 100644 src/test/kotlin/io/bazel/kotlin/defs.bzl delete mode 100644 tests/integrationtests/BUILD delete mode 100644 tests/integrationtests/jvm/BUILD delete mode 100644 tests/integrationtests/jvm/basic/test_friends/TestFriendsTest.kt delete mode 100644 tests/rules/BUILD delete mode 100644 tests/rules/defs.bzl diff --git a/.bazelproject b/.bazelproject index af125c4a6..b5daf792e 100644 --- a/.bazelproject +++ b/.bazelproject @@ -26,15 +26,14 @@ targets: //examples/dagger/... # These targets are built for the ide only. Primary purpose is to ensure the builder can build the targets, but it's # also a good way of testing the intellij plugin. - //kotlin/builder/src/io/bazel/kotlin/builder:builder_kt_for_ide - //kotlin/builder:compiler_lib_for_ide + //src/main/kotlin/io/bazel/kotlin/builder:builder_kt_for_ide + //src/main/kotlin:compiler_lib_for_ide test_sources: - */unittests/* - */integrationtests/* + src/test/* additional_languages: kotlin import_run_configurations: - tests/Bazel_all_local_tests.xml \ No newline at end of file + src/test/Bazel_all_local_tests.xml \ No newline at end of file diff --git a/BUILD b/BUILD index ed426b9a9..d8637e635 100644 --- a/BUILD +++ b/BUILD @@ -16,9 +16,8 @@ test_suite( name = "all_tests", tests = [ - "//kotlin/builder/integrationtests", - "//kotlin/builder/unittests", - "//tests/integrationtests", + "//src/test/kotlin/io/bazel/kotlin:assertion_tests", + "//src/test/kotlin/io/bazel/kotlin/builder:builder_tests", ], ) @@ -27,6 +26,6 @@ test_suite( name = "all_local_tests", tests = [ ":all_tests", - "//tests/integrationtests:integrationtests_local", + "//src/test/kotlin/io/bazel/kotlin:local_assertion_tests", ], ) diff --git a/kotlin/builder/integrationtests/BUILD b/kotlin/builder/integrationtests/BUILD deleted file mode 100644 index 44859306d..000000000 --- a/kotlin/builder/integrationtests/BUILD +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2018 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -java_test( - name = "integrationtests", - srcs = glob(["*.java"]), - test_class = "io.bazel.kotlin.builder.KotlinBuilderTestSuite", - deps = ["//kotlin/builder:builder_lib_for_tests"], -) diff --git a/kotlin/builder/integrationtests/KotlinBuilderActionTests.java b/kotlin/builder/integrationtests/KotlinBuilderActionTests.java deleted file mode 100644 index 2c6a82941..000000000 --- a/kotlin/builder/integrationtests/KotlinBuilderActionTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package io.bazel.kotlin.builder; - -import org.junit.Test; - -public class KotlinBuilderActionTests extends KotlinBuilderTestCase { - @Test - public void testCompileSimple() { - addSource("AClass.kt", "package something;" + "class AClass{}"); - component().jvmTaskExecutor().compileKotlin(builderCommand(), context(), true); - assertFileExists(DirectoryType.CLASSES, "something/AClass.class"); - assertFileDoesNotExist(outputs().getJar()); - } -} diff --git a/kotlin/builder/integrationtests/KotlinBuilderTestSuite.java b/kotlin/builder/integrationtests/KotlinBuilderTestSuite.java deleted file mode 100644 index 649c0f2b3..000000000 --- a/kotlin/builder/integrationtests/KotlinBuilderTestSuite.java +++ /dev/null @@ -1,8 +0,0 @@ -package io.bazel.kotlin.builder; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -@RunWith(Suite.class) -@Suite.SuiteClasses({KotlinBuilderActionTests.class, KotlinBuilderTests.class}) -public class KotlinBuilderTestSuite {} diff --git a/kotlin/builder/unittests/BUILD b/kotlin/builder/unittests/BUILD deleted file mode 100644 index aeaac2899..000000000 --- a/kotlin/builder/unittests/BUILD +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2018 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -java_test( - name = "unittests", - size = "small", - srcs = glob(["**/*.java"]), - test_class = "io.bazel.kotlin.builder.BuilderUnitTestSuite", - deps = [ - "//kotlin/builder:builder_lib_for_tests", - "//third_party/jvm/com/google/truth", - "@com_github_jetbrains_kotlin//:kotlin-stdlib", - "@io_bazel_rules_kotlin//kotlin/builder/proto:deps", - "@io_bazel_rules_kotlin_com_google_protobuf_protobuf_java//jar", - ], -) diff --git a/kotlin/builder/unittests/io/bazel/kotlin/workers/BuilderUnitTestSuite.java b/kotlin/builder/unittests/io/bazel/kotlin/workers/BuilderUnitTestSuite.java deleted file mode 100644 index 0830110bf..000000000 --- a/kotlin/builder/unittests/io/bazel/kotlin/workers/BuilderUnitTestSuite.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2018 The Bazel Authors. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package io.bazel.kotlin.builder; - -import io.bazel.kotlin.builder.tasks.jvm.JdepsParserTest; -import io.bazel.kotlin.builder.utils.jars.SourceJarCreatorUnitTests; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -@RunWith(Suite.class) -@Suite.SuiteClasses({JdepsParserTest.class, SourceJarCreatorUnitTests.class}) -public class BuilderUnitTestSuite {} diff --git a/kotlin/internal/toolchains.bzl b/kotlin/internal/toolchains.bzl index 1f37febc8..1631cbbdf 100644 --- a/kotlin/internal/toolchains.bzl +++ b/kotlin/internal/toolchains.bzl @@ -73,7 +73,7 @@ _kt_toolchain = rule( ), "kotlinbuilder": attr.label( doc = "the kotlin builder executable", - default = Label("//kotlin/builder"), + default = Label("//src/main/kotlin:builder"), executable = True, allow_files = True, cfg = "host", diff --git a/scripts/gen_proto_jars b/scripts/gen_proto_jars index 217d1b38c..1e7141471 100755 --- a/scripts/gen_proto_jars +++ b/scripts/gen_proto_jars @@ -19,7 +19,7 @@ # If (when) Bazel distributes a host protoc this file can be removed. WS_ROOT=$(bazel info workspace) -PROTO_PATH=kotlin/builder/proto +PROTO_PATH=src/main/protobuf JAR_DIR=${WS_ROOT}/${PROTO_PATH}/jars function build_lib() { diff --git a/kotlin/builder/BUILD b/src/main/kotlin/BUILD similarity index 80% rename from kotlin/builder/BUILD rename to src/main/kotlin/BUILD index 234c3f96d..ede4beac6 100644 --- a/kotlin/builder/BUILD +++ b/src/main/kotlin/BUILD @@ -11,13 +11,13 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -load("//kotlin/builder:bootstrap.bzl", "kt_bootstrap_library") +load("//src/main/kotlin:bootstrap.bzl", "kt_bootstrap_library") load("//kotlin:kotlin.bzl", "kt_jvm_library") # The compiler library, this is co-located in the kotlin compiler classloader. kt_bootstrap_library( name = "compiler_lib", - srcs = glob(["src/io/bazel/kotlin/compiler/**/*.kt"]), + srcs = glob(["io/bazel/kotlin/compiler/*.kt"]), neverlink_deps = [ "@com_github_jetbrains_kotlin//:kotlin-compiler", "@com_github_jetbrains_kotlin//:kotlin-annotation-processing", @@ -31,7 +31,7 @@ java_binary( data = [":compiler_lib.jar"], main_class = "io.bazel.kotlin.builder.KotlinBuilderMain", visibility = ["//visibility:public"], - runtime_deps = ["//kotlin/builder/src/io/bazel/kotlin/builder"], + runtime_deps = ["//src/main/kotlin/io/bazel/kotlin/builder"], ) filegroup( @@ -51,15 +51,14 @@ java_library( testonly = 1, data = [":data_for_tests"], visibility = [ - "//kotlin/builder/integrationtests:__subpackages__", - "//kotlin/builder/unittests:__subpackages__", + "//src/test:__subpackages__", ], exports = [ - "//kotlin/builder/src/io/bazel/kotlin/builder", + "//src/main/kotlin/io/bazel/kotlin/builder:builder", "//third_party/jvm/com/google/truth", "//third_party/jvm/junit", - "@io_bazel_rules_kotlin//kotlin/builder/proto:deps", - "@io_bazel_rules_kotlin//kotlin/builder/proto:kotlin_model", + "//src/main/protobuf:deps", + "//src/main/protobuf:kotlin_model", "@io_bazel_rules_kotlin_com_google_guava_guava//jar", "@io_bazel_rules_kotlin_com_google_protobuf_protobuf_java//jar", ], diff --git a/kotlin/builder/bootstrap.bzl b/src/main/kotlin/bootstrap.bzl similarity index 90% rename from kotlin/builder/bootstrap.bzl rename to src/main/kotlin/bootstrap.bzl index 663fd4e0f..02e184be2 100644 --- a/kotlin/builder/bootstrap.bzl +++ b/src/main/kotlin/bootstrap.bzl @@ -16,7 +16,7 @@ load("//kotlin:kotlin.bzl", _for_ide = "kt_jvm_library") _BOOTSTRAP_LIB_ARGS = ["-jvm-target", "1.8"] def _resolve_dep_label(d): - if d.startswith("//kotlin/builder/src/io/bazel/kotlin") and not d.endswith("_for_ide"): + if d.startswith("///src/main/kotlin/io/bazel/kotlin") and not d.endswith("_for_ide"): prefix, _, target = d.rpartition(":") if target == None: # untested @@ -32,7 +32,7 @@ def kt_bootstrap_library(name, srcs, deps = [], neverlink_deps = [], runtime_dep Simple compilation of a kotlin library using a non-persistent worker. The target is a JavaInfo provider. The target is tagged `"no-ide"` as intellij can't compile it. A seperate private target is created which is suffixed - with `_for_ide`. If the dep is under the package `//kotlin/builder/src/io/bazel/kotlin/builder/...` then it will be + with `_for_ide`. If the dep is under the package `//src/main/kotlin/io/bazel/kotlin/builder/...` then it will be added to the `_for_ide` target by adding a `_for_ide` prefix. deps: the dependenices, the are setup as runtime_deps of the library. @@ -87,13 +87,14 @@ rm $${NAME}_temp.jar jars = [jar_label], tags = ["no-ide"], runtime_deps = deps + runtime_deps, - visibility = ["//visibility:public"], + visibility = ["//visibility:private"], ) # hsyed todo this part of the graph should not be wired up outside of development. _for_ide( name = name + "_for_ide", srcs = srcs, + neverlink = 1, deps = [_resolve_dep_label(d) for d in deps] + neverlink_deps, - visibility = ["//kotlin/builder:__subpackages__"], + visibility = ["//visibility:private"], ) diff --git a/kotlin/builder/src/io/bazel/kotlin/builder/BUILD b/src/main/kotlin/io/bazel/kotlin/builder/BUILD similarity index 81% rename from kotlin/builder/src/io/bazel/kotlin/builder/BUILD rename to src/main/kotlin/io/bazel/kotlin/builder/BUILD index ca0cfa26c..6957022ce 100644 --- a/kotlin/builder/src/io/bazel/kotlin/builder/BUILD +++ b/src/main/kotlin/io/bazel/kotlin/builder/BUILD @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -load("//kotlin/builder:bootstrap.bzl", "kt_bootstrap_library") +load("//src/main/kotlin:bootstrap.bzl", "kt_bootstrap_library") kt_bootstrap_library( name = "builder_kt", @@ -22,9 +22,9 @@ kt_bootstrap_library( ]), deps = [ "@com_github_jetbrains_kotlin//:kotlin-preloader", - "@io_bazel_rules_kotlin//kotlin/builder/proto:deps", - "@io_bazel_rules_kotlin//kotlin/builder/proto:kotlin_model", - "@io_bazel_rules_kotlin//kotlin/builder/proto:worker", + "//src/main/protobuf:deps", + "//src/main/protobuf:kotlin_model", + "//src/main/protobuf:worker", "@io_bazel_rules_kotlin_com_google_protobuf_protobuf_java//jar", "@io_bazel_rules_kotlin_com_google_protobuf_protobuf_java_util//jar", "@io_bazel_rules_kotlin_javax_inject_javax_inject//jar", @@ -34,7 +34,7 @@ kt_bootstrap_library( java_library( name = "builder", srcs = glob(["*.java"]), - visibility = ["//kotlin/builder:__subpackages__"], + visibility = ["//src/main/kotlin:__subpackages__"], exports = [":builder_kt"], runtime_deps = [ "@com_github_jetbrains_kotlin//:kotlin-stdlib-jdk7", @@ -43,7 +43,7 @@ java_library( ], deps = [ ":builder_kt", - "//kotlin/builder/proto:kotlin_model", + "//src/main/protobuf:kotlin_model", "//third_party:dagger", "@com_github_jetbrains_kotlin//:kotlin-stdlib", "@io_bazel_rules_kotlin_com_google_protobuf_protobuf_java//jar", diff --git a/kotlin/builder/src/io/bazel/kotlin/builder/KotlinBuilderComponent.java b/src/main/kotlin/io/bazel/kotlin/builder/KotlinBuilderComponent.java similarity index 100% rename from kotlin/builder/src/io/bazel/kotlin/builder/KotlinBuilderComponent.java rename to src/main/kotlin/io/bazel/kotlin/builder/KotlinBuilderComponent.java diff --git a/kotlin/builder/src/io/bazel/kotlin/builder/KotlinBuilderMain.java b/src/main/kotlin/io/bazel/kotlin/builder/KotlinBuilderMain.java similarity index 100% rename from kotlin/builder/src/io/bazel/kotlin/builder/KotlinBuilderMain.java rename to src/main/kotlin/io/bazel/kotlin/builder/KotlinBuilderMain.java diff --git a/kotlin/builder/src/io/bazel/kotlin/builder/tasks/BazelWorker.kt b/src/main/kotlin/io/bazel/kotlin/builder/tasks/BazelWorker.kt similarity index 100% rename from kotlin/builder/src/io/bazel/kotlin/builder/tasks/BazelWorker.kt rename to src/main/kotlin/io/bazel/kotlin/builder/tasks/BazelWorker.kt diff --git a/kotlin/builder/src/io/bazel/kotlin/builder/tasks/KotlinBuilder.kt b/src/main/kotlin/io/bazel/kotlin/builder/tasks/KotlinBuilder.kt similarity index 100% rename from kotlin/builder/src/io/bazel/kotlin/builder/tasks/KotlinBuilder.kt rename to src/main/kotlin/io/bazel/kotlin/builder/tasks/KotlinBuilder.kt diff --git a/kotlin/builder/src/io/bazel/kotlin/builder/tasks/js/Kotlin2JsTaskExecutor.kt b/src/main/kotlin/io/bazel/kotlin/builder/tasks/js/Kotlin2JsTaskExecutor.kt similarity index 100% rename from kotlin/builder/src/io/bazel/kotlin/builder/tasks/js/Kotlin2JsTaskExecutor.kt rename to src/main/kotlin/io/bazel/kotlin/builder/tasks/js/Kotlin2JsTaskExecutor.kt diff --git a/kotlin/builder/src/io/bazel/kotlin/builder/tasks/jvm/JDepsGenerator.kt b/src/main/kotlin/io/bazel/kotlin/builder/tasks/jvm/JDepsGenerator.kt similarity index 100% rename from kotlin/builder/src/io/bazel/kotlin/builder/tasks/jvm/JDepsGenerator.kt rename to src/main/kotlin/io/bazel/kotlin/builder/tasks/jvm/JDepsGenerator.kt diff --git a/kotlin/builder/src/io/bazel/kotlin/builder/tasks/jvm/JavaCompiler.kt b/src/main/kotlin/io/bazel/kotlin/builder/tasks/jvm/JavaCompiler.kt similarity index 100% rename from kotlin/builder/src/io/bazel/kotlin/builder/tasks/jvm/JavaCompiler.kt rename to src/main/kotlin/io/bazel/kotlin/builder/tasks/jvm/JavaCompiler.kt diff --git a/kotlin/builder/src/io/bazel/kotlin/builder/tasks/jvm/JdepsParser.kt b/src/main/kotlin/io/bazel/kotlin/builder/tasks/jvm/JdepsParser.kt similarity index 100% rename from kotlin/builder/src/io/bazel/kotlin/builder/tasks/jvm/JdepsParser.kt rename to src/main/kotlin/io/bazel/kotlin/builder/tasks/jvm/JdepsParser.kt diff --git a/kotlin/builder/src/io/bazel/kotlin/builder/tasks/jvm/KotlinJvmTaskExecutor.kt b/src/main/kotlin/io/bazel/kotlin/builder/tasks/jvm/KotlinJvmTaskExecutor.kt similarity index 100% rename from kotlin/builder/src/io/bazel/kotlin/builder/tasks/jvm/KotlinJvmTaskExecutor.kt rename to src/main/kotlin/io/bazel/kotlin/builder/tasks/jvm/KotlinJvmTaskExecutor.kt diff --git a/kotlin/builder/src/io/bazel/kotlin/builder/toolchain/KotlinToolException.kt b/src/main/kotlin/io/bazel/kotlin/builder/toolchain/KotlinToolException.kt similarity index 100% rename from kotlin/builder/src/io/bazel/kotlin/builder/toolchain/KotlinToolException.kt rename to src/main/kotlin/io/bazel/kotlin/builder/toolchain/KotlinToolException.kt diff --git a/kotlin/builder/src/io/bazel/kotlin/builder/toolchain/KotlinToolchain.kt b/src/main/kotlin/io/bazel/kotlin/builder/toolchain/KotlinToolchain.kt similarity index 98% rename from kotlin/builder/src/io/bazel/kotlin/builder/toolchain/KotlinToolchain.kt rename to src/main/kotlin/io/bazel/kotlin/builder/toolchain/KotlinToolchain.kt index 3b74053c3..167ba0f3f 100644 --- a/kotlin/builder/src/io/bazel/kotlin/builder/toolchain/KotlinToolchain.kt +++ b/src/main/kotlin/io/bazel/kotlin/builder/toolchain/KotlinToolchain.kt @@ -50,7 +50,7 @@ class KotlinToolchain private constructor( private fun createClassLoader(javaHome: Path, kotlinHome: Path): ClassLoader { val preloadJars = mutableListOf().also { it += kotlinHome.resolveVerified("lib", "kotlin-compiler.jar") - it += javaRunfiles.resolveVerified("io_bazel_rules_kotlin", "kotlin", "builder", "compiler_lib.jar") + it += javaRunfiles.resolveVerified("io_bazel_rules_kotlin", "src", "main", "kotlin", "compiler_lib.jar") if (!isJdk9OrNewer) { it += javaHome.resolveVerified("lib", "tools.jar") } diff --git a/kotlin/builder/src/io/bazel/kotlin/builder/utils/ArgMap.kt b/src/main/kotlin/io/bazel/kotlin/builder/utils/ArgMap.kt similarity index 100% rename from kotlin/builder/src/io/bazel/kotlin/builder/utils/ArgMap.kt rename to src/main/kotlin/io/bazel/kotlin/builder/utils/ArgMap.kt diff --git a/kotlin/builder/src/io/bazel/kotlin/builder/utils/CompilationTaskContext.kt b/src/main/kotlin/io/bazel/kotlin/builder/utils/CompilationTaskContext.kt similarity index 100% rename from kotlin/builder/src/io/bazel/kotlin/builder/utils/CompilationTaskContext.kt rename to src/main/kotlin/io/bazel/kotlin/builder/utils/CompilationTaskContext.kt diff --git a/kotlin/builder/src/io/bazel/kotlin/builder/utils/IOUtils.kt b/src/main/kotlin/io/bazel/kotlin/builder/utils/IOUtils.kt similarity index 100% rename from kotlin/builder/src/io/bazel/kotlin/builder/utils/IOUtils.kt rename to src/main/kotlin/io/bazel/kotlin/builder/utils/IOUtils.kt diff --git a/kotlin/builder/src/io/bazel/kotlin/builder/utils/KotlinCompilerPluginArgsEncoder.kt b/src/main/kotlin/io/bazel/kotlin/builder/utils/KotlinCompilerPluginArgsEncoder.kt similarity index 100% rename from kotlin/builder/src/io/bazel/kotlin/builder/utils/KotlinCompilerPluginArgsEncoder.kt rename to src/main/kotlin/io/bazel/kotlin/builder/utils/KotlinCompilerPluginArgsEncoder.kt diff --git a/kotlin/builder/src/io/bazel/kotlin/builder/utils/MiscUtils.kt b/src/main/kotlin/io/bazel/kotlin/builder/utils/MiscUtils.kt similarity index 100% rename from kotlin/builder/src/io/bazel/kotlin/builder/utils/MiscUtils.kt rename to src/main/kotlin/io/bazel/kotlin/builder/utils/MiscUtils.kt diff --git a/kotlin/builder/src/io/bazel/kotlin/builder/utils/TaskUtils.kt b/src/main/kotlin/io/bazel/kotlin/builder/utils/TaskUtils.kt similarity index 100% rename from kotlin/builder/src/io/bazel/kotlin/builder/utils/TaskUtils.kt rename to src/main/kotlin/io/bazel/kotlin/builder/utils/TaskUtils.kt diff --git a/kotlin/builder/src/io/bazel/kotlin/builder/utils/jars/JarCreator.kt b/src/main/kotlin/io/bazel/kotlin/builder/utils/jars/JarCreator.kt similarity index 100% rename from kotlin/builder/src/io/bazel/kotlin/builder/utils/jars/JarCreator.kt rename to src/main/kotlin/io/bazel/kotlin/builder/utils/jars/JarCreator.kt diff --git a/kotlin/builder/src/io/bazel/kotlin/builder/utils/jars/JarExtractor.kt b/src/main/kotlin/io/bazel/kotlin/builder/utils/jars/JarExtractor.kt similarity index 100% rename from kotlin/builder/src/io/bazel/kotlin/builder/utils/jars/JarExtractor.kt rename to src/main/kotlin/io/bazel/kotlin/builder/utils/jars/JarExtractor.kt diff --git a/kotlin/builder/src/io/bazel/kotlin/builder/utils/jars/JarHelper.kt b/src/main/kotlin/io/bazel/kotlin/builder/utils/jars/JarHelper.kt similarity index 100% rename from kotlin/builder/src/io/bazel/kotlin/builder/utils/jars/JarHelper.kt rename to src/main/kotlin/io/bazel/kotlin/builder/utils/jars/JarHelper.kt diff --git a/kotlin/builder/src/io/bazel/kotlin/builder/utils/jars/SourceJarCreator.kt b/src/main/kotlin/io/bazel/kotlin/builder/utils/jars/SourceJarCreator.kt similarity index 100% rename from kotlin/builder/src/io/bazel/kotlin/builder/utils/jars/SourceJarCreator.kt rename to src/main/kotlin/io/bazel/kotlin/builder/utils/jars/SourceJarCreator.kt diff --git a/kotlin/builder/src/io/bazel/kotlin/builder/utils/jars/SourceJarExtractor.kt b/src/main/kotlin/io/bazel/kotlin/builder/utils/jars/SourceJarExtractor.kt similarity index 100% rename from kotlin/builder/src/io/bazel/kotlin/builder/utils/jars/SourceJarExtractor.kt rename to src/main/kotlin/io/bazel/kotlin/builder/utils/jars/SourceJarExtractor.kt diff --git a/kotlin/builder/src/io/bazel/kotlin/compiler/BazelK2JVMCompiler.kt b/src/main/kotlin/io/bazel/kotlin/compiler/BazelK2JVMCompiler.kt similarity index 100% rename from kotlin/builder/src/io/bazel/kotlin/compiler/BazelK2JVMCompiler.kt rename to src/main/kotlin/io/bazel/kotlin/compiler/BazelK2JVMCompiler.kt diff --git a/kotlin/builder/proto/BUILD b/src/main/protobuf/BUILD similarity index 100% rename from kotlin/builder/proto/BUILD rename to src/main/protobuf/BUILD diff --git a/kotlin/builder/proto/deps.proto b/src/main/protobuf/deps.proto similarity index 100% rename from kotlin/builder/proto/deps.proto rename to src/main/protobuf/deps.proto diff --git a/kotlin/builder/proto/jars/libdeps_proto-speed.jar b/src/main/protobuf/jars/libdeps_proto-speed.jar similarity index 92% rename from kotlin/builder/proto/jars/libdeps_proto-speed.jar rename to src/main/protobuf/jars/libdeps_proto-speed.jar index 3749615fb9c75a02043ea3a539dbdeef4b8e9a4b..d3a8e294470084f3f5167e33e90115a7f413a712 100755 GIT binary patch delta 2154 zcmY+Fc{tQ-8^`%&216KINsd#Dy%?3zp&UCidTm*b%CQYon6V^FGN(ag%8Y(TYD|`~ zWEW$bu_U?(N7i^{1~aEK$R>4DVhpRb=Z*nXfNGmDutG=V` zfR>VQ8yQu;UF_mm?m5nOJnHY?sv3)u*t|YFJ4;NaoGznll-W~ywJC&-&3&6?vL6|S z3G~)nliYf=+ww^+D>^pm81q$F=4igFG9@D}0&*@A zO)T{A=(?!FPB{jD5?O@g(}hbX2w5_SqU;p7ila@%=q7QSs>4cG$M_ zg3Q1vrcd9T^a77MxTo+aXF#`uHlRPIS?M9<%y%~Wt>HF*HNSL&g%H_#nVdqr*6Cp8 z(oZC}n@vMfe>qE{ji$vUi;tlax$hef>-a_X7ry-=C_NbZdVhd|XX+nSy7O8VKEE2Q z{&oJQ(}8GOwNyu)O0@Ih*=<(A6wKna&t2XtG{Y$RhHw9aF(KGt_6jq2sB$sf_k|j) zyT#w>K`iTy%W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9n5TPwD=xVE%PX2lg^aaqM%sUnfGYoQhhw_7M!cRSqc8 zdP@SJrz#)|)=N^WER_RLT1D7zgogpY8*!2`JO17z1Fr zF`x)WS5h?-v;9aKT&M(;AQqr78Msc%gx!ayK_e{i`;GRIscCQe?(YW*mihwppkNhs zy=BC2lp68Jnpj1hm;hK>1(*Vk(O_8>a2yn?24rY;6ZgGGKuk5DLK~m-FJb^YssSGQ Kr3`>Nr~d)7;@gz~ diff --git a/kotlin/builder/proto/jars/libworker_protocol_proto-speed.jar b/src/main/protobuf/jars/libworker_protocol_proto-speed.jar similarity index 92% rename from kotlin/builder/proto/jars/libworker_protocol_proto-speed.jar rename to src/main/protobuf/jars/libworker_protocol_proto-speed.jar index 672d62299a40c8a969d15e2d358a8f7f5226c497..6fb7dc9fcdf5e86d75d5603a44eab6b0d083c32f 100755 GIT binary patch delta 1677 zcmYk6c{tk#7{`;Jn@G!}B3f5h8kr^%$E2mRV%ntDIwDWh5vq<(B2-k?O}ZW^66EJ7 z>WnLwqu5Gy)6o(Zta>R`MCRDmqA0D_tWTeA?;r2;e!lPf{_(zle8+^qBO#DY&=Q#+ zmGK}D2ruUlS?_H8DJ(rSnt^4;$0o#vu_BtpzhAM*_u}I+;e}3i-Yu`iw_OregoCRU z4L{bCn=nB^;_rpq-W{R8F4U5#dTM!tbt&c?>ieXEFAd)J9!}DuUiBwH&ln)orY(DW zwTJfDEA%<6!iHt5-vs8J+nJWycG{#vJO4rvy#u*Z0R}oiz0OUG2^aPC>!HC11pyuc zny{OP&=#?eQfx@AsvU!k<2u)DQ%OaozQ>?uw)Sle^|^lih6@&M#gSbq@6s%sgHfD( z&1IZhbF-u);)!5K%tIU08_DU3(u^X}Ov(-F!yB+y68`Vjm?m7A{Hu`B9&&nl zn7GaNGI?n}LG))_XuRc$AH_LG!Xa$Xp7|vAJUN-#QaooYNS#N#YDTkJ4q4Id^K#nr zbfhG&e8{8MLY|ywVf3;zLes=9K0JaR@OfP==@qh--`bKxUXH%|z$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JpdNzUI&6+^Zw_^mKc&7iFE@x^{-++M7eJm z`Jt3m2Fx^@R~2C}Q%x8Q*(6i4x2%=>)g=BODBMcjeq9EfDFrlCVzA3YS+?2Osm9jbrVru|V znI0t7k!^hos+bzUhN%bTns0R!GM%BnEM#;9WR@CGWZ6IyhrUEND8*}w2>f>No@EU^ z3;h!Hwoav$>&ZC+Zh0D{7O_?E1@6#v(if_MXD4|BG;z{TTl)h$d@t R0Dd$jaGR~66k77R^bbD&=5+u7 diff --git a/kotlin/builder/proto/kotlin_model.proto b/src/main/protobuf/kotlin_model.proto similarity index 100% rename from kotlin/builder/proto/kotlin_model.proto rename to src/main/protobuf/kotlin_model.proto diff --git a/kotlin/builder/proto/worker_protocol.proto b/src/main/protobuf/worker_protocol.proto similarity index 100% rename from kotlin/builder/proto/worker_protocol.proto rename to src/main/protobuf/worker_protocol.proto diff --git a/tests/Bazel_all_local_tests.xml b/src/test/Bazel_all_local_tests.xml similarity index 100% rename from tests/Bazel_all_local_tests.xml rename to src/test/Bazel_all_local_tests.xml diff --git a/tests/integrationtests/jvm/basic/BUILD b/src/test/data/jvm/basic/BUILD similarity index 85% rename from tests/integrationtests/jvm/basic/BUILD rename to src/test/data/jvm/basic/BUILD index fdda1270a..16a016cb1 100644 --- a/tests/integrationtests/jvm/basic/BUILD +++ b/src/test/data/jvm/basic/BUILD @@ -11,6 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +package(default_visibility=["//visibility:private"]) load("//kotlin:kotlin.bzl", "kt_jvm_binary", "kt_jvm_library", "kt_jvm_test") kt_jvm_binary( @@ -33,7 +34,7 @@ kt_jvm_library( # a test resource library. java_library( name = "resourcejar", - resource_strip_prefix = "tests/integrationtests/jvm/basic/resourcejar", + resource_strip_prefix = "src/test/data/jvm/basic/resourcejar", resources = glob(["resourcejar/**"]), ) @@ -54,7 +55,7 @@ kt_jvm_library( kt_jvm_library( name = "test_embed_resources_strip_prefix", srcs = glob(["testresources/src/*.kt"]), - resource_strip_prefix = "tests/integrationtests/jvm/basic/testresources/resources", + resource_strip_prefix = "src/test/data/jvm/basic/testresources/resources", resources = glob(["testresources/resources/**/*"]), ) @@ -103,21 +104,11 @@ java_binary( kt_jvm_library( name = "test_friends_library", srcs = ["test_friends/Service.kt"], -) - -# This test should be explicetly executed as module name mangling handling could regress otherwise. -kt_jvm_test( - name = "friends_tests", - srcs = ["test_friends/TestFriendsTest.kt"], - friends = [":test_friends_library"], - test_class = "test.TestFriendsTest", - deps = [ - "//third_party/jvm/junit", - ], + visibility = ["//src/test/kotlin:__subpackages__"] ) filegroup( - name = "cases", + name = "basic", srcs = [ ":conventional_strip_resources.jar", ":propagation_ct_consumer", @@ -131,5 +122,5 @@ filegroup( ":test_module_name_bin.jar", ":test_module_name_lib", ], - visibility = ["//tests/integrationtests:__subpackages__"], + visibility = ["//visibility:public"], ) diff --git a/tests/integrationtests/jvm/basic/conventional_strip_resources/src/main/resources/main.txt b/src/test/data/jvm/basic/conventional_strip_resources/src/main/resources/main.txt similarity index 100% rename from tests/integrationtests/jvm/basic/conventional_strip_resources/src/main/resources/main.txt rename to src/test/data/jvm/basic/conventional_strip_resources/src/main/resources/main.txt diff --git a/tests/integrationtests/jvm/basic/conventional_strip_resources/src/test/resources/test.txt b/src/test/data/jvm/basic/conventional_strip_resources/src/test/resources/test.txt similarity index 100% rename from tests/integrationtests/jvm/basic/conventional_strip_resources/src/test/resources/test.txt rename to src/test/data/jvm/basic/conventional_strip_resources/src/test/resources/test.txt diff --git a/tests/integrationtests/jvm/basic/helloworld/Main.kt b/src/test/data/jvm/basic/helloworld/Main.kt similarity index 100% rename from tests/integrationtests/jvm/basic/helloworld/Main.kt rename to src/test/data/jvm/basic/helloworld/Main.kt diff --git a/tests/integrationtests/jvm/basic/propagation/CompileTimeDependent.java b/src/test/data/jvm/basic/propagation/CompileTimeDependent.java similarity index 100% rename from tests/integrationtests/jvm/basic/propagation/CompileTimeDependent.java rename to src/test/data/jvm/basic/propagation/CompileTimeDependent.java diff --git a/tests/integrationtests/jvm/basic/propagation/RuntimeDependent.java b/src/test/data/jvm/basic/propagation/RuntimeDependent.java similarity index 100% rename from tests/integrationtests/jvm/basic/propagation/RuntimeDependent.java rename to src/test/data/jvm/basic/propagation/RuntimeDependent.java diff --git a/tests/integrationtests/jvm/basic/propagation/Stub.kt b/src/test/data/jvm/basic/propagation/Stub.kt similarity index 100% rename from tests/integrationtests/jvm/basic/propagation/Stub.kt rename to src/test/data/jvm/basic/propagation/Stub.kt diff --git a/tests/integrationtests/jvm/basic/resourcejar/pkg/file.txt b/src/test/data/jvm/basic/resourcejar/pkg/file.txt similarity index 100% rename from tests/integrationtests/jvm/basic/resourcejar/pkg/file.txt rename to src/test/data/jvm/basic/resourcejar/pkg/file.txt diff --git a/tests/integrationtests/jvm/basic/test_friends/Service.kt b/src/test/data/jvm/basic/test_friends/Service.kt similarity index 100% rename from tests/integrationtests/jvm/basic/test_friends/Service.kt rename to src/test/data/jvm/basic/test_friends/Service.kt diff --git a/tests/integrationtests/jvm/basic/testresources/resources/one/alsoAFile.txt b/src/test/data/jvm/basic/testresources/resources/one/alsoAFile.txt similarity index 100% rename from tests/integrationtests/jvm/basic/testresources/resources/one/alsoAFile.txt rename to src/test/data/jvm/basic/testresources/resources/one/alsoAFile.txt diff --git a/tests/integrationtests/jvm/basic/testresources/resources/one/two/aFile.txt b/src/test/data/jvm/basic/testresources/resources/one/two/aFile.txt similarity index 100% rename from tests/integrationtests/jvm/basic/testresources/resources/one/two/aFile.txt rename to src/test/data/jvm/basic/testresources/resources/one/two/aFile.txt diff --git a/tests/integrationtests/jvm/basic/testresources/src/AClass.kt b/src/test/data/jvm/basic/testresources/src/AClass.kt similarity index 100% rename from tests/integrationtests/jvm/basic/testresources/src/AClass.kt rename to src/test/data/jvm/basic/testresources/src/AClass.kt diff --git a/tests/integrationtests/jvm/kapt/BUILD b/src/test/data/jvm/kapt/BUILD similarity index 98% rename from tests/integrationtests/jvm/kapt/BUILD rename to src/test/data/jvm/kapt/BUILD index 9ab3b6fe5..358b6ed8e 100644 --- a/tests/integrationtests/jvm/kapt/BUILD +++ b/src/test/data/jvm/kapt/BUILD @@ -142,7 +142,7 @@ kt_jvm_library( ) filegroup( - name = "cases", + name = "kapt", srcs = [ ":ap_kotlin.jar", ":ap_kotlin_mixed", @@ -153,5 +153,5 @@ filegroup( ":ap_kotlin_resources", ":ap_kotlin_resources_mixed", ], - visibility = ["//tests/integrationtests:__subpackages__"], + visibility = ["//visibility:public"], ) diff --git a/tests/integrationtests/jvm/kapt/java/TestAPNoGenReferences.java b/src/test/data/jvm/kapt/java/TestAPNoGenReferences.java similarity index 100% rename from tests/integrationtests/jvm/kapt/java/TestAPNoGenReferences.java rename to src/test/data/jvm/kapt/java/TestAPNoGenReferences.java diff --git a/tests/integrationtests/jvm/kapt/java/TestAutoValue.java b/src/test/data/jvm/kapt/java/TestAutoValue.java similarity index 100% rename from tests/integrationtests/jvm/kapt/java/TestAutoValue.java rename to src/test/data/jvm/kapt/java/TestAutoValue.java diff --git a/tests/integrationtests/jvm/kapt/java/TestJavaService.java b/src/test/data/jvm/kapt/java/TestJavaService.java similarity index 100% rename from tests/integrationtests/jvm/kapt/java/TestJavaService.java rename to src/test/data/jvm/kapt/java/TestJavaService.java diff --git a/tests/integrationtests/jvm/kapt/kotlin/TestKtAPNoGenReference.kt b/src/test/data/jvm/kapt/kotlin/TestKtAPNoGenReference.kt similarity index 100% rename from tests/integrationtests/jvm/kapt/kotlin/TestKtAPNoGenReference.kt rename to src/test/data/jvm/kapt/kotlin/TestKtAPNoGenReference.kt diff --git a/tests/integrationtests/jvm/kapt/kotlin/TestKtService.kt b/src/test/data/jvm/kapt/kotlin/TestKtService.kt similarity index 100% rename from tests/integrationtests/jvm/kapt/kotlin/TestKtService.kt rename to src/test/data/jvm/kapt/kotlin/TestKtService.kt diff --git a/tests/integrationtests/jvm/kapt/kotlin/TestKtValue.kt b/src/test/data/jvm/kapt/kotlin/TestKtValue.kt similarity index 100% rename from tests/integrationtests/jvm/kapt/kotlin/TestKtValue.kt rename to src/test/data/jvm/kapt/kotlin/TestKtValue.kt diff --git a/src/test/kotlin/io/bazel/kotlin/BUILD b/src/test/kotlin/io/bazel/kotlin/BUILD new file mode 100644 index 000000000..d0b969739 --- /dev/null +++ b/src/test/kotlin/io/bazel/kotlin/BUILD @@ -0,0 +1,82 @@ +# Copyright 2018 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +package(default_visibility=["//visibility:private"]) + +load("//kotlin:kotlin.bzl", "kt_jvm_library") +load(":defs.bzl", "kt_rules_e2e_test", "kt_rules_test") + +kt_jvm_library( + name = "assertion_test_case", + testonly = 1, + srcs = ["KotlinAssertionTestCase.kt"], + visibility = ["//visibility:public"], + deps = [ + "@com_github_jetbrains_kotlin//:kotlin-test", + "@io_bazel_rules_kotlin_com_google_guava_guava//jar", + ], + exports = [ + "//third_party/jvm/com/google/truth", + "//third_party/jvm/junit:junit", + "@com_github_jetbrains_kotlin//:kotlin-test", + "@io_bazel_rules_kotlin_com_google_guava_guava//jar", + ] +) + +kt_rules_e2e_test( + name = "KotlinJvmBasicAssertionTest", + srcs = ["KotlinJvmBasicAssertionTest.kt"], + data = [ "//src/test/data/jvm/basic"] +) + +kt_rules_e2e_test( + name = "KotlinNormalizationAssertionTest", + srcs =["KotlinNormalizationAssertionTest.kt"], + data = ["//src/test/data/jvm/basic"], +) + +kt_rules_e2e_test( + name = "KotlinJvmKaptAssertionTest", + srcs = ["KotlinJvmKaptAssertionTest.kt"], + data = ["//src/test/data/jvm/kapt"] +) + +kt_rules_e2e_test( + name = "KotlinJvmDaggerExampleTest", + srcs =["KotlinJvmDaggerExampleTest.kt"], + data = ["//examples/dagger:coffee_app"], +) + +kt_rules_e2e_test( + name = "KotlinJvmFriendsVisibilityTest", + srcs = ["KotlinJvmFriendsVisibilityTest.kt"], + friends = ["//src/test/data/jvm/basic:test_friends_library"] +) + +test_suite( + name = "assertion_tests", + tests = [ + "KotlinJvmBasicAssertionTest", + "KotlinJvmKaptAssertionTest", + "KotlinJvmDaggerExampleTest", + "KotlinJvmFriendsVisibilityTest", + ] +) + +test_suite( + name = "local_assertion_tests", + tests = [ + ":assertion_tests", + ":KotlinNormalizationAssertionTest" + ] +) diff --git a/tests/rules/AssertionTestCase.kt b/src/test/kotlin/io/bazel/kotlin/KotlinAssertionTestCase.kt similarity index 97% rename from tests/rules/AssertionTestCase.kt rename to src/test/kotlin/io/bazel/kotlin/KotlinAssertionTestCase.kt index 3ecc098ae..ecaff2c50 100644 --- a/tests/rules/AssertionTestCase.kt +++ b/src/test/kotlin/io/bazel/kotlin/KotlinAssertionTestCase.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.bazel.kotlin.testing +package io.bazel.kotlin import com.google.common.hash.Hashing import java.io.File @@ -34,7 +34,7 @@ import kotlin.test.fail class TestCaseFailedException(name: String? = null, description: String? = null, cause: Throwable) : AssertionError(""""${name?.let { "jar: $it " } ?: ""} "$description" failed, error: ${cause.message}""", cause) -abstract class AssertionTestCase(root: String) : BasicAssertionTestCase() { +abstract class KotlinAssertionTestCase(root: String) : BasicAssertionTestCase() { private lateinit var currentFile: File private val testRunfileRoot: Path = Paths.get(root).also { diff --git a/tests/integrationtests/jvm/JvmBasicFunctionalTests.kt b/src/test/kotlin/io/bazel/kotlin/KotlinJvmBasicAssertionTest.kt similarity index 81% rename from tests/integrationtests/jvm/JvmBasicFunctionalTests.kt rename to src/test/kotlin/io/bazel/kotlin/KotlinJvmBasicAssertionTest.kt index a92835a7f..0c3ae8d32 100644 --- a/tests/integrationtests/jvm/JvmBasicFunctionalTests.kt +++ b/src/test/kotlin/io/bazel/kotlin/KotlinJvmBasicAssertionTest.kt @@ -13,21 +13,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.bazel.kotlin.testing.jvm +package io.bazel.kotlin -import io.bazel.kotlin.testing.AssertionTestCase import org.junit.Test -class JvmBasicFunctionalTests : AssertionTestCase("tests/integrationtests/jvm/basic") { +class KotlinJvmBasicAssertionTest: KotlinAssertionTestCase("src/test/data/jvm/basic") { @Test fun testResourceMerging() { jarTestCase("test_embed_resources.jar", description = "The rules should support including resource directories") { assertContainsEntries( "testresources/AClass.class", "testresources/BClass.class", - "tests/integrationtests/jvm/basic/testresources/resources/one/alsoAFile.txt", - "tests/integrationtests/jvm/basic/testresources/resources/one/two/aFile.txt" + "src/test/data/jvm/basic/testresources/resources/one/alsoAFile.txt", + "src/test/data/jvm/basic/testresources/resources/one/two/aFile.txt" ) } jarTestCase("test_merge_resourcesjar.jar", description = "the rules should support merging jars") { @@ -56,10 +55,10 @@ class JvmBasicFunctionalTests : AssertionTestCase("tests/integrationtests/jvm/ba @Test fun testModuleNaming() { jarTestCase("test_module_name_bin.jar", description = "A binary rule should support default module naming") { - assertContainsEntries("META-INF/tests_integrationtests_jvm_basic-test_module_name_bin.kotlin_module") + assertContainsEntries("META-INF/src_test_data_jvm_basic-test_module_name_bin.kotlin_module") } jarTestCase("test_module_name_lib.jar", description = "A library rule should support default module naming") { - assertContainsEntries("META-INF/tests_integrationtests_jvm_basic-test_module_name_lib.kotlin_module") + assertContainsEntries("META-INF/src_test_data_jvm_basic-test_module_name_lib.kotlin_module") } jarTestCase("test_module_name_attr_lib.jar", description = "The kotlin rules should support the module_name attribute") { assertContainsEntries("META-INF/hello-module.kotlin_module") diff --git a/tests/integrationtests/jvm/JvmExampleTests.kt b/src/test/kotlin/io/bazel/kotlin/KotlinJvmDaggerExampleTest.kt similarity index 86% rename from tests/integrationtests/jvm/JvmExampleTests.kt rename to src/test/kotlin/io/bazel/kotlin/KotlinJvmDaggerExampleTest.kt index 0f7f7c2a8..f236eae0c 100644 --- a/tests/integrationtests/jvm/JvmExampleTests.kt +++ b/src/test/kotlin/io/bazel/kotlin/KotlinJvmDaggerExampleTest.kt @@ -13,15 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.bazel.kotlin.testing.jvm +package io.bazel.kotlin -import io.bazel.kotlin.testing.BasicAssertionTestCase import org.junit.Test /** * These tests verify properties of the example. */ -class JvmExampleTests : BasicAssertionTestCase() { +class KotlinJvmDaggerExampleTest : BasicAssertionTestCase() { @Test fun daggerExampleIsRunnable() { assertExecutableRunfileSucceeds( diff --git a/src/test/kotlin/io/bazel/kotlin/KotlinJvmFriendsVisibilityTest.kt b/src/test/kotlin/io/bazel/kotlin/KotlinJvmFriendsVisibilityTest.kt new file mode 100644 index 000000000..a172dabb8 --- /dev/null +++ b/src/test/kotlin/io/bazel/kotlin/KotlinJvmFriendsVisibilityTest.kt @@ -0,0 +1,18 @@ +package io.bazel.kotlin + +import test.Service +import test.DEFAULT_FRIEND + +/** + * This test validates that friend visibility is working. Services and DEFAULT_FRIEND are internal another compilation + * unit. + */ +class KotlinJvmFriendsVisibilityTest { + val service: Service = Service() + + @org.junit.Test + fun testCanAccessFriendMembers() { + println(service.value) + println(service.iSayHolla(DEFAULT_FRIEND)) + } +} \ No newline at end of file diff --git a/tests/integrationtests/jvm/KaptTests.kt b/src/test/kotlin/io/bazel/kotlin/KotlinJvmKaptAssertionTest.kt similarity index 96% rename from tests/integrationtests/jvm/KaptTests.kt rename to src/test/kotlin/io/bazel/kotlin/KotlinJvmKaptAssertionTest.kt index 2e817c775..7d5fc5c11 100644 --- a/tests/integrationtests/jvm/KaptTests.kt +++ b/src/test/kotlin/io/bazel/kotlin/KotlinJvmKaptAssertionTest.kt @@ -13,12 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.bazel.kotlin.testing.jvm +package io.bazel.kotlin -import io.bazel.kotlin.testing.AssertionTestCase import org.junit.Test -class KaptTests : AssertionTestCase("tests/integrationtests/jvm/kapt") { +class KotlinJvmKaptAssertionTest : KotlinAssertionTestCase("src/test/data/jvm/kapt") { @Test fun testKotlinOnlyAnnotationProcessing() { jarTestCase("ap_kotlin.jar", description = "annotation processing should work") { diff --git a/tests/integrationtests/jvm/JvmBasicLocalTests.kt b/src/test/kotlin/io/bazel/kotlin/KotlinNormalizationAssertionTest.kt similarity index 78% rename from tests/integrationtests/jvm/JvmBasicLocalTests.kt rename to src/test/kotlin/io/bazel/kotlin/KotlinNormalizationAssertionTest.kt index 384a71dd7..df89bb611 100644 --- a/tests/integrationtests/jvm/JvmBasicLocalTests.kt +++ b/src/test/kotlin/io/bazel/kotlin/KotlinNormalizationAssertionTest.kt @@ -13,13 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.bazel.kotlin.testing.jvm +package io.bazel.kotlin -import io.bazel.kotlin.testing.AssertionTestCase import org.junit.Test -class JvmBasicLocalTests : AssertionTestCase("tests/integrationtests/jvm/basic") { +class KotlinNormalizationAssertionTest : KotlinAssertionTestCase("src/test/data/jvm/basic") { /* * (hsyed) This test is running locally because things hash differently on the ci servers. Don't have the time to * look into it. @@ -32,7 +31,7 @@ class JvmBasicLocalTests : AssertionTestCase("tests/integrationtests/jvm/basic") name = "test_module_name_lib.jar", description = "Builder jars should be normalized with and include stamp data" ) { - validateFileSha256("f26827dd09160adb436b31a12aa3b86f6da8ae1c317150c264ed8d1427a68dea") + validateFileSha256("1d26035bda6f384b9cc6bbe5a5bf0727b4da0aeec59545c421de32775149d4cf") assertManifestStamped() assertEntryCompressedAndNormalizedTimestampYear("helloworld/Main.class") } @@ -40,11 +39,11 @@ class JvmBasicLocalTests : AssertionTestCase("tests/integrationtests/jvm/basic") name = "test_embed_resources.jar", description = "Merging resources into the main output jar should still result in a normalized jar" ) { - validateFileSha256("270ea8758f38d9ef15013aea222cc8f609affaf9acc2f2cd206dbd73a4872082") + validateFileSha256("ff35e9779be25c5803ab74cd5cee46bfd35da9412fe78395d1ebc2fb2e20880a") assertManifestStamped() assertEntryCompressedAndNormalizedTimestampYear("testresources/AClass.class") assertEntryCompressedAndNormalizedTimestampYear( - "tests/integrationtests/jvm/basic/testresources/resources/one/two/aFile.txt" + "src/test/data/jvm/basic/testresources/resources/one/two/aFile.txt" ) } } diff --git a/src/test/kotlin/io/bazel/kotlin/builder/BUILD b/src/test/kotlin/io/bazel/kotlin/builder/BUILD new file mode 100644 index 000000000..599ac4a76 --- /dev/null +++ b/src/test/kotlin/io/bazel/kotlin/builder/BUILD @@ -0,0 +1,49 @@ +# Copyright 2018 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +package(default_visibility=["//visibility:private"]) +load("//src/test/kotlin/io/bazel/kotlin:defs.bzl", "kt_rules_test") + +java_library( + name = "test_lib", + testonly = 1, + srcs = [":KotlinBuilderTestCase.java"], + exports = ["//src/main/kotlin:builder_lib_for_tests"], + deps = ["//src/main/kotlin:builder_lib_for_tests"], +) + +kt_rules_test( + name = "SourceJarCreatorTest", + srcs = ["utils/jars/SourceJarCreatorTest.java"], +) + +kt_rules_test( + name = "JdepsParserTest", + srcs = ["tasks/jvm/JdepsParserTest.java"], +) + +kt_rules_test( + name = "KotlinBuilderJvmTest", + srcs = ["tasks/jvm/KotlinBuilderJvmTest.java"], +) + +test_suite( + name = "builder_tests", + tests = [ + ":SourceJarCreatorTest", + ":JdepsParserTest", + ":KotlinBuilderJvmTest" + ], + visibility = ["//visibility:public"] +) + diff --git a/kotlin/builder/integrationtests/KotlinBuilderTestCase.java b/src/test/kotlin/io/bazel/kotlin/builder/KotlinBuilderTestCase.java similarity index 95% rename from kotlin/builder/integrationtests/KotlinBuilderTestCase.java rename to src/test/kotlin/io/bazel/kotlin/builder/KotlinBuilderTestCase.java index c5759b5d1..3a3b7de2e 100644 --- a/kotlin/builder/integrationtests/KotlinBuilderTestCase.java +++ b/src/test/kotlin/io/bazel/kotlin/builder/KotlinBuilderTestCase.java @@ -22,7 +22,7 @@ import static com.google.common.base.Charsets.UTF_8; import static com.google.common.truth.Truth.assertWithMessage; -abstract class KotlinBuilderTestCase { +public abstract class KotlinBuilderTestCase { private static final Path BAZEL_TEST_DIR = Paths.get(Preconditions.checkNotNull(System.getenv("TEST_TMPDIR"))); private static final AtomicInteger counter = new AtomicInteger(0); @@ -144,7 +144,7 @@ protected enum DirectoryType { TEMP, SOURCE_GEN; - protected static Path select(DirectoryType type, JvmCompilationTask command) { + public static Path select(DirectoryType type, JvmCompilationTask command) { Path ret; switch (type) { case CLASSES: @@ -166,7 +166,7 @@ protected static Path select(DirectoryType type, JvmCompilationTask command) { } } - void assertFileExists(DirectoryType dir, String filePath) { + protected void assertFileExists(DirectoryType dir, String filePath) { Path file = DirectoryType.select(dir, builderCommand()).resolve(filePath); assertFileExists(file.toString()); } @@ -175,7 +175,7 @@ void assertFileDoesNotExist(String filePath) { assertWithMessage("file exisst: " + filePath).that(new File(filePath).exists()).isFalse(); } - void assertFileExists(String filePath) { + protected void assertFileExists(String filePath) { assertWithMessage("file did not exist: " + filePath).that(new File(filePath).exists()).isTrue(); } } diff --git a/kotlin/builder/unittests/io/bazel/kotlin/workers/tasks/jvm/JdepsParserTest.java b/src/test/kotlin/io/bazel/kotlin/builder/tasks/jvm/JdepsParserTest.java similarity index 100% rename from kotlin/builder/unittests/io/bazel/kotlin/workers/tasks/jvm/JdepsParserTest.java rename to src/test/kotlin/io/bazel/kotlin/builder/tasks/jvm/JdepsParserTest.java diff --git a/kotlin/builder/integrationtests/KotlinBuilderTests.java b/src/test/kotlin/io/bazel/kotlin/builder/tasks/jvm/KotlinBuilderJvmTest.java similarity index 93% rename from kotlin/builder/integrationtests/KotlinBuilderTests.java rename to src/test/kotlin/io/bazel/kotlin/builder/tasks/jvm/KotlinBuilderJvmTest.java index df4ebea8b..e1e43733c 100644 --- a/kotlin/builder/integrationtests/KotlinBuilderTests.java +++ b/src/test/kotlin/io/bazel/kotlin/builder/tasks/jvm/KotlinBuilderJvmTest.java @@ -1,7 +1,8 @@ -package io.bazel.kotlin.builder; +package io.bazel.kotlin.builder.tasks.jvm; import com.google.common.truth.Truth; import com.google.devtools.build.lib.view.proto.Deps; +import io.bazel.kotlin.builder.KotlinBuilderTestCase; import io.bazel.kotlin.builder.utils.CompilationTaskContext; import io.bazel.kotlin.model.JvmCompilationTask; import org.junit.Test; @@ -15,7 +16,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -public class KotlinBuilderTests extends KotlinBuilderTestCase { +public class KotlinBuilderJvmTest extends KotlinBuilderTestCase { @Test public void testSimpleCompile() { addSource("AClass.kt", "package something;" + "class AClass{}"); diff --git a/kotlin/builder/unittests/io/bazel/kotlin/workers/utils/jars/SourceJarCreatorUnitTests.java b/src/test/kotlin/io/bazel/kotlin/builder/utils/jars/SourceJarCreatorTest.java similarity index 97% rename from kotlin/builder/unittests/io/bazel/kotlin/workers/utils/jars/SourceJarCreatorUnitTests.java rename to src/test/kotlin/io/bazel/kotlin/builder/utils/jars/SourceJarCreatorTest.java index c0ffa765e..4f1093ee7 100644 --- a/kotlin/builder/unittests/io/bazel/kotlin/workers/utils/jars/SourceJarCreatorUnitTests.java +++ b/src/test/kotlin/io/bazel/kotlin/builder/utils/jars/SourceJarCreatorTest.java @@ -23,7 +23,7 @@ import static com.google.common.truth.Truth.assertWithMessage; -public class SourceJarCreatorUnitTests { +public class SourceJarCreatorTest { private final String expectedPackage = "iO.some1.package"; private final List cases = diff --git a/src/test/kotlin/io/bazel/kotlin/defs.bzl b/src/test/kotlin/io/bazel/kotlin/defs.bzl new file mode 100644 index 000000000..3272c8eee --- /dev/null +++ b/src/test/kotlin/io/bazel/kotlin/defs.bzl @@ -0,0 +1,39 @@ +# Copyright 2018 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +load("//kotlin:kotlin.bzl", "kt_jvm_test") + +def _get_class_name(kwargs): + if len(kwargs.get("srcs", [])) == 1: + return ( + native.package_name().replace("src/test/kotlin/", "") + + "." + kwargs["srcs"][0] + ).replace("/", ".").replace(".java", "").replace(".kt", "") + else: + return kwargs["test_classes"] + +def kt_rules_test(name, **kwargs): + kwargs.setdefault("size", "small") + kwargs["deps"] = kwargs.setdefault("deps", []) + ["//src/test/kotlin/io/bazel/kotlin/builder:test_lib"] + kwargs.setdefault("test_class", _get_class_name(kwargs)) + for f in kwargs.get("srcs"): + if f.endswith(".kt"): + kt_jvm_test(name = name, **kwargs) + return + native.java_test(name = name, **kwargs) + +def kt_rules_e2e_test(name, **kwargs): + kwargs.setdefault("size", "small") + kwargs["deps"] = kwargs.setdefault("deps", []) + ["//src/test/kotlin/io/bazel/kotlin:assertion_test_case"] + kwargs.setdefault("test_class", _get_class_name(kwargs)) + kt_jvm_test(name = name, **kwargs) \ No newline at end of file diff --git a/tests/integrationtests/BUILD b/tests/integrationtests/BUILD deleted file mode 100644 index 6f22d631d..000000000 --- a/tests/integrationtests/BUILD +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2018 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -package(default_visibility = ["//tests/integrationtests:__subpackages__"]) - -test_suite( - name = "integrationtests", - tests = [ - "//tests/integrationtests/jvm", - ], -) - -test_suite( - name = "integrationtests_local", - tests = [ - "//tests/integrationtests/jvm:jvm_local", - ], -) diff --git a/tests/integrationtests/jvm/BUILD b/tests/integrationtests/jvm/BUILD deleted file mode 100644 index 27ad6f468..000000000 --- a/tests/integrationtests/jvm/BUILD +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright 2018 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -package(default_visibility = ["//visibility:private"]) - -# The tests are written in Kotlin, so the tests inately test a lot of the rule functionality. -load("//tests/rules:defs.bzl", "kt_it_assertion_test") - -kt_it_assertion_test( - name = "basic_tests", - cases = "//tests/integrationtests/jvm/basic:cases", - test_class = "io.bazel.kotlin.testing.jvm.JvmBasicFunctionalTests", -) - -kt_it_assertion_test( - name = "basic_local_tests", - cases = "//tests/integrationtests/jvm/basic:cases", - test_class = "io.bazel.kotlin.testing.jvm.JvmBasicLocalTests", -) - -kt_it_assertion_test( - name = "kapt_tests", - cases = "//tests/integrationtests/jvm/kapt:cases", - test_class = "io.bazel.kotlin.testing.jvm.KaptTests", -) - -kt_it_assertion_test( - name = "example_tests", - data = ["//examples/dagger:coffee_app"], - test_class = "io.bazel.kotlin.testing.jvm.JvmExampleTests", -) - -test_suite( - name = "jvm", - tests = [ - ":basic_tests", - ":example_tests", - ":kapt_tests", - "//tests/integrationtests/jvm/basic:friends_tests", - ], -) - -test_suite( - name = "jvm_local", - tests = [ - ":basic_local_tests", - ], -) diff --git a/tests/integrationtests/jvm/basic/test_friends/TestFriendsTest.kt b/tests/integrationtests/jvm/basic/test_friends/TestFriendsTest.kt deleted file mode 100644 index ad25e2cf6..000000000 --- a/tests/integrationtests/jvm/basic/test_friends/TestFriendsTest.kt +++ /dev/null @@ -1,13 +0,0 @@ -package test - -import org.junit.Test - -class TestFriendsTest { - val service: Service = Service() - - @Test - fun testCanAccessFriendMembers() { - println(service.value) - println(service.iSayHolla(DEFAULT_FRIEND)) - } -} \ No newline at end of file diff --git a/tests/rules/BUILD b/tests/rules/BUILD deleted file mode 100644 index 780a73f4c..000000000 --- a/tests/rules/BUILD +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright 2018 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -package(default_visibility = ["//tests:__subpackages__"]) - -load("//kotlin:kotlin.bzl", "kt_jvm_library") - -kt_jvm_library( - name = "assertion_test_case", - testonly = 1, - srcs = ["AssertionTestCase.kt"], - visibility = ["//tests:__subpackages__"], - deps = [ - "@com_github_jetbrains_kotlin//:kotlin-test", - "@io_bazel_rules_kotlin_com_google_guava_guava//jar", - ], -) diff --git a/tests/rules/defs.bzl b/tests/rules/defs.bzl deleted file mode 100644 index d72e4f533..000000000 --- a/tests/rules/defs.bzl +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2018 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -load("//kotlin:kotlin.bzl", "kt_jvm_test") - -TEST_COMMON_DEPS = [ - "//tests/rules:assertion_test_case", - "//third_party/jvm/com/google/truth", - "//third_party/jvm/junit:junit", -] - -def kt_it_assertion_test(name, test_class, cases = None, data = [], deps = []): - parts = test_class.split(".") - if cases: - data = data + [cases] - kt_jvm_test( - name = name, - srcs = ["%s.kt" % parts[len(parts) - 1]], - deps = TEST_COMMON_DEPS + deps, - test_class = test_class, - data = data, - visibility = ["//visibility:private"], - )