Skip to content

Commit

Permalink
Stop depending on @com_github_jetbrains_kotlin//... targets (#173)
Browse files Browse the repository at this point in the history
Fixes #173
  • Loading branch information
arunkumar9t2 committed May 8, 2024
1 parent 92cb296 commit b3ced63
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ kotlin_test(
deps = [
":binding-adapter-bridge",
":binding-adapter-processor",
"@com_github_jetbrains_kotlin//:kotlin-test",
"@maven//:org_jetbrains_kotlin_kotlin_test",
"@maven//:com_github_tschuchortdev_kotlin_compile_testing",
"@maven//:junit_junit",
],
Expand Down
2 changes: 1 addition & 1 deletion rules/android/test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def android_unit_test(
test_runtime_deps = [
":" + runtime_resources_name,
"@grab_bazel_common//rules/android:mock_android_jar",
"@com_github_jetbrains_kotlin//:kotlin-reflect",
"@maven//:org_jetbrains_kotlin_kotlin_reflect",
],
resources = resources,
**kwargs
Expand Down
2 changes: 1 addition & 1 deletion rules/kotlin/test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def kotlin_test(
deps = deps,
test_compile_deps = [],
test_runtime_deps = [
"@com_github_jetbrains_kotlin//:kotlin-reflect",
"@maven//:org_jetbrains_kotlin_kotlin_reflect",
],
**kwargs
)
4 changes: 2 additions & 2 deletions rules/test/multi_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def grab_android_local_test(
],
test_runtime_deps = [
"@grab_bazel_common//tools/test:mockable-android-jar",
"@com_github_jetbrains_kotlin//:kotlin-reflect",
"@maven//:org_jetbrains_kotlin_kotlin_reflect",
],
**kwargs
)
Expand Down Expand Up @@ -84,7 +84,7 @@ def grab_kt_jvm_test(
deps = deps,
test_compile_deps = [],
test_runtime_deps = [
"@com_github_jetbrains_kotlin//:kotlin-reflect",
"@maven//:org_jetbrains_kotlin_kotlin_reflect",
],
**kwargs
)
Expand Down
2 changes: 1 addition & 1 deletion tools/aapt_lite/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ kotlin_test(
"//tools/aapt_lite/src/main/java/com/grab/aapt",
"//tools/test_utils",
"@bazel_common_maven//:junit_junit",
"@com_github_jetbrains_kotlin//:kotlin-test",
"@maven//:org_jetbrains_kotlin_kotlin_test",
],
)

Expand Down
2 changes: 1 addition & 1 deletion tools/binding-adapter-bridge/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ kotlin_test(
":binding-adapter-processor",
"@bazel_common_maven//:com_github_tschuchortdev_kotlin_compile_testing",
"@bazel_common_maven//:junit_junit",
"@com_github_jetbrains_kotlin//:kotlin-test",
"@maven//:org_jetbrains_kotlin_kotlin_test",
],
)
4 changes: 2 additions & 2 deletions tools/build_config/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ kotlin_test(
],
deps = [
":build-config-sample",
"@com_github_jetbrains_kotlin//:kotlin-test",
"@maven//:junit_junit",
"@maven//:org_jetbrains_kotlin_kotlin_test",
],
)

Expand All @@ -75,7 +75,7 @@ kotlin_test(
],
deps = [
":build-config-replace-default",
"@com_github_jetbrains_kotlin//:kotlin-test",
"@maven//:junit_junit",
"@maven//:org_jetbrains_kotlin_kotlin_test",
],
)
2 changes: 1 addition & 1 deletion tools/lint/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ kotlin_test(
"//tools/lint/src/main/java/com/grab/lint",
"//tools/test_utils",
"@bazel_common_maven//:junit_junit",
"@com_github_jetbrains_kotlin//:kotlin-test",
"@maven//:org_jetbrains_kotlin_kotlin_test",
],
)

Expand Down
2 changes: 1 addition & 1 deletion tools/test_suite_generator/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ kotlin_test(
deps = [
":test_suite_generator",
"@bazel_common_maven//:junit_junit",
"@com_github_jetbrains_kotlin//:kotlin-test",
"@maven//:org_jetbrains_kotlin_kotlin_test",
],
)
21 changes: 13 additions & 8 deletions tools/test_suite_generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,25 @@ For example, you have a bunch of test classes
```kotlin
class DummyTestClassA {
@Test
fun testFeatureA() {}
fun testFeatureA() {
}
}

class DummyTestClassB {
@Test
fun testFeatureB() {}
fun testFeatureB() {
}
}
```

The generated TestSuite class will look like

```java

@RunWith(Suite.class)
@Suite.SuiteClasses({
DummyTestClassA.class,
DummyTestClassB.class
DummyTestClassA.class,
DummyTestClassB.class
})
public class TestSuite {
}
Expand All @@ -40,13 +43,15 @@ You simply add the annotation processor as a dependency for your target. Below i
```kotlin
kt_jvm_test(
name = "your-test-target",
srcs = glob([
"..."
]),
srcs = glob(
[
"..."
]
),
test_class = "com.grazel.generated.TestSuite", // Be aware that the package name is hardcoded
deps = [
"@grab_bazel_common//tools/test-info-processor:test-suite-generator",
"@com_github_jetbrains_kotlin//:kotlin-test",
"@maven//:org_jetbrains_kotlin_kotlin_test",
"@maven//:junit_junit",
],
)
Expand Down
2 changes: 1 addition & 1 deletion tools/test_utils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ kotlin_library(
],
deps = [
"@bazel_common_maven//:junit_junit",
"@com_github_jetbrains_kotlin//:kotlin-test",
"@maven//:org_jetbrains_kotlin_kotlin_test",
],
)
2 changes: 1 addition & 1 deletion tools/worker/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ kotlin_test(
deps = [
":worker_lib",
"@bazel_common_maven//:junit_junit",
"@com_github_jetbrains_kotlin//:kotlin-test",
"@maven//:org_jetbrains_kotlin_kotlin_test",
],
)
2 changes: 2 additions & 0 deletions workspace_defs.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
GRAB_BAZEL_COMMON_ARTIFACTS = [
"org.jetbrains.kotlin:kotlin-parcelize-compiler:1.8.10",
"org.jetbrains.kotlin:kotlin-parcelize-runtime:1.8.10",
"org.jetbrains.kotlin:kotlin-reflect:1.8.10",
"org.jetbrains.kotlin:kotlin-test:1.8.10",
"androidx.compose.compiler:compiler:1.4.3",
"androidx.annotation:annotation:1.5.0",
"androidx.databinding:databinding-adapters:7.2.2",
Expand Down

0 comments on commit b3ced63

Please sign in to comment.