diff --git a/.bazelignore b/.bazelignore new file mode 100644 index 00000000..1e107f52 --- /dev/null +++ b/.bazelignore @@ -0,0 +1 @@ +examples diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml index cb2a2ff6..d01caf27 100644 --- a/.bcr/presubmit.yml +++ b/.bcr/presubmit.yml @@ -1,10 +1,18 @@ -# We should probably create a standalone test module, but for now we'll just run our in-repo tests. bcr_test_module: matrix: platform: ["debian10", "macos", "ubuntu2004", "windows"] tasks: - run_tests: - name: "Run tests" + gazelle: + working_directory: "examples/gazelle" + name: "Gazelle" + platform: ${{ platform }} + run_targets: + - "//:gazelle" + test_targets: + - "//..." + tests_and_lints: + working_directory: "examples/tests_and_lints" + name: "Tests and lints" platform: ${{ platform }} test_targets: - "//..." diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 31ec1f07..d1743fdb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,17 +38,29 @@ jobs: env: # Bazelisk will download bazel to here, ensure it is cached between runs. XDG_CACHE_HOME: ~/.cache/bazel-repo - run: bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc test --config=jdk11 //... + run: bazel --bazelrc=.github/workflows/ci.bazelrc test --config=jdk11 //... - name: bazel test //... (Java 17) env: # Bazelisk will download bazel to here, ensure it is cached between runs. XDG_CACHE_HOME: ~/.cache/bazel-repo - run: bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc test //... + run: bazel --bazelrc=.github/workflows/ci.bazelrc test //... - name: bazel test //... (no bzlmod) env: # Bazelisk will download bazel to here, ensure it is cached between runs. XDG_CACHE_HOME: ~/.cache/bazel-repo # The docs targets are tagged as `manual` to prevent stardoc from running with bzlmod - run: bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc test --noenable_bzlmod //... //docs:all + run: bazel --bazelrc=.github/workflows/ci.bazelrc test --noenable_bzlmod //... //docs:all + + - name: bzlmod tests_and_lints + env: + # Bazelisk will download bazel to here, ensure it is cached between runs. + XDG_CACHE_HOME: ~/.cache/bazel-repo + run: (cd examples/tests_and_lints && bazel --bazelrc=../../.github/workflows/ci.bazelrc test --enable_bzlmod //...) + + - name: bzlmod gazelle + env: + # Bazelisk will download bazel to here, ensure it is cached between runs. + XDG_CACHE_HOME: ~/.cache/bazel-repo + run: (cd examples/gazelle && bazel --bazelrc=../../.github/workflows/ci.bazelrc run --enable_bzlmod //:gazelle && bazel --bazelrc=../../.github/workflows/ci.bazelrc test --enable_bzlmod //...) diff --git a/examples/gazelle/.gitignore b/examples/gazelle/.gitignore new file mode 100644 index 00000000..2f0f755d --- /dev/null +++ b/examples/gazelle/.gitignore @@ -0,0 +1,2 @@ +/bazel-* +/MODULE.bazel.lock diff --git a/examples/gazelle/BUILD.bazel b/examples/gazelle/BUILD.bazel new file mode 100644 index 00000000..9f40df3a --- /dev/null +++ b/examples/gazelle/BUILD.bazel @@ -0,0 +1,15 @@ +load("@gazelle//:def.bzl", "gazelle", "gazelle_binary") + +gazelle_binary( + name = "gazelle_binary", + languages = [ + "@gazelle//language/proto:go_default_library", + "@contrib_rules_jvm//java/gazelle", + ], + visibility = ["//visibility:private"], +) + +gazelle( + name = "gazelle", + gazelle = ":gazelle_binary", +) diff --git a/examples/gazelle/MODULE.bazel b/examples/gazelle/MODULE.bazel new file mode 100644 index 00000000..5e798d40 --- /dev/null +++ b/examples/gazelle/MODULE.bazel @@ -0,0 +1,44 @@ +module( + name = "gazelle_example", + version = "0.0.0", +) + +bazel_dep( + name = "contrib_rules_jvm", + version = "0.0.0", +) +local_path_override( + module_name = "contrib_rules_jvm", + path = "../..", +) + +bazel_dep( + name = "bazel_skylib", + version = "1.5.0", +) +bazel_dep( + name = "rules_jvm_external", + version = "5.3", +) + +maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") +maven.install( + name = "maven", + artifacts = [ + "org.junit.jupiter:junit-jupiter-api:5.8.2", + "org.junit.jupiter:junit-jupiter-engine:5.8.2", + "org.junit.platform:junit-platform-launcher:1.8.2", + "org.junit.platform:junit-platform-reporting:1.8.2", + ], + lock_file = "//:maven_install.json", +) +use_repo( + maven, + "maven", + "unpinned_maven", +) + +bazel_dep( + name = "gazelle", + version = "0.34.0", +) diff --git a/examples/gazelle/README.md b/examples/gazelle/README.md new file mode 100644 index 00000000..dc18ee3a --- /dev/null +++ b/examples/gazelle/README.md @@ -0,0 +1,5 @@ +This example contains java files which don't have BUILD targets for them. + +It requires running `bazel run :gazelle` to generate targets which can be built. + +There is a test using `genquery` which asserts that the right targets are generated. diff --git a/examples/gazelle/maven_install.json b/examples/gazelle/maven_install.json new file mode 100644 index 00000000..0e877bdd --- /dev/null +++ b/examples/gazelle/maven_install.json @@ -0,0 +1,630 @@ +{ + "__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL", + "__INPUT_ARTIFACTS_HASH": -1398196758, + "__RESOLVED_ARTIFACTS_HASH": -192296212, + "conflict_resolution": { + "com.google.errorprone:error_prone_annotations:2.3.2": "com.google.errorprone:error_prone_annotations:2.11.0" + }, + "artifacts": { + "com.google.auto.value:auto-value-annotations": { + "shasums": { + "jar": "fedd59b0b4986c342f6ab2d182f2a4ee9fceb2c7e2d5bdc4dc764c92394a23d3", + "sources": "41dbbed2cc92e72fe61e622f715735b05db45dcc49a1276619781b6e19e7a91f" + }, + "version": "1.7.4" + }, + "com.google.code.findbugs:jsr305": { + "shasums": { + "jar": "766ad2a0783f2687962c8ad74ceecc38a28b9f72a2d085ee438b7813e928d0c7", + "sources": "1c9e85e272d0708c6a591dc74828c71603053b48cc75ae83cce56912a2aa063b" + }, + "version": "3.0.2" + }, + "com.google.code.gson:gson": { + "shasums": { + "jar": "d3999291855de495c94c743761b8ab5176cfeabe281a5ab0d8e8d45326fd703e", + "sources": "ba5bddb1a89eb721fcca39f3b34294532060f851e2407a82d82134a41eec4719" + }, + "version": "2.8.9" + }, + "com.google.errorprone:error_prone_annotations": { + "shasums": { + "jar": "721cb91842b46fa056847d104d5225c8b8e1e8b62263b993051e1e5a0137b7ec", + "sources": "31a8f1bd791fb22c606af95049062a3c8252ce4b1b17555d00dc609e6371101d" + }, + "version": "2.11.0" + }, + "com.google.guava:failureaccess": { + "shasums": { + "jar": "a171ee4c734dd2da837e4b16be9df4661afab72a41adaf31eb84dfdaf936ca26", + "sources": "092346eebbb1657b51aa7485a246bf602bb464cc0b0e2e1c7e7201fadce1e98f" + }, + "version": "1.0.1" + }, + "com.google.guava:guava": { + "shasums": { + "jar": "a42edc9cab792e39fe39bb94f3fca655ed157ff87a8af78e1d6ba5b07c4a00ab", + "sources": "8ab1853cdaf936ec88be80c17302b7c20abafbd4f54d4fb54d7011c529e3a44a" + }, + "version": "31.1-jre" + }, + "com.google.guava:guava-testlib": { + "shasums": { + "jar": "aadc71b10d5c3ac474dd16be84cfb18d257e584d1e0a59f8cab64ef4376226ce", + "sources": "7149659f8966197dcd91a42183349f862d3973f8e65efe6d03e678464fa13bfd" + }, + "version": "31.1-jre" + }, + "com.google.guava:listenablefuture": { + "shasums": { + "jar": "b372a037d4230aa57fbeffdef30fd6123f9c0c2db85d0aced00c91b974f33f99", + "sources": null + }, + "version": "9999.0-empty-to-avoid-conflict-with-guava" + }, + "com.google.j2objc:j2objc-annotations": { + "shasums": { + "jar": "21af30c92267bd6122c0e0b4d20cccb6641a37eaf956c6540ec471d584e64a7b", + "sources": "ba4df669fec153fa4cd0ef8d02c6d3ef0702b7ac4cabe080facf3b6e490bb972" + }, + "version": "1.3" + }, + "com.google.truth:truth": { + "shasums": { + "jar": "a85e03b8b6ae8780f060cfded9500a3d1b5f52808f99a2ea6da9c683313c7518", + "sources": "a98b2f82af388484dfe1b2b859c3c05a28fcae000fc532ef0155e1814fa3af05" + }, + "version": "1.1.2" + }, + "junit:junit": { + "shasums": { + "jar": "8e495b634469d64fb8acfa3495a065cbacc8a0fff55ce1e31007be4c16dc57d3", + "sources": "34181df6482d40ea4c046b063cb53c7ffae94bdf1b1d62695bdf3adf9dea7e3a" + }, + "version": "4.13.2" + }, + "net.bytebuddy:byte-buddy": { + "shasums": { + "jar": "d2e46555699e70361b5471a7e142f9c67855bba6907a285177ebd8ad973775d8", + "sources": "94a6f5d7d8491ca7541f2da90bac4f084e04264112e936334493b2c2f094455d" + }, + "version": "1.12.7" + }, + "net.bytebuddy:byte-buddy-agent": { + "shasums": { + "jar": "73d84bb6e8e8980e674d796a29063f510ceb527c6f8c912a08a13e236be05c71", + "sources": "a6d5b1157061231f61c833f1cc76c71287947c75b4064404a47f01f6e970c544" + }, + "version": "1.12.7" + }, + "org.apiguardian:apiguardian-api": { + "shasums": { + "jar": "b509448ac506d607319f182537f0b35d71007582ec741832a1f111e5b5b70b38", + "sources": "277a7a4315412817beb6655b324dc7276621e95ebff00b8bf65e17a27b685e2d" + }, + "version": "1.1.2" + }, + "org.checkerframework:checker-qual": { + "shasums": { + "jar": "ff10785ac2a357ec5de9c293cb982a2cbb605c0309ea4cc1cb9b9bc6dbe7f3cb", + "sources": "fd99a45195ed893803624d1030387056a96601013f5e61ccabd79abb4ddfa876" + }, + "version": "3.12.0" + }, + "org.hamcrest:hamcrest-core": { + "shasums": { + "jar": "66fdef91e9739348df7a096aa384a5685f4e875584cce89386a7a47251c4d8e9", + "sources": "e223d2d8fbafd66057a8848cc94222d63c3cedd652cc48eddc0ab5c39c0f84df" + }, + "version": "1.3" + }, + "org.junit.jupiter:junit-jupiter-api": { + "shasums": { + "jar": "1808ee87e0f718cd6e25f3b75afc17956ac8a3edc48c7e9bab9f19f9a79e3801", + "sources": "cb38569ae9005eb54c7cbc181b842e6eb01be57ae0d785f9167d9e019b44a670" + }, + "version": "5.8.2" + }, + "org.junit.jupiter:junit-jupiter-engine": { + "shasums": { + "jar": "753b7726cdd158bb34cedb94c161e2291896f47832a1e9eda53d970020a8184e", + "sources": "9ed4edf417cbc6028c634a0b407061433327c9ef4235fca35b9183da855e2e8f" + }, + "version": "5.8.2" + }, + "org.junit.platform:junit-platform-commons": { + "shasums": { + "jar": "d2e015fca7130e79af2f4608dc54415e4b10b592d77333decb4b1a274c185050", + "sources": "7ae3683c452ee4259b2d205d56c7172fd178180b02d20b4430368ef6ee501c3b" + }, + "version": "1.8.2" + }, + "org.junit.platform:junit-platform-engine": { + "shasums": { + "jar": "0b7d000f8c3e8e5f7d6b819649936e7b9938314e87c8f983805218ea57567e59", + "sources": "4cfda26b1dc0812fcf0a14b0bb5612b7c697e50afd79819d2e07b1faef9c239b" + }, + "version": "1.8.2" + }, + "org.junit.platform:junit-platform-launcher": { + "shasums": { + "jar": "822156409fd83e682e4c5199b3460054299b538a058c2c6d0f5c9b6a5bdb7594", + "sources": "ee8440e84c23e52519b57e77a30627f80d91ac148244162ee2eea1ba809c1bdc" + }, + "version": "1.8.2" + }, + "org.junit.platform:junit-platform-reporting": { + "shasums": { + "jar": "d28048333b378d166f9ad38c2a8e34ac0fa1a29cc016cb279df53c8b54628fc3", + "sources": "489df906d84675ba6d078e076a5ffd8c8feec62e390539d6d61938de98b269f4" + }, + "version": "1.8.2" + }, + "org.mockito:mockito-core": { + "shasums": { + "jar": "148de2c6928365db29443ca12d35c930d9f481172b934fdd801d1cb1409ea83a", + "sources": "7d530f39577843b16f6dba2c49846f07101f3ce734ac8caef4ba932f6527f1f6" + }, + "version": "4.3.1" + }, + "org.objenesis:objenesis": { + "shasums": { + "jar": "03d960bd5aef03c653eb000413ada15eb77cdd2b8e4448886edf5692805e35f3", + "sources": "56a7987f5746bd809c363e29055c41f5472a086b0e0e32248693e064d10bc306" + }, + "version": "3.2" + }, + "org.opentest4j:opentest4j": { + "shasums": { + "jar": "58812de60898d976fb81ef3b62da05c6604c18fd4a249f5044282479fc286af2", + "sources": "b63495ef700fb2af2cdee8dd68659b27822650058234a602f9ed1d14b909a1a8" + }, + "version": "1.2.0" + }, + "org.ow2.asm:asm": { + "shasums": { + "jar": "0df97574914aee92fd349d0cb4e00f3345d45b2c239e0bb50f0a90ead47888e0", + "sources": "829bc5eb0ccd705a7c8afbf7cdc4b7e9a9f733d3a1a954b9afffd99c8e063366" + }, + "version": "9.0" + } + }, + "dependencies": { + "com.google.guava:guava": [ + "com.google.code.findbugs:jsr305", + "com.google.errorprone:error_prone_annotations", + "com.google.guava:failureaccess", + "com.google.guava:listenablefuture", + "com.google.j2objc:j2objc-annotations", + "org.checkerframework:checker-qual" + ], + "com.google.guava:guava-testlib": [ + "com.google.code.findbugs:jsr305", + "com.google.errorprone:error_prone_annotations", + "com.google.guava:guava", + "com.google.j2objc:j2objc-annotations", + "junit:junit", + "org.checkerframework:checker-qual" + ], + "com.google.truth:truth": [ + "com.google.auto.value:auto-value-annotations", + "com.google.errorprone:error_prone_annotations", + "com.google.guava:guava", + "junit:junit", + "org.checkerframework:checker-qual", + "org.ow2.asm:asm" + ], + "junit:junit": [ + "org.hamcrest:hamcrest-core" + ], + "org.junit.jupiter:junit-jupiter-api": [ + "org.apiguardian:apiguardian-api", + "org.junit.platform:junit-platform-commons", + "org.opentest4j:opentest4j" + ], + "org.junit.jupiter:junit-jupiter-engine": [ + "org.apiguardian:apiguardian-api", + "org.junit.jupiter:junit-jupiter-api", + "org.junit.platform:junit-platform-engine" + ], + "org.junit.platform:junit-platform-commons": [ + "org.apiguardian:apiguardian-api" + ], + "org.junit.platform:junit-platform-engine": [ + "org.apiguardian:apiguardian-api", + "org.junit.platform:junit-platform-commons", + "org.opentest4j:opentest4j" + ], + "org.junit.platform:junit-platform-launcher": [ + "org.apiguardian:apiguardian-api", + "org.junit.platform:junit-platform-engine" + ], + "org.junit.platform:junit-platform-reporting": [ + "org.apiguardian:apiguardian-api", + "org.junit.platform:junit-platform-launcher" + ], + "org.mockito:mockito-core": [ + "net.bytebuddy:byte-buddy", + "net.bytebuddy:byte-buddy-agent", + "org.objenesis:objenesis" + ] + }, + "skipped": [ + "com.google.guava:listenablefuture:jar:sources" + ], + "packages": { + "com.google.auto.value:auto-value-annotations": [ + "com.google.auto.value", + "com.google.auto.value.extension.memoized", + "com.google.auto.value.extension.serializable" + ], + "com.google.code.findbugs:jsr305": [ + "javax.annotation", + "javax.annotation.concurrent", + "javax.annotation.meta" + ], + "com.google.code.gson:gson": [ + "com.google.gson", + "com.google.gson.annotations", + "com.google.gson.internal", + "com.google.gson.internal.bind", + "com.google.gson.internal.bind.util", + "com.google.gson.internal.reflect", + "com.google.gson.internal.sql", + "com.google.gson.reflect", + "com.google.gson.stream" + ], + "com.google.errorprone:error_prone_annotations": [ + "com.google.errorprone.annotations", + "com.google.errorprone.annotations.concurrent" + ], + "com.google.guava:failureaccess": [ + "com.google.common.util.concurrent.internal" + ], + "com.google.guava:guava": [ + "com.google.common.annotations", + "com.google.common.base", + "com.google.common.base.internal", + "com.google.common.cache", + "com.google.common.collect", + "com.google.common.escape", + "com.google.common.eventbus", + "com.google.common.graph", + "com.google.common.hash", + "com.google.common.html", + "com.google.common.io", + "com.google.common.math", + "com.google.common.net", + "com.google.common.primitives", + "com.google.common.reflect", + "com.google.common.util.concurrent", + "com.google.common.xml", + "com.google.thirdparty.publicsuffix" + ], + "com.google.guava:guava-testlib": [ + "com.google.common.collect.testing", + "com.google.common.collect.testing.features", + "com.google.common.collect.testing.google", + "com.google.common.collect.testing.testers", + "com.google.common.escape.testing", + "com.google.common.testing", + "com.google.common.util.concurrent.testing" + ], + "com.google.j2objc:j2objc-annotations": [ + "com.google.j2objc.annotations" + ], + "com.google.truth:truth": [ + "com.google.common.truth" + ], + "junit:junit": [ + "junit.extensions", + "junit.framework", + "junit.runner", + "junit.textui", + "org.junit", + "org.junit.experimental", + "org.junit.experimental.categories", + "org.junit.experimental.max", + "org.junit.experimental.results", + "org.junit.experimental.runners", + "org.junit.experimental.theories", + "org.junit.experimental.theories.internal", + "org.junit.experimental.theories.suppliers", + "org.junit.function", + "org.junit.internal", + "org.junit.internal.builders", + "org.junit.internal.management", + "org.junit.internal.matchers", + "org.junit.internal.requests", + "org.junit.internal.runners", + "org.junit.internal.runners.model", + "org.junit.internal.runners.rules", + "org.junit.internal.runners.statements", + "org.junit.matchers", + "org.junit.rules", + "org.junit.runner", + "org.junit.runner.manipulation", + "org.junit.runner.notification", + "org.junit.runners", + "org.junit.runners.model", + "org.junit.runners.parameterized", + "org.junit.validator" + ], + "net.bytebuddy:byte-buddy": [ + "net.bytebuddy", + "net.bytebuddy.agent.builder", + "net.bytebuddy.asm", + "net.bytebuddy.build", + "net.bytebuddy.description", + "net.bytebuddy.description.annotation", + "net.bytebuddy.description.enumeration", + "net.bytebuddy.description.field", + "net.bytebuddy.description.method", + "net.bytebuddy.description.modifier", + "net.bytebuddy.description.type", + "net.bytebuddy.dynamic", + "net.bytebuddy.dynamic.loading", + "net.bytebuddy.dynamic.scaffold", + "net.bytebuddy.dynamic.scaffold.inline", + "net.bytebuddy.dynamic.scaffold.subclass", + "net.bytebuddy.implementation", + "net.bytebuddy.implementation.attribute", + "net.bytebuddy.implementation.auxiliary", + "net.bytebuddy.implementation.bind", + "net.bytebuddy.implementation.bind.annotation", + "net.bytebuddy.implementation.bytecode", + "net.bytebuddy.implementation.bytecode.assign", + "net.bytebuddy.implementation.bytecode.assign.primitive", + "net.bytebuddy.implementation.bytecode.assign.reference", + "net.bytebuddy.implementation.bytecode.collection", + "net.bytebuddy.implementation.bytecode.constant", + "net.bytebuddy.implementation.bytecode.member", + "net.bytebuddy.jar.asm", + "net.bytebuddy.jar.asm.commons", + "net.bytebuddy.jar.asm.signature", + "net.bytebuddy.matcher", + "net.bytebuddy.pool", + "net.bytebuddy.utility", + "net.bytebuddy.utility.dispatcher", + "net.bytebuddy.utility.nullability", + "net.bytebuddy.utility.privilege", + "net.bytebuddy.utility.visitor" + ], + "net.bytebuddy:byte-buddy-agent": [ + "net.bytebuddy.agent", + "net.bytebuddy.agent.utility.nullability" + ], + "net.bytebuddy:byte-buddy:jar:sources": [ + "net.bytebuddy.build" + ], + "org.apiguardian:apiguardian-api": [ + "org.apiguardian.api" + ], + "org.checkerframework:checker-qual": [ + "org.checkerframework.checker.builder.qual", + "org.checkerframework.checker.calledmethods.qual", + "org.checkerframework.checker.compilermsgs.qual", + "org.checkerframework.checker.fenum.qual", + "org.checkerframework.checker.formatter.qual", + "org.checkerframework.checker.guieffect.qual", + "org.checkerframework.checker.i18n.qual", + "org.checkerframework.checker.i18nformatter.qual", + "org.checkerframework.checker.index.qual", + "org.checkerframework.checker.initialization.qual", + "org.checkerframework.checker.interning.qual", + "org.checkerframework.checker.lock.qual", + "org.checkerframework.checker.nullness.qual", + "org.checkerframework.checker.optional.qual", + "org.checkerframework.checker.propkey.qual", + "org.checkerframework.checker.regex.qual", + "org.checkerframework.checker.signature.qual", + "org.checkerframework.checker.signedness.qual", + "org.checkerframework.checker.tainting.qual", + "org.checkerframework.checker.units.qual", + "org.checkerframework.common.aliasing.qual", + "org.checkerframework.common.initializedfields.qual", + "org.checkerframework.common.reflection.qual", + "org.checkerframework.common.returnsreceiver.qual", + "org.checkerframework.common.subtyping.qual", + "org.checkerframework.common.util.report.qual", + "org.checkerframework.common.value.qual", + "org.checkerframework.dataflow.qual", + "org.checkerframework.framework.qual" + ], + "org.hamcrest:hamcrest-core": [ + "org.hamcrest", + "org.hamcrest.core", + "org.hamcrest.internal" + ], + "org.junit.jupiter:junit-jupiter-api": [ + "org.junit.jupiter.api", + "org.junit.jupiter.api.condition", + "org.junit.jupiter.api.extension", + "org.junit.jupiter.api.extension.support", + "org.junit.jupiter.api.function", + "org.junit.jupiter.api.io", + "org.junit.jupiter.api.parallel" + ], + "org.junit.jupiter:junit-jupiter-engine": [ + "org.junit.jupiter.engine", + "org.junit.jupiter.engine.config", + "org.junit.jupiter.engine.descriptor", + "org.junit.jupiter.engine.discovery", + "org.junit.jupiter.engine.discovery.predicates", + "org.junit.jupiter.engine.execution", + "org.junit.jupiter.engine.extension", + "org.junit.jupiter.engine.support" + ], + "org.junit.platform:junit-platform-commons": [ + "org.junit.platform.commons", + "org.junit.platform.commons.annotation", + "org.junit.platform.commons.function", + "org.junit.platform.commons.logging", + "org.junit.platform.commons.support", + "org.junit.platform.commons.util" + ], + "org.junit.platform:junit-platform-engine": [ + "org.junit.platform.engine", + "org.junit.platform.engine.discovery", + "org.junit.platform.engine.reporting", + "org.junit.platform.engine.support.config", + "org.junit.platform.engine.support.descriptor", + "org.junit.platform.engine.support.discovery", + "org.junit.platform.engine.support.filter", + "org.junit.platform.engine.support.hierarchical" + ], + "org.junit.platform:junit-platform-launcher": [ + "org.junit.platform.launcher", + "org.junit.platform.launcher.core", + "org.junit.platform.launcher.listeners", + "org.junit.platform.launcher.listeners.discovery", + "org.junit.platform.launcher.listeners.session", + "org.junit.platform.launcher.tagexpression" + ], + "org.junit.platform:junit-platform-reporting": [ + "org.junit.platform.reporting.legacy", + "org.junit.platform.reporting.legacy.xml" + ], + "org.mockito:mockito-core": [ + "org.mockito", + "org.mockito.codegen", + "org.mockito.configuration", + "org.mockito.creation.instance", + "org.mockito.exceptions.base", + "org.mockito.exceptions.misusing", + "org.mockito.exceptions.stacktrace", + "org.mockito.exceptions.verification", + "org.mockito.exceptions.verification.junit", + "org.mockito.exceptions.verification.opentest4j", + "org.mockito.hamcrest", + "org.mockito.internal", + "org.mockito.internal.configuration", + "org.mockito.internal.configuration.injection", + "org.mockito.internal.configuration.injection.filter", + "org.mockito.internal.configuration.injection.scanner", + "org.mockito.internal.configuration.plugins", + "org.mockito.internal.creation", + "org.mockito.internal.creation.bytebuddy", + "org.mockito.internal.creation.instance", + "org.mockito.internal.creation.proxy", + "org.mockito.internal.creation.settings", + "org.mockito.internal.creation.util", + "org.mockito.internal.debugging", + "org.mockito.internal.exceptions", + "org.mockito.internal.exceptions.stacktrace", + "org.mockito.internal.exceptions.util", + "org.mockito.internal.framework", + "org.mockito.internal.hamcrest", + "org.mockito.internal.handler", + "org.mockito.internal.invocation", + "org.mockito.internal.invocation.finder", + "org.mockito.internal.invocation.mockref", + "org.mockito.internal.junit", + "org.mockito.internal.listeners", + "org.mockito.internal.matchers", + "org.mockito.internal.matchers.apachecommons", + "org.mockito.internal.matchers.text", + "org.mockito.internal.progress", + "org.mockito.internal.reporting", + "org.mockito.internal.runners", + "org.mockito.internal.runners.util", + "org.mockito.internal.session", + "org.mockito.internal.stubbing", + "org.mockito.internal.stubbing.answers", + "org.mockito.internal.stubbing.defaultanswers", + "org.mockito.internal.util", + "org.mockito.internal.util.collections", + "org.mockito.internal.util.concurrent", + "org.mockito.internal.util.io", + "org.mockito.internal.util.reflection", + "org.mockito.internal.verification", + "org.mockito.internal.verification.api", + "org.mockito.internal.verification.argumentmatching", + "org.mockito.internal.verification.checkers", + "org.mockito.invocation", + "org.mockito.junit", + "org.mockito.listeners", + "org.mockito.mock", + "org.mockito.plugins", + "org.mockito.quality", + "org.mockito.session", + "org.mockito.stubbing", + "org.mockito.verification" + ], + "org.objenesis:objenesis": [ + "org.objenesis", + "org.objenesis.instantiator", + "org.objenesis.instantiator.android", + "org.objenesis.instantiator.annotations", + "org.objenesis.instantiator.basic", + "org.objenesis.instantiator.gcj", + "org.objenesis.instantiator.perc", + "org.objenesis.instantiator.sun", + "org.objenesis.instantiator.util", + "org.objenesis.strategy" + ], + "org.opentest4j:opentest4j": [ + "org.opentest4j" + ], + "org.ow2.asm:asm": [ + "org.objectweb.asm", + "org.objectweb.asm.signature" + ] + }, + "repositories": { + "https://repo1.maven.org/maven2/": [ + "com.google.auto.value:auto-value-annotations", + "com.google.auto.value:auto-value-annotations:jar:sources", + "com.google.code.findbugs:jsr305", + "com.google.code.findbugs:jsr305:jar:sources", + "com.google.code.gson:gson", + "com.google.code.gson:gson:jar:sources", + "com.google.errorprone:error_prone_annotations", + "com.google.errorprone:error_prone_annotations:jar:sources", + "com.google.guava:failureaccess", + "com.google.guava:failureaccess:jar:sources", + "com.google.guava:guava", + "com.google.guava:guava-testlib", + "com.google.guava:guava-testlib:jar:sources", + "com.google.guava:guava:jar:sources", + "com.google.guava:listenablefuture", + "com.google.j2objc:j2objc-annotations", + "com.google.j2objc:j2objc-annotations:jar:sources", + "com.google.truth:truth", + "com.google.truth:truth:jar:sources", + "junit:junit", + "junit:junit:jar:sources", + "net.bytebuddy:byte-buddy", + "net.bytebuddy:byte-buddy-agent", + "net.bytebuddy:byte-buddy-agent:jar:sources", + "net.bytebuddy:byte-buddy:jar:sources", + "org.apiguardian:apiguardian-api", + "org.apiguardian:apiguardian-api:jar:sources", + "org.checkerframework:checker-qual", + "org.checkerframework:checker-qual:jar:sources", + "org.hamcrest:hamcrest-core", + "org.hamcrest:hamcrest-core:jar:sources", + "org.junit.jupiter:junit-jupiter-api", + "org.junit.jupiter:junit-jupiter-api:jar:sources", + "org.junit.jupiter:junit-jupiter-engine", + "org.junit.jupiter:junit-jupiter-engine:jar:sources", + "org.junit.platform:junit-platform-commons", + "org.junit.platform:junit-platform-commons:jar:sources", + "org.junit.platform:junit-platform-engine", + "org.junit.platform:junit-platform-engine:jar:sources", + "org.junit.platform:junit-platform-launcher", + "org.junit.platform:junit-platform-launcher:jar:sources", + "org.junit.platform:junit-platform-reporting", + "org.junit.platform:junit-platform-reporting:jar:sources", + "org.mockito:mockito-core", + "org.mockito:mockito-core:jar:sources", + "org.objenesis:objenesis", + "org.objenesis:objenesis:jar:sources", + "org.opentest4j:opentest4j", + "org.opentest4j:opentest4j:jar:sources", + "org.ow2.asm:asm", + "org.ow2.asm:asm:jar:sources" + ] + }, + "version": "2" +} diff --git a/examples/gazelle/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle/BUILD.bazel b/examples/gazelle/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle/BUILD.bazel new file mode 100644 index 00000000..60b833e5 --- /dev/null +++ b/examples/gazelle/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle/BUILD.bazel @@ -0,0 +1,14 @@ +load("@bazel_skylib//rules:diff_test.bzl", "diff_test") + +genquery( + name = "generated_targets", + expression = "kind(java_test, deps(//src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle:gazelle))", + opts = ["--output=label_kind"], + scope = ["//src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle"], +) + +diff_test( + name = "diff_test", + file1 = ":generated_targets", + file2 = ":expected-query-output", +) diff --git a/examples/gazelle/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle/ExampleTest.java b/examples/gazelle/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle/ExampleTest.java new file mode 100644 index 00000000..167bb956 --- /dev/null +++ b/examples/gazelle/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle/ExampleTest.java @@ -0,0 +1,8 @@ +package com.github.bazel_contrib.contrib_rules_jvm.examples.gazelle; + +import org.junit.jupiter.api.Test; + +public class ExampleTest { + @Test + public void passes() {} +} diff --git a/examples/gazelle/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle/expected-query-output b/examples/gazelle/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle/expected-query-output new file mode 100755 index 00000000..33a1ddca --- /dev/null +++ b/examples/gazelle/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle/expected-query-output @@ -0,0 +1 @@ +java_test rule //src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/gazelle:ExampleTest diff --git a/examples/tests_and_lints/.bazelversion b/examples/tests_and_lints/.bazelversion new file mode 120000 index 00000000..96cf9496 --- /dev/null +++ b/examples/tests_and_lints/.bazelversion @@ -0,0 +1 @@ +../../.bazelversion \ No newline at end of file diff --git a/examples/tests_and_lints/.gitignore b/examples/tests_and_lints/.gitignore new file mode 100644 index 00000000..2f0f755d --- /dev/null +++ b/examples/tests_and_lints/.gitignore @@ -0,0 +1,2 @@ +/bazel-* +/MODULE.bazel.lock diff --git a/examples/tests_and_lints/BUILD.bazel b/examples/tests_and_lints/BUILD.bazel new file mode 100644 index 00000000..e69de29b diff --git a/examples/tests_and_lints/MODULE.bazel b/examples/tests_and_lints/MODULE.bazel new file mode 100644 index 00000000..f5ef48d7 --- /dev/null +++ b/examples/tests_and_lints/MODULE.bazel @@ -0,0 +1,35 @@ +module( + name = "test_and_lints_example", + version = "0.0.0", +) + +bazel_dep( + name = "contrib_rules_jvm", + version = "0.0.0", +) +local_path_override( + module_name = "contrib_rules_jvm", + path = "../..", +) + +bazel_dep( + name = "rules_jvm_external", + version = "5.3", +) + +maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") +maven.install( + name = "maven", + artifacts = [ + "org.junit.jupiter:junit-jupiter-api:5.8.2", + "org.junit.jupiter:junit-jupiter-engine:5.8.2", + "org.junit.platform:junit-platform-launcher:1.8.2", + "org.junit.platform:junit-platform-reporting:1.8.2", + ], + lock_file = "//:maven_install.json", +) +use_repo( + maven, + "maven", + "unpinned_maven", +) diff --git a/examples/tests_and_lints/maven_install.json b/examples/tests_and_lints/maven_install.json new file mode 100755 index 00000000..0e877bdd --- /dev/null +++ b/examples/tests_and_lints/maven_install.json @@ -0,0 +1,630 @@ +{ + "__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL", + "__INPUT_ARTIFACTS_HASH": -1398196758, + "__RESOLVED_ARTIFACTS_HASH": -192296212, + "conflict_resolution": { + "com.google.errorprone:error_prone_annotations:2.3.2": "com.google.errorprone:error_prone_annotations:2.11.0" + }, + "artifacts": { + "com.google.auto.value:auto-value-annotations": { + "shasums": { + "jar": "fedd59b0b4986c342f6ab2d182f2a4ee9fceb2c7e2d5bdc4dc764c92394a23d3", + "sources": "41dbbed2cc92e72fe61e622f715735b05db45dcc49a1276619781b6e19e7a91f" + }, + "version": "1.7.4" + }, + "com.google.code.findbugs:jsr305": { + "shasums": { + "jar": "766ad2a0783f2687962c8ad74ceecc38a28b9f72a2d085ee438b7813e928d0c7", + "sources": "1c9e85e272d0708c6a591dc74828c71603053b48cc75ae83cce56912a2aa063b" + }, + "version": "3.0.2" + }, + "com.google.code.gson:gson": { + "shasums": { + "jar": "d3999291855de495c94c743761b8ab5176cfeabe281a5ab0d8e8d45326fd703e", + "sources": "ba5bddb1a89eb721fcca39f3b34294532060f851e2407a82d82134a41eec4719" + }, + "version": "2.8.9" + }, + "com.google.errorprone:error_prone_annotations": { + "shasums": { + "jar": "721cb91842b46fa056847d104d5225c8b8e1e8b62263b993051e1e5a0137b7ec", + "sources": "31a8f1bd791fb22c606af95049062a3c8252ce4b1b17555d00dc609e6371101d" + }, + "version": "2.11.0" + }, + "com.google.guava:failureaccess": { + "shasums": { + "jar": "a171ee4c734dd2da837e4b16be9df4661afab72a41adaf31eb84dfdaf936ca26", + "sources": "092346eebbb1657b51aa7485a246bf602bb464cc0b0e2e1c7e7201fadce1e98f" + }, + "version": "1.0.1" + }, + "com.google.guava:guava": { + "shasums": { + "jar": "a42edc9cab792e39fe39bb94f3fca655ed157ff87a8af78e1d6ba5b07c4a00ab", + "sources": "8ab1853cdaf936ec88be80c17302b7c20abafbd4f54d4fb54d7011c529e3a44a" + }, + "version": "31.1-jre" + }, + "com.google.guava:guava-testlib": { + "shasums": { + "jar": "aadc71b10d5c3ac474dd16be84cfb18d257e584d1e0a59f8cab64ef4376226ce", + "sources": "7149659f8966197dcd91a42183349f862d3973f8e65efe6d03e678464fa13bfd" + }, + "version": "31.1-jre" + }, + "com.google.guava:listenablefuture": { + "shasums": { + "jar": "b372a037d4230aa57fbeffdef30fd6123f9c0c2db85d0aced00c91b974f33f99", + "sources": null + }, + "version": "9999.0-empty-to-avoid-conflict-with-guava" + }, + "com.google.j2objc:j2objc-annotations": { + "shasums": { + "jar": "21af30c92267bd6122c0e0b4d20cccb6641a37eaf956c6540ec471d584e64a7b", + "sources": "ba4df669fec153fa4cd0ef8d02c6d3ef0702b7ac4cabe080facf3b6e490bb972" + }, + "version": "1.3" + }, + "com.google.truth:truth": { + "shasums": { + "jar": "a85e03b8b6ae8780f060cfded9500a3d1b5f52808f99a2ea6da9c683313c7518", + "sources": "a98b2f82af388484dfe1b2b859c3c05a28fcae000fc532ef0155e1814fa3af05" + }, + "version": "1.1.2" + }, + "junit:junit": { + "shasums": { + "jar": "8e495b634469d64fb8acfa3495a065cbacc8a0fff55ce1e31007be4c16dc57d3", + "sources": "34181df6482d40ea4c046b063cb53c7ffae94bdf1b1d62695bdf3adf9dea7e3a" + }, + "version": "4.13.2" + }, + "net.bytebuddy:byte-buddy": { + "shasums": { + "jar": "d2e46555699e70361b5471a7e142f9c67855bba6907a285177ebd8ad973775d8", + "sources": "94a6f5d7d8491ca7541f2da90bac4f084e04264112e936334493b2c2f094455d" + }, + "version": "1.12.7" + }, + "net.bytebuddy:byte-buddy-agent": { + "shasums": { + "jar": "73d84bb6e8e8980e674d796a29063f510ceb527c6f8c912a08a13e236be05c71", + "sources": "a6d5b1157061231f61c833f1cc76c71287947c75b4064404a47f01f6e970c544" + }, + "version": "1.12.7" + }, + "org.apiguardian:apiguardian-api": { + "shasums": { + "jar": "b509448ac506d607319f182537f0b35d71007582ec741832a1f111e5b5b70b38", + "sources": "277a7a4315412817beb6655b324dc7276621e95ebff00b8bf65e17a27b685e2d" + }, + "version": "1.1.2" + }, + "org.checkerframework:checker-qual": { + "shasums": { + "jar": "ff10785ac2a357ec5de9c293cb982a2cbb605c0309ea4cc1cb9b9bc6dbe7f3cb", + "sources": "fd99a45195ed893803624d1030387056a96601013f5e61ccabd79abb4ddfa876" + }, + "version": "3.12.0" + }, + "org.hamcrest:hamcrest-core": { + "shasums": { + "jar": "66fdef91e9739348df7a096aa384a5685f4e875584cce89386a7a47251c4d8e9", + "sources": "e223d2d8fbafd66057a8848cc94222d63c3cedd652cc48eddc0ab5c39c0f84df" + }, + "version": "1.3" + }, + "org.junit.jupiter:junit-jupiter-api": { + "shasums": { + "jar": "1808ee87e0f718cd6e25f3b75afc17956ac8a3edc48c7e9bab9f19f9a79e3801", + "sources": "cb38569ae9005eb54c7cbc181b842e6eb01be57ae0d785f9167d9e019b44a670" + }, + "version": "5.8.2" + }, + "org.junit.jupiter:junit-jupiter-engine": { + "shasums": { + "jar": "753b7726cdd158bb34cedb94c161e2291896f47832a1e9eda53d970020a8184e", + "sources": "9ed4edf417cbc6028c634a0b407061433327c9ef4235fca35b9183da855e2e8f" + }, + "version": "5.8.2" + }, + "org.junit.platform:junit-platform-commons": { + "shasums": { + "jar": "d2e015fca7130e79af2f4608dc54415e4b10b592d77333decb4b1a274c185050", + "sources": "7ae3683c452ee4259b2d205d56c7172fd178180b02d20b4430368ef6ee501c3b" + }, + "version": "1.8.2" + }, + "org.junit.platform:junit-platform-engine": { + "shasums": { + "jar": "0b7d000f8c3e8e5f7d6b819649936e7b9938314e87c8f983805218ea57567e59", + "sources": "4cfda26b1dc0812fcf0a14b0bb5612b7c697e50afd79819d2e07b1faef9c239b" + }, + "version": "1.8.2" + }, + "org.junit.platform:junit-platform-launcher": { + "shasums": { + "jar": "822156409fd83e682e4c5199b3460054299b538a058c2c6d0f5c9b6a5bdb7594", + "sources": "ee8440e84c23e52519b57e77a30627f80d91ac148244162ee2eea1ba809c1bdc" + }, + "version": "1.8.2" + }, + "org.junit.platform:junit-platform-reporting": { + "shasums": { + "jar": "d28048333b378d166f9ad38c2a8e34ac0fa1a29cc016cb279df53c8b54628fc3", + "sources": "489df906d84675ba6d078e076a5ffd8c8feec62e390539d6d61938de98b269f4" + }, + "version": "1.8.2" + }, + "org.mockito:mockito-core": { + "shasums": { + "jar": "148de2c6928365db29443ca12d35c930d9f481172b934fdd801d1cb1409ea83a", + "sources": "7d530f39577843b16f6dba2c49846f07101f3ce734ac8caef4ba932f6527f1f6" + }, + "version": "4.3.1" + }, + "org.objenesis:objenesis": { + "shasums": { + "jar": "03d960bd5aef03c653eb000413ada15eb77cdd2b8e4448886edf5692805e35f3", + "sources": "56a7987f5746bd809c363e29055c41f5472a086b0e0e32248693e064d10bc306" + }, + "version": "3.2" + }, + "org.opentest4j:opentest4j": { + "shasums": { + "jar": "58812de60898d976fb81ef3b62da05c6604c18fd4a249f5044282479fc286af2", + "sources": "b63495ef700fb2af2cdee8dd68659b27822650058234a602f9ed1d14b909a1a8" + }, + "version": "1.2.0" + }, + "org.ow2.asm:asm": { + "shasums": { + "jar": "0df97574914aee92fd349d0cb4e00f3345d45b2c239e0bb50f0a90ead47888e0", + "sources": "829bc5eb0ccd705a7c8afbf7cdc4b7e9a9f733d3a1a954b9afffd99c8e063366" + }, + "version": "9.0" + } + }, + "dependencies": { + "com.google.guava:guava": [ + "com.google.code.findbugs:jsr305", + "com.google.errorprone:error_prone_annotations", + "com.google.guava:failureaccess", + "com.google.guava:listenablefuture", + "com.google.j2objc:j2objc-annotations", + "org.checkerframework:checker-qual" + ], + "com.google.guava:guava-testlib": [ + "com.google.code.findbugs:jsr305", + "com.google.errorprone:error_prone_annotations", + "com.google.guava:guava", + "com.google.j2objc:j2objc-annotations", + "junit:junit", + "org.checkerframework:checker-qual" + ], + "com.google.truth:truth": [ + "com.google.auto.value:auto-value-annotations", + "com.google.errorprone:error_prone_annotations", + "com.google.guava:guava", + "junit:junit", + "org.checkerframework:checker-qual", + "org.ow2.asm:asm" + ], + "junit:junit": [ + "org.hamcrest:hamcrest-core" + ], + "org.junit.jupiter:junit-jupiter-api": [ + "org.apiguardian:apiguardian-api", + "org.junit.platform:junit-platform-commons", + "org.opentest4j:opentest4j" + ], + "org.junit.jupiter:junit-jupiter-engine": [ + "org.apiguardian:apiguardian-api", + "org.junit.jupiter:junit-jupiter-api", + "org.junit.platform:junit-platform-engine" + ], + "org.junit.platform:junit-platform-commons": [ + "org.apiguardian:apiguardian-api" + ], + "org.junit.platform:junit-platform-engine": [ + "org.apiguardian:apiguardian-api", + "org.junit.platform:junit-platform-commons", + "org.opentest4j:opentest4j" + ], + "org.junit.platform:junit-platform-launcher": [ + "org.apiguardian:apiguardian-api", + "org.junit.platform:junit-platform-engine" + ], + "org.junit.platform:junit-platform-reporting": [ + "org.apiguardian:apiguardian-api", + "org.junit.platform:junit-platform-launcher" + ], + "org.mockito:mockito-core": [ + "net.bytebuddy:byte-buddy", + "net.bytebuddy:byte-buddy-agent", + "org.objenesis:objenesis" + ] + }, + "skipped": [ + "com.google.guava:listenablefuture:jar:sources" + ], + "packages": { + "com.google.auto.value:auto-value-annotations": [ + "com.google.auto.value", + "com.google.auto.value.extension.memoized", + "com.google.auto.value.extension.serializable" + ], + "com.google.code.findbugs:jsr305": [ + "javax.annotation", + "javax.annotation.concurrent", + "javax.annotation.meta" + ], + "com.google.code.gson:gson": [ + "com.google.gson", + "com.google.gson.annotations", + "com.google.gson.internal", + "com.google.gson.internal.bind", + "com.google.gson.internal.bind.util", + "com.google.gson.internal.reflect", + "com.google.gson.internal.sql", + "com.google.gson.reflect", + "com.google.gson.stream" + ], + "com.google.errorprone:error_prone_annotations": [ + "com.google.errorprone.annotations", + "com.google.errorprone.annotations.concurrent" + ], + "com.google.guava:failureaccess": [ + "com.google.common.util.concurrent.internal" + ], + "com.google.guava:guava": [ + "com.google.common.annotations", + "com.google.common.base", + "com.google.common.base.internal", + "com.google.common.cache", + "com.google.common.collect", + "com.google.common.escape", + "com.google.common.eventbus", + "com.google.common.graph", + "com.google.common.hash", + "com.google.common.html", + "com.google.common.io", + "com.google.common.math", + "com.google.common.net", + "com.google.common.primitives", + "com.google.common.reflect", + "com.google.common.util.concurrent", + "com.google.common.xml", + "com.google.thirdparty.publicsuffix" + ], + "com.google.guava:guava-testlib": [ + "com.google.common.collect.testing", + "com.google.common.collect.testing.features", + "com.google.common.collect.testing.google", + "com.google.common.collect.testing.testers", + "com.google.common.escape.testing", + "com.google.common.testing", + "com.google.common.util.concurrent.testing" + ], + "com.google.j2objc:j2objc-annotations": [ + "com.google.j2objc.annotations" + ], + "com.google.truth:truth": [ + "com.google.common.truth" + ], + "junit:junit": [ + "junit.extensions", + "junit.framework", + "junit.runner", + "junit.textui", + "org.junit", + "org.junit.experimental", + "org.junit.experimental.categories", + "org.junit.experimental.max", + "org.junit.experimental.results", + "org.junit.experimental.runners", + "org.junit.experimental.theories", + "org.junit.experimental.theories.internal", + "org.junit.experimental.theories.suppliers", + "org.junit.function", + "org.junit.internal", + "org.junit.internal.builders", + "org.junit.internal.management", + "org.junit.internal.matchers", + "org.junit.internal.requests", + "org.junit.internal.runners", + "org.junit.internal.runners.model", + "org.junit.internal.runners.rules", + "org.junit.internal.runners.statements", + "org.junit.matchers", + "org.junit.rules", + "org.junit.runner", + "org.junit.runner.manipulation", + "org.junit.runner.notification", + "org.junit.runners", + "org.junit.runners.model", + "org.junit.runners.parameterized", + "org.junit.validator" + ], + "net.bytebuddy:byte-buddy": [ + "net.bytebuddy", + "net.bytebuddy.agent.builder", + "net.bytebuddy.asm", + "net.bytebuddy.build", + "net.bytebuddy.description", + "net.bytebuddy.description.annotation", + "net.bytebuddy.description.enumeration", + "net.bytebuddy.description.field", + "net.bytebuddy.description.method", + "net.bytebuddy.description.modifier", + "net.bytebuddy.description.type", + "net.bytebuddy.dynamic", + "net.bytebuddy.dynamic.loading", + "net.bytebuddy.dynamic.scaffold", + "net.bytebuddy.dynamic.scaffold.inline", + "net.bytebuddy.dynamic.scaffold.subclass", + "net.bytebuddy.implementation", + "net.bytebuddy.implementation.attribute", + "net.bytebuddy.implementation.auxiliary", + "net.bytebuddy.implementation.bind", + "net.bytebuddy.implementation.bind.annotation", + "net.bytebuddy.implementation.bytecode", + "net.bytebuddy.implementation.bytecode.assign", + "net.bytebuddy.implementation.bytecode.assign.primitive", + "net.bytebuddy.implementation.bytecode.assign.reference", + "net.bytebuddy.implementation.bytecode.collection", + "net.bytebuddy.implementation.bytecode.constant", + "net.bytebuddy.implementation.bytecode.member", + "net.bytebuddy.jar.asm", + "net.bytebuddy.jar.asm.commons", + "net.bytebuddy.jar.asm.signature", + "net.bytebuddy.matcher", + "net.bytebuddy.pool", + "net.bytebuddy.utility", + "net.bytebuddy.utility.dispatcher", + "net.bytebuddy.utility.nullability", + "net.bytebuddy.utility.privilege", + "net.bytebuddy.utility.visitor" + ], + "net.bytebuddy:byte-buddy-agent": [ + "net.bytebuddy.agent", + "net.bytebuddy.agent.utility.nullability" + ], + "net.bytebuddy:byte-buddy:jar:sources": [ + "net.bytebuddy.build" + ], + "org.apiguardian:apiguardian-api": [ + "org.apiguardian.api" + ], + "org.checkerframework:checker-qual": [ + "org.checkerframework.checker.builder.qual", + "org.checkerframework.checker.calledmethods.qual", + "org.checkerframework.checker.compilermsgs.qual", + "org.checkerframework.checker.fenum.qual", + "org.checkerframework.checker.formatter.qual", + "org.checkerframework.checker.guieffect.qual", + "org.checkerframework.checker.i18n.qual", + "org.checkerframework.checker.i18nformatter.qual", + "org.checkerframework.checker.index.qual", + "org.checkerframework.checker.initialization.qual", + "org.checkerframework.checker.interning.qual", + "org.checkerframework.checker.lock.qual", + "org.checkerframework.checker.nullness.qual", + "org.checkerframework.checker.optional.qual", + "org.checkerframework.checker.propkey.qual", + "org.checkerframework.checker.regex.qual", + "org.checkerframework.checker.signature.qual", + "org.checkerframework.checker.signedness.qual", + "org.checkerframework.checker.tainting.qual", + "org.checkerframework.checker.units.qual", + "org.checkerframework.common.aliasing.qual", + "org.checkerframework.common.initializedfields.qual", + "org.checkerframework.common.reflection.qual", + "org.checkerframework.common.returnsreceiver.qual", + "org.checkerframework.common.subtyping.qual", + "org.checkerframework.common.util.report.qual", + "org.checkerframework.common.value.qual", + "org.checkerframework.dataflow.qual", + "org.checkerframework.framework.qual" + ], + "org.hamcrest:hamcrest-core": [ + "org.hamcrest", + "org.hamcrest.core", + "org.hamcrest.internal" + ], + "org.junit.jupiter:junit-jupiter-api": [ + "org.junit.jupiter.api", + "org.junit.jupiter.api.condition", + "org.junit.jupiter.api.extension", + "org.junit.jupiter.api.extension.support", + "org.junit.jupiter.api.function", + "org.junit.jupiter.api.io", + "org.junit.jupiter.api.parallel" + ], + "org.junit.jupiter:junit-jupiter-engine": [ + "org.junit.jupiter.engine", + "org.junit.jupiter.engine.config", + "org.junit.jupiter.engine.descriptor", + "org.junit.jupiter.engine.discovery", + "org.junit.jupiter.engine.discovery.predicates", + "org.junit.jupiter.engine.execution", + "org.junit.jupiter.engine.extension", + "org.junit.jupiter.engine.support" + ], + "org.junit.platform:junit-platform-commons": [ + "org.junit.platform.commons", + "org.junit.platform.commons.annotation", + "org.junit.platform.commons.function", + "org.junit.platform.commons.logging", + "org.junit.platform.commons.support", + "org.junit.platform.commons.util" + ], + "org.junit.platform:junit-platform-engine": [ + "org.junit.platform.engine", + "org.junit.platform.engine.discovery", + "org.junit.platform.engine.reporting", + "org.junit.platform.engine.support.config", + "org.junit.platform.engine.support.descriptor", + "org.junit.platform.engine.support.discovery", + "org.junit.platform.engine.support.filter", + "org.junit.platform.engine.support.hierarchical" + ], + "org.junit.platform:junit-platform-launcher": [ + "org.junit.platform.launcher", + "org.junit.platform.launcher.core", + "org.junit.platform.launcher.listeners", + "org.junit.platform.launcher.listeners.discovery", + "org.junit.platform.launcher.listeners.session", + "org.junit.platform.launcher.tagexpression" + ], + "org.junit.platform:junit-platform-reporting": [ + "org.junit.platform.reporting.legacy", + "org.junit.platform.reporting.legacy.xml" + ], + "org.mockito:mockito-core": [ + "org.mockito", + "org.mockito.codegen", + "org.mockito.configuration", + "org.mockito.creation.instance", + "org.mockito.exceptions.base", + "org.mockito.exceptions.misusing", + "org.mockito.exceptions.stacktrace", + "org.mockito.exceptions.verification", + "org.mockito.exceptions.verification.junit", + "org.mockito.exceptions.verification.opentest4j", + "org.mockito.hamcrest", + "org.mockito.internal", + "org.mockito.internal.configuration", + "org.mockito.internal.configuration.injection", + "org.mockito.internal.configuration.injection.filter", + "org.mockito.internal.configuration.injection.scanner", + "org.mockito.internal.configuration.plugins", + "org.mockito.internal.creation", + "org.mockito.internal.creation.bytebuddy", + "org.mockito.internal.creation.instance", + "org.mockito.internal.creation.proxy", + "org.mockito.internal.creation.settings", + "org.mockito.internal.creation.util", + "org.mockito.internal.debugging", + "org.mockito.internal.exceptions", + "org.mockito.internal.exceptions.stacktrace", + "org.mockito.internal.exceptions.util", + "org.mockito.internal.framework", + "org.mockito.internal.hamcrest", + "org.mockito.internal.handler", + "org.mockito.internal.invocation", + "org.mockito.internal.invocation.finder", + "org.mockito.internal.invocation.mockref", + "org.mockito.internal.junit", + "org.mockito.internal.listeners", + "org.mockito.internal.matchers", + "org.mockito.internal.matchers.apachecommons", + "org.mockito.internal.matchers.text", + "org.mockito.internal.progress", + "org.mockito.internal.reporting", + "org.mockito.internal.runners", + "org.mockito.internal.runners.util", + "org.mockito.internal.session", + "org.mockito.internal.stubbing", + "org.mockito.internal.stubbing.answers", + "org.mockito.internal.stubbing.defaultanswers", + "org.mockito.internal.util", + "org.mockito.internal.util.collections", + "org.mockito.internal.util.concurrent", + "org.mockito.internal.util.io", + "org.mockito.internal.util.reflection", + "org.mockito.internal.verification", + "org.mockito.internal.verification.api", + "org.mockito.internal.verification.argumentmatching", + "org.mockito.internal.verification.checkers", + "org.mockito.invocation", + "org.mockito.junit", + "org.mockito.listeners", + "org.mockito.mock", + "org.mockito.plugins", + "org.mockito.quality", + "org.mockito.session", + "org.mockito.stubbing", + "org.mockito.verification" + ], + "org.objenesis:objenesis": [ + "org.objenesis", + "org.objenesis.instantiator", + "org.objenesis.instantiator.android", + "org.objenesis.instantiator.annotations", + "org.objenesis.instantiator.basic", + "org.objenesis.instantiator.gcj", + "org.objenesis.instantiator.perc", + "org.objenesis.instantiator.sun", + "org.objenesis.instantiator.util", + "org.objenesis.strategy" + ], + "org.opentest4j:opentest4j": [ + "org.opentest4j" + ], + "org.ow2.asm:asm": [ + "org.objectweb.asm", + "org.objectweb.asm.signature" + ] + }, + "repositories": { + "https://repo1.maven.org/maven2/": [ + "com.google.auto.value:auto-value-annotations", + "com.google.auto.value:auto-value-annotations:jar:sources", + "com.google.code.findbugs:jsr305", + "com.google.code.findbugs:jsr305:jar:sources", + "com.google.code.gson:gson", + "com.google.code.gson:gson:jar:sources", + "com.google.errorprone:error_prone_annotations", + "com.google.errorprone:error_prone_annotations:jar:sources", + "com.google.guava:failureaccess", + "com.google.guava:failureaccess:jar:sources", + "com.google.guava:guava", + "com.google.guava:guava-testlib", + "com.google.guava:guava-testlib:jar:sources", + "com.google.guava:guava:jar:sources", + "com.google.guava:listenablefuture", + "com.google.j2objc:j2objc-annotations", + "com.google.j2objc:j2objc-annotations:jar:sources", + "com.google.truth:truth", + "com.google.truth:truth:jar:sources", + "junit:junit", + "junit:junit:jar:sources", + "net.bytebuddy:byte-buddy", + "net.bytebuddy:byte-buddy-agent", + "net.bytebuddy:byte-buddy-agent:jar:sources", + "net.bytebuddy:byte-buddy:jar:sources", + "org.apiguardian:apiguardian-api", + "org.apiguardian:apiguardian-api:jar:sources", + "org.checkerframework:checker-qual", + "org.checkerframework:checker-qual:jar:sources", + "org.hamcrest:hamcrest-core", + "org.hamcrest:hamcrest-core:jar:sources", + "org.junit.jupiter:junit-jupiter-api", + "org.junit.jupiter:junit-jupiter-api:jar:sources", + "org.junit.jupiter:junit-jupiter-engine", + "org.junit.jupiter:junit-jupiter-engine:jar:sources", + "org.junit.platform:junit-platform-commons", + "org.junit.platform:junit-platform-commons:jar:sources", + "org.junit.platform:junit-platform-engine", + "org.junit.platform:junit-platform-engine:jar:sources", + "org.junit.platform:junit-platform-launcher", + "org.junit.platform:junit-platform-launcher:jar:sources", + "org.junit.platform:junit-platform-reporting", + "org.junit.platform:junit-platform-reporting:jar:sources", + "org.mockito:mockito-core", + "org.mockito:mockito-core:jar:sources", + "org.objenesis:objenesis", + "org.objenesis:objenesis:jar:sources", + "org.opentest4j:opentest4j", + "org.opentest4j:opentest4j:jar:sources", + "org.ow2.asm:asm", + "org.ow2.asm:asm:jar:sources" + ] + }, + "version": "2" +} diff --git a/examples/tests_and_lints/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/tests_and_lints/BUILD.bazel b/examples/tests_and_lints/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/tests_and_lints/BUILD.bazel new file mode 100644 index 00000000..11db5afc --- /dev/null +++ b/examples/tests_and_lints/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/tests_and_lints/BUILD.bazel @@ -0,0 +1,20 @@ +load("@contrib_rules_jvm//java:defs.bzl", "checkstyle_test", "java_junit5_test") +load("@rules_jvm_external//:defs.bzl", "artifact") + +java_junit5_test( + name = "ExampleTest", + srcs = ["ExampleTest.java"], + runtime_deps = [ + artifact("org.junit.jupiter:junit-jupiter-engine"), + ], + deps = [ + artifact("org.junit.jupiter:junit-jupiter-api"), + artifact("org.junit.platform:junit-platform-launcher"), + artifact("org.junit.platform:junit-platform-reporting"), + ], +) + +checkstyle_test( + name = "example_test_checkstyle", + srcs = ["ExampleTest.java"], +) diff --git a/examples/tests_and_lints/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/tests_and_lints/ExampleTest.java b/examples/tests_and_lints/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/tests_and_lints/ExampleTest.java new file mode 100644 index 00000000..e6ff0e3d --- /dev/null +++ b/examples/tests_and_lints/src/test/com/github/bazel_contrib/contrib_rules_jvm/examples/tests_and_lints/ExampleTest.java @@ -0,0 +1,8 @@ +package com.github.bazel_contrib.contrib_rules_jvm.examples.tests_and_lints; + +import org.junit.jupiter.api.Test; + +public class ExampleTest { + @Test + public void passes() {} +}