Skip to content

Commit 858c0e7

Browse files
authored
Add anvil example to CI, and fix release artifact so jarjar works for un-shaded compiler uses in plugins. (#416)
- Add the anvil example to the CI. - Explicitly declare the test class for anvil's test, since src/test/java isn't inferred for kotlin tests. - Add in the dependencies of jarjar, so compiler de-shading works in the release package. - Temporarily disable `--override_repository` until #417 is figured out.
1 parent 2c28382 commit 858c0e7

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

.bazelci/presubmit.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ tasks:
3737
- "--override_repository=io_bazel_rules_kotlin=/tmp/rules_kotlin_release"
3838
test_targets:
3939
- //...
40+
example-anvil:
41+
name: "Example - Anvil"
42+
platform: ubuntu1804
43+
shell_commands:
44+
- "cd ../.. && bazel build //:rules_kotlin_release && rm -rf /tmp/rules_kotlin_release && mkdir -p /tmp/rules_kotlin_release && tar -C /tmp/rules_kotlin_release -xvf bazel-bin/rules_kotlin_release.tgz"
45+
working_directory: examples/anvil
46+
#test_flags:
47+
# - "--override_repository=io_bazel_rules_kotlin=/tmp/rules_kotlin_release"
48+
test_targets:
49+
- //...
4050
examples-trivial:
4151
name: "Example - Trivial"
4252
platform: ubuntu1804

examples/anvil/app/src/test/java/com/squareup/anvil/sample/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_jvm_library", "kt_jvm_test
33
kt_jvm_test(
44
name = "LoggedInComponentTest",
55
srcs = ["LoggedInComponentTest.kt"],
6+
test_class = "com.squareup.anvil.sample.LoggedInComponentTest",
67
deps = [
78
"//app/src/main/java/com/squareup/anvil/sample",
89
"@maven//:com_google_truth_truth",

third_party/BUILD

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ release_archive(
8787
"empty.jdeps",
8888
"jarjar.bzl",
8989
"@kotlin_rules_maven//:org_pantsbuild_jarjar",
90+
"@kotlin_rules_maven//:org_ow2_asm_asm_tree",
91+
"@kotlin_rules_maven//:org_ow2_asm_asm",
92+
"@kotlin_rules_maven//:org_ow2_asm_asm_commons",
93+
"@kotlin_rules_maven//:org_ow2_asm_asm_analysis",
9094
],
9195
src_map = {
9296
"BUILD.release.bazel": "BUILD.bazel",

third_party/BUILD.release.bazel

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,21 @@ java_binary(
2121
name = "jarjar_runner",
2222
main_class = "org.pantsbuild.jarjar.Main",
2323
visibility = ["//visibility:public"],
24-
runtime_deps = [":jarjar-1.7.2.jar"],
24+
runtime_deps = [
25+
":jarjar",
26+
":asm",
27+
":asm-analysis",
28+
":asm-commons",
29+
":asm-tree",
30+
],
2531
)
2632

33+
java_import(name = "jarjar", jars = ["jarjar-1.7.2.jar"])
34+
java_import(name = "asm", jars = ["asm-7.0.jar"])
35+
java_import(name = "asm-analysis", jars = ["asm-analysis-7.0.jar"])
36+
java_import(name = "asm-commons", jars = ["asm-commons-7.0.jar"])
37+
java_import(name = "asm-tree", jars = ["asm-tree-7.0.jar"])
38+
2739
java_import(
2840
name = "android_sdk",
2941
jars = ["@bazel_tools//tools/android:android_jar"],

0 commit comments

Comments
 (0)