From af13458a32fb19712f369c12482486c6e965fc9f Mon Sep 17 00:00:00 2001 From: xingyutangyuan <147447743+xingyutangyuan@users.noreply.github.com> Date: Fri, 24 Nov 2023 18:44:40 -0800 Subject: [PATCH 1/2] Integrate with bazel --- WORKSPACE | 64 +++++++++++++++++++ mug-errorprone/BUILD | 42 ++++++++++++ .../StringUnformatArgsCheckTest.java | 11 ++-- mug-guava/BUILD | 33 ++++++++++ mug-protobuf/BUILD | 39 +++++++++++ mug/BUILD | 44 +++++++++++++ 6 files changed, 227 insertions(+), 6 deletions(-) create mode 100644 WORKSPACE create mode 100644 mug-errorprone/BUILD create mode 100644 mug-guava/BUILD create mode 100644 mug-protobuf/BUILD create mode 100644 mug/BUILD diff --git a/WORKSPACE b/WORKSPACE new file mode 100644 index 0000000000..9a56913b6e --- /dev/null +++ b/WORKSPACE @@ -0,0 +1,64 @@ + +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +RULES_JVM_EXTERNAL_TAG = "4.3" +RULES_JVM_EXTERNAL_SHA = "6274687f6fc5783b589f56a2f1ed60de3ce1f99bc4e8f9edef3de43bdf7c6e74" + +load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") + +# Re-usable building blocks for Bazel build tool +# https://gerrit.googlesource.com/bazlets/ +# https://gerrit.googlesource.com/bazlets/+/968b97fa03a9d2afd760f2e8ede3d5643da390d2 +git_repository( + name = "com_googlesource_gerrit_bazlets", + remote = "https://gerrit.googlesource.com/bazlets", + commit = "968b97fa03a9d2afd760f2e8ede3d5643da390d2", +) +# We cannot use the tar.gz provided over HTTP because it contains timestamps and each download has a +# different hash. +#http_archive( +# name = "com_googlesource_gerrit_bazlets", +# sha256 = "...", +# urls = [ +# "https://gerrit.googlesource.com/bazlets/+archive/968b97fa03a9d2afd760f2e8ede3d5643da390d2.tar.gz", +# ], +#) +# This provides these useful imports: +# load("@com_googlesource_gerrit_bazlets//tools:maven_jar.bzl", "maven_jar") +# load("@com_googlesource_gerrit_bazlets//tools:junit.bzl", "junit_tests") + + +http_archive( + name = "rules_jvm_external", + sha256 = RULES_JVM_EXTERNAL_SHA, + strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG, + url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG, +) + +load("@rules_jvm_external//:defs.bzl", "maven_install") + +maven_install( + artifacts = [ + "com.google.errorprone:error_prone_annotation:[2.0,)", + "com.google.errorprone:error_prone_core:[2.0,)", + "com.google.errorprone:error_prone_annotations:[2.0,)", + "com.google.errorprone:error_prone_check_api:[2.0,)", + "com.google.errorprone:error_prone_test_helpers:[2.0,)", + "com.google.guava:guava:[20.0,)", + "com.google.guava:guava-testlib:[30.0,)", + "org.mockito:mockito-core:2.27.0", + "com.google.testparameterinjector:test-parameter-injector:[1.8,)", + "junit:junit:4.13.1", + "org.junit.jupiter:junit-jupiter-api:5.0.0-M3", + "com.google.truth:truth:[1.1,)", + "com.google.truth.extensions:truth-java8-extension:[1.1,)", + "org.checkerframework:checker-qual:3.12.0", + "com.google.auto.service:auto-service-annotations:1.1.1", + "com.google.protobuf:protobuf-java:[3.0.0,)", + "com.google.protobuf:protobuf-java-util:[3.0.0,)", + "com.google.code.findbugs:jsr305:3.0.2", + ], + repositories = [ + "https://repo1.maven.org/maven2", + ], +) \ No newline at end of file diff --git a/mug-errorprone/BUILD b/mug-errorprone/BUILD new file mode 100644 index 0000000000..60bf4b5cd5 --- /dev/null +++ b/mug-errorprone/BUILD @@ -0,0 +1,42 @@ +java_plugin( + name = "mug-errorprone", + deps = [":errorprone"], +) + +java_library( + name = "errorprone", + srcs = glob(["src/main/java/**/*.java"]), + deps = [ + "@maven//:com_google_guava_guava", + "@maven//:com_google_errorprone_error_prone_core", + "@maven//:com_google_errorprone_error_prone_annotation", + "@maven//:com_google_errorprone_error_prone_annotations", + "@maven//:com_google_errorprone_error_prone_check_api", + "@maven//:com_google_auto_service_auto_service_annotations", + "//mug", + "//mug-guava", + ], +) + + +load("@com_googlesource_gerrit_bazlets//tools:junit.bzl", "junit_tests") + + +junit_tests( + name = "AllTests", + srcs = glob(["src/test/java/**/*Test.java"]), + deps = [ + ":errorprone", + "//mug", + "@maven//:com_google_guava_guava", + "@maven//:com_google_guava_guava_testlib", + "@maven//:com_google_truth_truth", + "@maven//:org_mockito_mockito_core", + "@maven//:com_google_testparameterinjector_test_parameter_injector", + "@maven//:org_junit_jupiter_junit_jupiter_api", + "@maven//:com_google_truth_extensions_truth_java8_extension", + "@maven//:com_google_errorprone_error_prone_annotations", + "@maven//:com_google_errorprone_error_prone_test_helpers", + "@maven//:junit_junit", + ], +) diff --git a/mug-errorprone/src/test/java/com/google/mu/errorprone/StringUnformatArgsCheckTest.java b/mug-errorprone/src/test/java/com/google/mu/errorprone/StringUnformatArgsCheckTest.java index 9905a389c3..6a9f6f886d 100644 --- a/mug-errorprone/src/test/java/com/google/mu/errorprone/StringUnformatArgsCheckTest.java +++ b/mug-errorprone/src/test/java/com/google/mu/errorprone/StringUnformatArgsCheckTest.java @@ -1,6 +1,8 @@ package com.google.mu.errorprone; import com.google.errorprone.CompilationTestHelper; + +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -10,11 +12,6 @@ public class StringUnformatArgsCheckTest { private final CompilationTestHelper helper = CompilationTestHelper.newInstance(StringUnformatArgsCheck.class, getClass()); - @Test public void parseWithFewerLambdaArgs() { - //helper.addSourceFile("ParseWithFewerLambdaArgs.java").doTest(); - } - - /* @Test public void goodParseWithLambda() { helper @@ -613,6 +610,7 @@ public void scanMethodChecked() { .doTest(); } + @Ignore("scanAndCollectFrom() doesn't exist?") @Test public void scanAndCollectFromMethodChecked_withCollector() { helper @@ -629,6 +627,7 @@ public void scanAndCollectFromMethodChecked_withCollector() { .doTest(); } + @Ignore("scanAndCollectFrom() doesn't exist?") @Test public void scanAndCollectFromMethodChecked_withBiCollector() { helper @@ -803,5 +802,5 @@ public void scanMethod_cannotProvideLambdaArgForEllipsisPlaceholder() { " }", "}") .doTest(); - }*/ + } } diff --git a/mug-guava/BUILD b/mug-guava/BUILD new file mode 100644 index 0000000000..e37955e488 --- /dev/null +++ b/mug-guava/BUILD @@ -0,0 +1,33 @@ +java_library( + name = "mug-guava", + srcs = glob(["src/main/java/**/*.java"]), + visibility = ["//visibility:public"], + deps = [ + "@@maven//:com_google_guava_guava", + "@maven//:org_checkerframework_checker_qual", + "@maven//:com_google_errorprone_error_prone_annotations", + "//mug", + ], +) + + +load("@com_googlesource_gerrit_bazlets//tools:junit.bzl", "junit_tests") + + +junit_tests( + name = "AllTests", + srcs = glob(["src/test/java/**/*Test.java"]), + deps = [ + ":mug-guava", + "//mug", + "@maven//:com_google_guava_guava", + "@maven//:com_google_guava_guava_testlib", + "@maven//:com_google_truth_truth", + "@maven//:org_mockito_mockito_core", + "@maven//:com_google_testparameterinjector_test_parameter_injector", + "@maven//:org_junit_jupiter_junit_jupiter_api", + "@maven//:com_google_truth_extensions_truth_java8_extension", + "@maven//:com_google_errorprone_error_prone_annotations", + "@maven//:junit_junit", + ], +) diff --git a/mug-protobuf/BUILD b/mug-protobuf/BUILD new file mode 100644 index 0000000000..e0916ef92e --- /dev/null +++ b/mug-protobuf/BUILD @@ -0,0 +1,39 @@ +java_library( + name = "mug-protobuf", + srcs = glob(["src/main/java/**/*.java"]), + visibility = ["//visibility:public"], + deps = [ + "@maven//:com_google_guava_guava", + "@maven//:com_google_code_findbugs_jsr305", + "@maven//:com_google_errorprone_error_prone_annotations", + "@maven//:com_google_protobuf_protobuf_java", + "@maven//:com_google_protobuf_protobuf_java_util", + "//mug", + ], +) + + + +load("@com_googlesource_gerrit_bazlets//tools:junit.bzl", "junit_tests") + + +junit_tests( + name = "AllTests", + srcs = glob(["src/test/java/**/*Test.java"]), + deps = [ + ":mug-protobuf", + "//mug", + "//mug-guava", + "@maven//:com_google_guava_guava", + "@maven//:com_google_guava_guava_testlib", + "@maven//:com_google_protobuf_protobuf_java", + "@maven//:com_google_protobuf_protobuf_java_util", + "@@maven//:com_google_truth_truth", + "@@maven//:org_mockito_mockito_core", + "@maven//:com_google_testparameterinjector_test_parameter_injector", + "@maven//:org_junit_jupiter_junit_jupiter_api", + "@maven//:com_google_truth_extensions_truth_java8_extension", + "@maven//:com_google_errorprone_error_prone_annotations", + "@maven//:junit_junit", + ], +) diff --git a/mug/BUILD b/mug/BUILD new file mode 100644 index 0000000000..2cd978a954 --- /dev/null +++ b/mug/BUILD @@ -0,0 +1,44 @@ +java_library( + name = "mug", + visibility = ["//visibility:public"], + srcs = glob(["src/main/java/**/*.java"]), + resources = glob(["src/main/resources/**"]), +) + +load("@com_googlesource_gerrit_bazlets//tools:junit.bzl", "junit_tests") + +java_library( + name = "tests", + srcs = glob(["src/test/java/**/*.java"], exclude = glob(["src/test/java/**/*Test.java"])), + deps = [ + ":mug", + "@maven//:com_google_guava_guava", + "@maven//:com_google_guava_guava_testlib", + "@maven//:com_google_truth_truth", + "@maven//:org_mockito_mockito_core", + "@maven//:com_google_testparameterinjector_test_parameter_injector", + "@maven//:org_junit_jupiter_junit_jupiter_api", + "@maven//:com_google_truth_extensions_truth_java8_extension", + "@maven//:com_google_errorprone_error_prone_annotations", + "@maven//:junit_junit", + ], +) + + +junit_tests( + name = "AllTests", + srcs = glob(["src/test/java/**/*Test.java"]), + deps = [ + ":mug", + ":tests", + "@maven//:com_google_guava_guava", + "@maven//:com_google_guava_guava_testlib", + "@maven//:com_google_truth_truth", + "@maven//:org_mockito_mockito_core", + "@maven//:com_google_testparameterinjector_test_parameter_injector", + "@maven//:org_junit_jupiter_junit_jupiter_api", + "@maven//:com_google_truth_extensions_truth_java8_extension", + "@maven//:com_google_errorprone_error_prone_annotations", + "@maven//:junit_junit", + ], +) From 6eb8f07b5511e81dd0378e2d02016f08078ee6ef Mon Sep 17 00:00:00 2001 From: xingyutangyuan <147447743+xingyutangyuan@users.noreply.github.com> Date: Fri, 24 Nov 2023 20:31:57 -0800 Subject: [PATCH 2/2] Enable ErrorProne tests under bazel --- WORKSPACE | 1 + mug-errorprone/BUILD | 21 ++++++---- .../StringUnformatArgsCheckTest.java | 2 +- mug-examples/BUILD | 17 ++++++++ .../HowToCollectToCustomTypesTest.java | 2 +- .../examples/HowToConcatenateMapsTest.java | 2 +- ...wToCreateTypeSafeCartesianProductTest.java | 2 +- .../examples/HowToDoGroupingFluentlyTest.java | 2 +- .../mu/examples/HowToUseStringFormatTest.java | 18 +++++++++ .../HowToZipPairwiseElementsTest.java | 2 +- mug-guava/BUILD | 4 +- mug-protobuf/BUILD | 6 +-- mug/BUILD | 40 ++++++++++++++++--- 13 files changed, 94 insertions(+), 25 deletions(-) create mode 100644 mug-examples/BUILD rename mug-examples/src/test/java/{ => com/google/mu}/examples/HowToCollectToCustomTypesTest.java (98%) rename mug-examples/src/test/java/{ => com/google/mu}/examples/HowToConcatenateMapsTest.java (98%) rename mug-examples/src/test/java/{ => com/google/mu}/examples/HowToCreateTypeSafeCartesianProductTest.java (98%) rename mug-examples/src/test/java/{ => com/google/mu}/examples/HowToDoGroupingFluentlyTest.java (98%) create mode 100644 mug-examples/src/test/java/com/google/mu/examples/HowToUseStringFormatTest.java rename mug-examples/src/test/java/{ => com/google/mu}/examples/HowToZipPairwiseElementsTest.java (97%) diff --git a/WORKSPACE b/WORKSPACE index 9a56913b6e..0784a1d6b3 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -54,6 +54,7 @@ maven_install( "com.google.truth.extensions:truth-java8-extension:[1.1,)", "org.checkerframework:checker-qual:3.12.0", "com.google.auto.service:auto-service-annotations:1.1.1", + "com.google.auto.service:auto-service:1.1.1", "com.google.protobuf:protobuf-java:[3.0.0,)", "com.google.protobuf:protobuf-java-util:[3.0.0,)", "com.google.code.findbugs:jsr305:3.0.2", diff --git a/mug-errorprone/BUILD b/mug-errorprone/BUILD index 60bf4b5cd5..264468f780 100644 --- a/mug-errorprone/BUILD +++ b/mug-errorprone/BUILD @@ -1,11 +1,7 @@ -java_plugin( - name = "mug-errorprone", - deps = [":errorprone"], -) - java_library( name = "errorprone", srcs = glob(["src/main/java/**/*.java"]), + visibility = ["//visibility:public"], deps = [ "@maven//:com_google_guava_guava", "@maven//:com_google_errorprone_error_prone_core", @@ -13,21 +9,30 @@ java_library( "@maven//:com_google_errorprone_error_prone_annotations", "@maven//:com_google_errorprone_error_prone_check_api", "@maven//:com_google_auto_service_auto_service_annotations", - "//mug", + "//mug:base", "//mug-guava", ], ) +java_plugin( + name = "plugin", + processor_class = "com.google.auto.service.processor.AutoServiceProcessor", + visibility = ["//visibility:public"], + deps = [ + ":errorprone", + "@maven//:com_google_errorprone_error_prone_core", + "@maven//:com_google_auto_service_auto_service", + ], +) load("@com_googlesource_gerrit_bazlets//tools:junit.bzl", "junit_tests") - junit_tests( name = "AllTests", srcs = glob(["src/test/java/**/*Test.java"]), deps = [ ":errorprone", - "//mug", + "//mug:format", "@maven//:com_google_guava_guava", "@maven//:com_google_guava_guava_testlib", "@maven//:com_google_truth_truth", diff --git a/mug-errorprone/src/test/java/com/google/mu/errorprone/StringUnformatArgsCheckTest.java b/mug-errorprone/src/test/java/com/google/mu/errorprone/StringUnformatArgsCheckTest.java index 6a9f6f886d..80e30c5843 100644 --- a/mug-errorprone/src/test/java/com/google/mu/errorprone/StringUnformatArgsCheckTest.java +++ b/mug-errorprone/src/test/java/com/google/mu/errorprone/StringUnformatArgsCheckTest.java @@ -644,7 +644,7 @@ public void scanAndCollectFromMethodChecked_withBiCollector() { .doTest(); } - @Test + @Test public void methodWithoutMapperParameterIsIgnored() { helper .addSourceLines( diff --git a/mug-examples/BUILD b/mug-examples/BUILD new file mode 100644 index 0000000000..548c549861 --- /dev/null +++ b/mug-examples/BUILD @@ -0,0 +1,17 @@ +load("@com_googlesource_gerrit_bazlets//tools:junit.bzl", "junit_tests") + + +junit_tests( + name = "AllTests", + srcs = glob(["src/test/java/**/*Test.java"]), + deps = [ + "//mug:base", + "//mug:format", + "//mug-guava", + "@maven//:com_google_guava_guava", + "@maven//:com_google_truth_truth", + "@maven//:com_google_truth_extensions_truth_java8_extension", + "@maven//:com_google_errorprone_error_prone_annotations", + "@maven//:junit_junit", + ], +) \ No newline at end of file diff --git a/mug-examples/src/test/java/examples/HowToCollectToCustomTypesTest.java b/mug-examples/src/test/java/com/google/mu/examples/HowToCollectToCustomTypesTest.java similarity index 98% rename from mug-examples/src/test/java/examples/HowToCollectToCustomTypesTest.java rename to mug-examples/src/test/java/com/google/mu/examples/HowToCollectToCustomTypesTest.java index 4be72dc400..3de2e31839 100644 --- a/mug-examples/src/test/java/examples/HowToCollectToCustomTypesTest.java +++ b/mug-examples/src/test/java/com/google/mu/examples/HowToCollectToCustomTypesTest.java @@ -1,4 +1,4 @@ -package examples; +package com.google.mu.examples; import com.google.common.collect.ImmutableListMultimap; import com.google.common.collect.ImmutableMap; diff --git a/mug-examples/src/test/java/examples/HowToConcatenateMapsTest.java b/mug-examples/src/test/java/com/google/mu/examples/HowToConcatenateMapsTest.java similarity index 98% rename from mug-examples/src/test/java/examples/HowToConcatenateMapsTest.java rename to mug-examples/src/test/java/com/google/mu/examples/HowToConcatenateMapsTest.java index 76ac2f4502..bf36af365c 100644 --- a/mug-examples/src/test/java/examples/HowToConcatenateMapsTest.java +++ b/mug-examples/src/test/java/com/google/mu/examples/HowToConcatenateMapsTest.java @@ -1,4 +1,4 @@ -package examples; +package com.google.mu.examples; import static com.google.common.truth.Truth.assertThat; import static com.google.mu.util.stream.BiStream.concat; diff --git a/mug-examples/src/test/java/examples/HowToCreateTypeSafeCartesianProductTest.java b/mug-examples/src/test/java/com/google/mu/examples/HowToCreateTypeSafeCartesianProductTest.java similarity index 98% rename from mug-examples/src/test/java/examples/HowToCreateTypeSafeCartesianProductTest.java rename to mug-examples/src/test/java/com/google/mu/examples/HowToCreateTypeSafeCartesianProductTest.java index 8a4f64d972..4955724c2d 100644 --- a/mug-examples/src/test/java/examples/HowToCreateTypeSafeCartesianProductTest.java +++ b/mug-examples/src/test/java/com/google/mu/examples/HowToCreateTypeSafeCartesianProductTest.java @@ -1,4 +1,4 @@ -package examples; +package com.google.mu.examples; import static com.google.common.truth.Truth.assertThat; import static com.google.mu.util.stream.BiStream.crossJoining; diff --git a/mug-examples/src/test/java/examples/HowToDoGroupingFluentlyTest.java b/mug-examples/src/test/java/com/google/mu/examples/HowToDoGroupingFluentlyTest.java similarity index 98% rename from mug-examples/src/test/java/examples/HowToDoGroupingFluentlyTest.java rename to mug-examples/src/test/java/com/google/mu/examples/HowToDoGroupingFluentlyTest.java index 2dd750508c..00aad7d2dc 100644 --- a/mug-examples/src/test/java/examples/HowToDoGroupingFluentlyTest.java +++ b/mug-examples/src/test/java/com/google/mu/examples/HowToDoGroupingFluentlyTest.java @@ -1,4 +1,4 @@ -package examples; +package com.google.mu.examples; import static com.google.common.collect.ImmutableSet.toImmutableSet; import static com.google.common.truth.Truth.assertThat; diff --git a/mug-examples/src/test/java/com/google/mu/examples/HowToUseStringFormatTest.java b/mug-examples/src/test/java/com/google/mu/examples/HowToUseStringFormatTest.java new file mode 100644 index 0000000000..a5c0ba01d7 --- /dev/null +++ b/mug-examples/src/test/java/com/google/mu/examples/HowToUseStringFormatTest.java @@ -0,0 +1,18 @@ +package com.google.mu.examples; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +import com.google.mu.util.StringFormat; + +@RunWith(JUnit4.class) +public class HowToUseStringFormatTest { + + @Test public void testIt() { + } + + private String badUsage() { + return new StringFormat("{key}:{value}").parseOrThrow("k:v", key -> key); + } +} diff --git a/mug-examples/src/test/java/examples/HowToZipPairwiseElementsTest.java b/mug-examples/src/test/java/com/google/mu/examples/HowToZipPairwiseElementsTest.java similarity index 97% rename from mug-examples/src/test/java/examples/HowToZipPairwiseElementsTest.java rename to mug-examples/src/test/java/com/google/mu/examples/HowToZipPairwiseElementsTest.java index 9c009a03c5..b69b499f08 100644 --- a/mug-examples/src/test/java/examples/HowToZipPairwiseElementsTest.java +++ b/mug-examples/src/test/java/com/google/mu/examples/HowToZipPairwiseElementsTest.java @@ -1,4 +1,4 @@ -package examples; +package com.google.mu.examples; import static com.google.common.collect.ImmutableList.toImmutableList; import static com.google.common.truth.Truth.assertThat; diff --git a/mug-guava/BUILD b/mug-guava/BUILD index e37955e488..6377293b13 100644 --- a/mug-guava/BUILD +++ b/mug-guava/BUILD @@ -6,7 +6,7 @@ java_library( "@@maven//:com_google_guava_guava", "@maven//:org_checkerframework_checker_qual", "@maven//:com_google_errorprone_error_prone_annotations", - "//mug", + "//mug:base", ], ) @@ -19,7 +19,7 @@ junit_tests( srcs = glob(["src/test/java/**/*Test.java"]), deps = [ ":mug-guava", - "//mug", + "//mug:base", "@maven//:com_google_guava_guava", "@maven//:com_google_guava_guava_testlib", "@maven//:com_google_truth_truth", diff --git a/mug-protobuf/BUILD b/mug-protobuf/BUILD index e0916ef92e..0a8bbcb0d2 100644 --- a/mug-protobuf/BUILD +++ b/mug-protobuf/BUILD @@ -8,12 +8,10 @@ java_library( "@maven//:com_google_errorprone_error_prone_annotations", "@maven//:com_google_protobuf_protobuf_java", "@maven//:com_google_protobuf_protobuf_java_util", - "//mug", + "//mug:base", ], ) - - load("@com_googlesource_gerrit_bazlets//tools:junit.bzl", "junit_tests") @@ -22,7 +20,7 @@ junit_tests( srcs = glob(["src/test/java/**/*Test.java"]), deps = [ ":mug-protobuf", - "//mug", + "//mug:base", "//mug-guava", "@maven//:com_google_guava_guava", "@maven//:com_google_guava_guava_testlib", diff --git a/mug/BUILD b/mug/BUILD index 2cd978a954..864bb12eb9 100644 --- a/mug/BUILD +++ b/mug/BUILD @@ -1,8 +1,34 @@ java_library( - name = "mug", + name = "base", visibility = ["//visibility:public"], - srcs = glob(["src/main/java/**/*.java"]), - resources = glob(["src/main/resources/**"]), + srcs = glob([ + "src/main/java/com/google/mu/util/*.java", + "src/main/java/com/google/mu/util/stream/*.java", + "src/main/java/com/google/mu/function/*.java", + ], + exclude = ["src/main/java/com/google/mu/util/StringFormat.java"]), +) + +java_library( + name = "graph", + visibility = ["//visibility:public"], + srcs = glob([ "src/main/java/com/google/mu/util/graph/*.java"]), + deps = [":base"] +) + +java_library( + name = "concurrent", + visibility = ["//visibility:public"], + srcs = glob([ "src/main/java/com/google/mu/util/concurrent/*.java"]), + deps = [":base"] +) + +java_library( + name = "format", + visibility = ["//visibility:public"], + srcs = ["src/main/java/com/google/mu/util/StringFormat.java"], + deps = [":base"], + exported_plugins = ["//mug-errorprone:plugin"], ) load("@com_googlesource_gerrit_bazlets//tools:junit.bzl", "junit_tests") @@ -11,7 +37,8 @@ java_library( name = "tests", srcs = glob(["src/test/java/**/*.java"], exclude = glob(["src/test/java/**/*Test.java"])), deps = [ - ":mug", + ":base", + ":concurrent", "@maven//:com_google_guava_guava", "@maven//:com_google_guava_guava_testlib", "@maven//:com_google_truth_truth", @@ -29,7 +56,10 @@ junit_tests( name = "AllTests", srcs = glob(["src/test/java/**/*Test.java"]), deps = [ - ":mug", + ":base", + ":concurrent", + ":format", + ":graph", ":tests", "@maven//:com_google_guava_guava", "@maven//:com_google_guava_guava_testlib",