Skip to content

Commit

Permalink
Switch to using Jar Jar Abrams
Browse files Browse the repository at this point in the history
Jar Jar Links (`jarjar`) is in-sourced to Jar Jar Abrams (https://github.com/eed3si9n/jarjar-abrams)
repository and receieves regular maintenance since it's being used as sbt-assembly.
I think we should switch to using Jar Jar Ambrams CLI:
1. it's an extension of the original jarjar handling Scala signatures and `$`-mangling.
2. it wipes out the Zip entry timestamps to 2010-01-01.

**Note**

The following demonstrtes that the Zip entries for Spring Boot Actuator is 2010'ed out.

```
$ unzip -l bazel-out/darwin_arm64-fastbuild/bin/external/jvm__org_springframework_boot__spring_boot_actuator/spring-boot-actuator-shaded.jar
Archive:  bazel-out/darwin_arm64-fastbuild/bin/external/jvm__org_springframework_boot__spring_boot_actuator/spring-boot-actuator-shaded.jar
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  01-01-2010 00:00   META-INF/
```

I've also added `src/test/bazel:jarjar_test` to test this behavior on CI.

Since Jar Jar Abrams CLI is distributed as an uber JAR, we can also get rid of rules_jvm_external, and just download the JAR from Maven Central.
  • Loading branch information
eed3si9n committed Oct 4, 2023
1 parent a0cc0eb commit 09df189
Show file tree
Hide file tree
Showing 76 changed files with 46 additions and 4,557 deletions.
43 changes: 0 additions & 43 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,3 @@ load(
)

jar_jar_repositories()

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

RULES_JVM_EXTERNAL_TAG = "4.5"

RULES_JVM_EXTERNAL_SHA = "b17d7388feb9bfa7f2fa09031b32707df529f26c91ab9e5d909eb1676badd9a6"

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/refs/tags/%s.zip" % RULES_JVM_EXTERNAL_TAG,
)

load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")

rules_jvm_external_deps()

load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup")

rules_jvm_external_setup()

load("@rules_jvm_external//:defs.bzl", "maven_install")

maven_install(
artifacts = [
"junit:junit:4.13",
"org.apache.commons:commons-lang3:3.11",
"org.hamcrest:hamcrest-core:1.3",
"org.openjdk.jmh:jmh-core:1.34",
"org.openjdk.jmh:jmh-generator-annprocess:1.34",
],
fail_if_repin_required = True,
maven_install_json = "@//:maven_install.json",
repositories = [
"https://maven.google.com",
"https://repo1.maven.org/maven2",
],
)

load("@maven//:defs.bzl", "pinned_maven_install")

pinned_maven_install()
12 changes: 6 additions & 6 deletions jar_jar.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ def _http_jar_with_servers(name, path, sha256, servers):

def jar_jar_repositories(servers=["https://repo1.maven.org/maven2"]):
_http_jar_with_servers(
name = "bazel_jar_jar_asm",
path = "/org/ow2/asm/asm/9.4/asm-9.4.jar",
sha256 = "39d0e2b3dc45af65a09b097945750a94a126e052e124f93468443a1d0e15f381",
name = "jvm__jarjar_abrams_assembly",
path = "/com/eed3si9n/jarjarabrams/jarjar-abrams-assembly_2.12/1.10.0/jarjar-abrams-assembly_2.12-1.10.0.jar",
sha256 = "d380361374e4a367e2e7f322b4c56c825c15b29f3567ee67bc9d6c07c5bb97ba",
servers = servers,
)
_http_jar_with_servers(
name = "bazel_jar_jar_asm_commons",
path = "/org/ow2/asm/asm-commons/9.4/asm-commons-9.4.jar",
sha256 = "0c128a9ec3f33c98959272f6d16cf14247b508f58951574bcdbd2b56d6326364",
name = "jvm__com_twitter__scalding_args",
path = "/com/twitter/scalding-args_2.12/0.17.4/scalding-args_2.12-0.17.4.jar",
sha256 = "e0de2ad8ef344bb11a2854275b5b85a1adb17f0e0ed9740177d940a602cd977b",
servers = servers,
)
256 changes: 0 additions & 256 deletions maven_install.json

This file was deleted.

30 changes: 0 additions & 30 deletions src/jmh/java/com/github/johnynek/jarjar/BUILD.bazel

This file was deleted.

40 changes: 0 additions & 40 deletions src/jmh/java/com/github/johnynek/jarjar/JarJarBenchmark.java

This file was deleted.

1 change: 0 additions & 1 deletion src/jmh/java/com/github/johnynek/jarjar/junit.jarjar

This file was deleted.

Loading

0 comments on commit 09df189

Please # to comment.