Skip to content

Commit

Permalink
Mirgate jar dependencies for testing to rules_jvm_external (third_party)
Browse files Browse the repository at this point in the history
Export hamcrest_core

Fix shell tests that uses junit and hamcrest jars

Downgrade mockito-core to 3.12.4 to avoid breaking nullDigestsForArchivedRepresentation_notEqual

Don't upgrade versions unnecessarily

Partial commit for third_party/*, see bazelbuild#17859.

Closes bazelbuild#17859

Signed-off-by: Yun Peng <pcloudy@google.com>
  • Loading branch information
meteorcloudy committed Mar 23, 2023
1 parent 35f2d49 commit a151696
Show file tree
Hide file tree
Showing 22 changed files with 26 additions and 1,760 deletions.
109 changes: 26 additions & 83 deletions third_party/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,6 @@ java_library(
exports = ["@maven//:org_checkerframework_checker_qual"],
)

java_import(
name = "compile_testing",
jars = ["compile_testing/compile-testing-0.18.jar"],
)

java_library(
name = "gson",
exports = ["@maven//:com_google_code_gson_gson"],
Expand Down Expand Up @@ -447,11 +442,6 @@ java_library(
exports = ["@maven//:io_reactivex_rxjava3_rxjava"],
)

java_import(
name = "jimfs",
jars = ["jimfs/jimfs-1.1.jar"],
)

java_library(
name = "jsr305",
exports = ["@maven//:com_google_code_findbugs_jsr305"],
Expand Down Expand Up @@ -574,39 +564,37 @@ java_library(

# Testing

# TODO: Remove this target after migrating to java-diff-utils
java_import(
name = "diffutils",
jars = ["diffutils/diffutils-1.3.0.jar"],
alias(
name = "compile_testing",
actual = "@maven//:com_google_testing_compile_compile_testing",
testonly = 1,
)

java_library(
alias(
name = "guava-testlib",
exports = ["@maven//:com_google_guava_guava_testlib"],
actual = "@maven//:com_google_guava_guava_testlib",
testonly = 1,
)

distrib_java_import(
# Not test_only due to //src/java_tools/junitrunner/java/com/google/testing/junit/junit4:runner
java_library(
name = "junit4",
enable_distributions = ["debian"],
jars = [
"hamcrest/hamcrest-core-1.3.jar",
"junit/junit-4.13.2.jar",
exports = [
"@maven//:junit_junit",
"@maven//:org_hamcrest_hamcrest_core",
],
)

java_import(
name = "mockito",
jars = ["mockito/mockito-core-3.12.4.jar"],
deps = [
":byte_buddy",
":objenesis",
],
alias(
name = "jimfs",
actual = "@maven//:com_google_jimfs_jimfs",
testonly = 1,
)

java_import(
name = "objenesis",
jars = ["objenesis/objenesis-1_3.jar"],
alias(
name = "mockito",
actual = "@maven//:org_mockito_mockito_core",
testonly = 1,
)

filegroup(
Expand All @@ -619,59 +607,14 @@ java_import(
jars = ["turbine/turbine_direct.jar"],
)

java_import(
java_library(
name = "truth",
applicable_licenses = [":truth_license"],
jars = ["truth/truth-1.0.1.jar"],
exports = [
":truth8",
":truth_proto",
],
deps = [
":diffutils",
],
)

license(
name = "truth_license",
package_name = "truth/1.0.1",
license_kinds = [
"@rules_license//licenses/spdx:Apache-2.0",
],
license_text = "truth/LICENSE",
)

java_import(
name = "truth8",
applicable_licenses = [":truth8_license"],
jars = ["truth8/truth-java8-extension-1.0.1.jar"],
)

license(
name = "truth8_license",
package_name = "truth8/1.0.1",
license_kinds = [
"@rules_license//licenses/spdx:Apache-2.0",
],
license_text = "truth8/LICENSE",
)

java_import(
name = "truth_proto",
applicable_licenses = [":truth_proto_license"],
jars = [
"truth_proto/truth-liteproto-extension-1.0.1.jar",
"truth_proto/truth-proto-extension-1.0.1.jar",
"@maven//:com_google_truth_truth",
"@maven//:com_google_truth_extensions_truth_java8_extension",
"@maven//:com_google_truth_extensions_truth_proto_extension",
],
)

license(
name = "truth_proto_license",
package_name = "truth_proto/1.0.1",
license_kinds = [
"@rules_license//licenses/spdx:Apache-2.0",
],
license_text = "truth_proto/LICENSE",
testonly = 1,
)

java_library(
Expand All @@ -693,8 +636,8 @@ license(
filegroup(
name = "junit4-jars",
srcs = [
"hamcrest/hamcrest-core-1.3.jar",
"junit/junit-4.13.2.jar",
"@maven//:junit_junit_file",
"@maven//:org_hamcrest_hamcrest_core_file",
],
)

Expand Down
202 changes: 0 additions & 202 deletions third_party/compile_testing/LICENSE

This file was deleted.

Binary file not shown.
Loading

0 comments on commit a151696

Please sign in to comment.