From bc1fbcad2d54017bf2cb5e98087a1ea98dd6f054 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Fri, 1 Apr 2022 08:38:18 -0500 Subject: [PATCH 01/12] WIP commit of the three attempts so far This latest attempt nearly works except I still can't get protobuf to stop being counted as a non-maven jar. --- BUILD.bazel | 43 +++++++++++++++-- WORKSPACE.bazel | 64 +++++++++++++++++++++++++ maven/closure-compiler-unshaded.pom.xml | 3 ++ 3 files changed, 107 insertions(+), 3 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 669ad29ea53..09ea17b793d 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -126,7 +126,44 @@ filegroup( ), ) -java_binary( +#attempt 3 +load("@rules_jvm_external//:defs.bzl", "java_export") +java_export( + name = "exported_compiler_unshaded", + maven_coordinates = "com.google.javascript:closure-compiler-unshaded:v20220401", + runtime_deps = [ + "//:compiler_lib", + ], +) + +#attempt 2 +#load("@vaticle_bazel_distribution//maven:rules.bzl","assemble_maven") +#assemble_maven( +# name = "compiler_unshaded_maven", +# target = '//:compiler_lib' +#) + +#attempt 1 +#load("@google_bazel_common//tools/maven:pom_file.bzl", "pom_file") +#pom_file( +# name = 'compiler_unshaded_pom', +# template_file = 'maven/closure-compiler-unshaded.pom.xml', +# targets = [ +# '//:compiler_lib' +# ], +#) + + +# need a magic bazel rule that combines the following into a single jar for deployment to maven central +# //:compiler_lib for the "runtime libs", apparently js and typedast contents +# //:compiler_lib_no_runtime_libs for most of the sources +# then, from compiler_lib_no_runtime_libs, we need these deps (but no others, as they are external): +# "//src/com/google/debugging/sourcemap/proto:mapping_java_proto", +# "//src/com/google/javascript/jscomp/conformance:conformance_java_proto", +# "//src/com/google/javascript/jscomp/instrumentation/reporter/proto:profile_java_proto", +# "//src/com/google/javascript/rhino/typed_ast:typed_ast_java_proto", + +java_binary(# also a lie, as this is a java_binary, the _deploy.jar contains all deps name = "compiler_unshaded_no_runtime_libs", main_class = "com.google.javascript.jscomp.CommandLineRunner", runtime_deps = [":compiler_lib_no_runtime_libs"], @@ -171,7 +208,7 @@ oss_java_library( "@com_google_code_gson_gson", "@com_google_guava_failureaccess//jar", "@com_google_guava_guava//jar", - "@com_google_protobuf//:protobuf_java", + "@maven//:com_google_protobuf_protobuf_java", "@com_google_re2j_re2j", "@google_bazel_common//third_party/java/auto:value", "@google_bazel_common//third_party/java/error_prone:annotations", @@ -236,7 +273,7 @@ gen_java_tests( "@com_google_guava_guava//jar", "@com_google_guava_guava_testlib//jar", "@com_google_jimfs_jimfs", - "@com_google_protobuf//:protobuf_java", + "@maven//:com_google_protobuf_protobuf_java", "@com_google_re2j_re2j", "@com_google_truth_extensions_truth_liteproto_extension", "@com_google_truth_extensions_truth_proto_extension", diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index ad157f5cc88..c796ed56009 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -33,6 +33,55 @@ load("@google_bazel_common//:workspace_defs.bzl", "google_common_workspace_rules google_common_workspace_rules() +# attempt 3 +RULES_JVM_EXTERNAL_TAG = "4.2" +RULES_JVM_EXTERNAL_SHA = "cd1a77b7b02e8e008439ca76fd34f5b07aecb8c752961f9640dea15e9e5ba1ca" + +http_archive( + name = "rules_jvm_external", + strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG, + sha256 = RULES_JVM_EXTERNAL_SHA, + url = "https://github.com/bazelbuild/rules_jvm_external/archive/%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() + +# attempt 2 +#http_archive( +# name = "vaticle_bazel_distribution", +# sha256 = "aa9da4875d679b4fda680d13845d505b3033ec746b238fee5868c52f69929cba", +# strip_prefix = "bazel-distribution-8eb8a0e920d43bf2d3100e22e7e36dc29009bac5", +# urls = [ +# "https://github.com/vaticle/bazel-distribution/archive/8eb8a0e920d43bf2d3100e22e7e36dc29009bac5.zip", +# ], +#) +# +#load("@vaticle_bazel_distribution//common:deps.bzl","rules_kotlin", "rules_jvm_external") +#rules_kotlin() +#rules_jvm_external() +# +#load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories", "kt_register_toolchains") +#kotlin_repositories() +#kt_register_toolchains() +# +#load("@vaticle_bazel_distribution//maven:deps.bzl", "maven_artifacts_with_versions") +#load("@rules_jvm_external//:defs.bzl", "maven_install") +#maven_install( +# artifacts = maven_artifacts_with_versions, +# repositories = [ +# "https://repo1.maven.org/maven2", +# ], +# strict_visibility = True, +# version_conflict_policy = "pinned", +# fetch_sources = True, +#) + maven_import( # http://args4j.kohsuke.org/index.html group_id = "args4j", @@ -147,3 +196,18 @@ http_archive( load("@com_github_johnynek_bazel_jar_jar//:jar_jar.bzl", "jar_jar_repositories") jar_jar_repositories() + +load("@rules_jvm_external//:defs.bzl", "maven_install") +maven_install( + artifacts = [ + "com.google.protobuf:protobuf-java:3.19.2", + "com.google.protobuf:protobuf-java-util:3.19.2", + ], + override_targets = { + "com.google.protobuf:protobuf-java": "@com_google_protobuf//:protobuf_java", + }, + repositories = [ + "https://repo1.maven.org/maven2", + ], + strict_visibility = True, +) \ No newline at end of file diff --git a/maven/closure-compiler-unshaded.pom.xml b/maven/closure-compiler-unshaded.pom.xml index 84b5fdb3cf1..a2513fb11c3 100644 --- a/maven/closure-compiler-unshaded.pom.xml +++ b/maven/closure-compiler-unshaded.pom.xml @@ -43,4 +43,7 @@ 1.0-SNAPSHOT closure-compiler-main.pom.xml + + {generated_bzl_deps} + From 1f5df27ac0eb0e16d5111ea70d8ac49ce28dc594 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Wed, 6 Apr 2022 17:04:22 -0500 Subject: [PATCH 02/12] Tidy up to consider the diff's progress --- BUILD.bazel | 53 ++++++++++++------------------------------------- WORKSPACE.bazel | 37 ++-------------------------------- 2 files changed, 15 insertions(+), 75 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 09ea17b793d..9471c4b5ec3 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -44,7 +44,7 @@ sonatype_artifact_bundle( sonatype_artifact_bundle( name = "compiler_unshaded_bundle", artifact_id = "closure-compiler-unshaded", - jar = ":compiler_unshaded_deploy.jar", + jar = ":compiler_unshaded", javadoc = ":compiler_lib_no_runtime_libs.javadoc", pom = "maven/closure-compiler-unshaded.pom.xml", sources = ":compiler_lib_no_runtime_libs.sources", @@ -71,16 +71,26 @@ sonatype_artifact_bundle( jar_jar( name = "compiler_shaded", - input_jar = ":compiler_unshaded_deploy.jar", + input_jar = ":compiler_uberjar_deploy.jar", rules = "rules.jarjar", ) java_binary( - name = "compiler_unshaded", + name = "compiler_uberjar", main_class = "com.google.javascript.jscomp.CommandLineRunner", runtime_deps = [":compiler_lib"], ) +# Produce an unshaded export jar based on :compiler_lib +load("@rules_jvm_external//:defs.bzl", "java_export") +java_export( + name = "compiler_unshaded", + maven_coordinates = "com.google.javascript:closure-compiler-unshaded:v20220401", + runtime_deps = [ + "//:compiler_lib", + ], +) + java_binary( name = "linter", main_class = "com.google.javascript.jscomp.LinterMain", @@ -126,43 +136,6 @@ filegroup( ), ) -#attempt 3 -load("@rules_jvm_external//:defs.bzl", "java_export") -java_export( - name = "exported_compiler_unshaded", - maven_coordinates = "com.google.javascript:closure-compiler-unshaded:v20220401", - runtime_deps = [ - "//:compiler_lib", - ], -) - -#attempt 2 -#load("@vaticle_bazel_distribution//maven:rules.bzl","assemble_maven") -#assemble_maven( -# name = "compiler_unshaded_maven", -# target = '//:compiler_lib' -#) - -#attempt 1 -#load("@google_bazel_common//tools/maven:pom_file.bzl", "pom_file") -#pom_file( -# name = 'compiler_unshaded_pom', -# template_file = 'maven/closure-compiler-unshaded.pom.xml', -# targets = [ -# '//:compiler_lib' -# ], -#) - - -# need a magic bazel rule that combines the following into a single jar for deployment to maven central -# //:compiler_lib for the "runtime libs", apparently js and typedast contents -# //:compiler_lib_no_runtime_libs for most of the sources -# then, from compiler_lib_no_runtime_libs, we need these deps (but no others, as they are external): -# "//src/com/google/debugging/sourcemap/proto:mapping_java_proto", -# "//src/com/google/javascript/jscomp/conformance:conformance_java_proto", -# "//src/com/google/javascript/jscomp/instrumentation/reporter/proto:profile_java_proto", -# "//src/com/google/javascript/rhino/typed_ast:typed_ast_java_proto", - java_binary(# also a lie, as this is a java_binary, the _deploy.jar contains all deps name = "compiler_unshaded_no_runtime_libs", main_class = "com.google.javascript.jscomp.CommandLineRunner", diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index c796ed56009..274e6622b6c 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -33,7 +33,7 @@ load("@google_bazel_common//:workspace_defs.bzl", "google_common_workspace_rules google_common_workspace_rules() -# attempt 3 +# Use rules_jvm_external to facilitate publishing unshaded maven artifacts RULES_JVM_EXTERNAL_TAG = "4.2" RULES_JVM_EXTERNAL_SHA = "cd1a77b7b02e8e008439ca76fd34f5b07aecb8c752961f9640dea15e9e5ba1ca" @@ -45,42 +45,11 @@ http_archive( ) 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() -# attempt 2 -#http_archive( -# name = "vaticle_bazel_distribution", -# sha256 = "aa9da4875d679b4fda680d13845d505b3033ec746b238fee5868c52f69929cba", -# strip_prefix = "bazel-distribution-8eb8a0e920d43bf2d3100e22e7e36dc29009bac5", -# urls = [ -# "https://github.com/vaticle/bazel-distribution/archive/8eb8a0e920d43bf2d3100e22e7e36dc29009bac5.zip", -# ], -#) -# -#load("@vaticle_bazel_distribution//common:deps.bzl","rules_kotlin", "rules_jvm_external") -#rules_kotlin() -#rules_jvm_external() -# -#load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories", "kt_register_toolchains") -#kotlin_repositories() -#kt_register_toolchains() -# -#load("@vaticle_bazel_distribution//maven:deps.bzl", "maven_artifacts_with_versions") -#load("@rules_jvm_external//:defs.bzl", "maven_install") -#maven_install( -# artifacts = maven_artifacts_with_versions, -# repositories = [ -# "https://repo1.maven.org/maven2", -# ], -# strict_visibility = True, -# version_conflict_policy = "pinned", -# fetch_sources = True, -#) maven_import( # http://args4j.kohsuke.org/index.html @@ -197,15 +166,13 @@ load("@com_github_johnynek_bazel_jar_jar//:jar_jar.bzl", "jar_jar_repositories") jar_jar_repositories() +# Declare protobuf-java from maven central, so the unshaded maven jar can recognize external dependencies load("@rules_jvm_external//:defs.bzl", "maven_install") maven_install( artifacts = [ "com.google.protobuf:protobuf-java:3.19.2", "com.google.protobuf:protobuf-java-util:3.19.2", ], - override_targets = { - "com.google.protobuf:protobuf-java": "@com_google_protobuf//:protobuf_java", - }, repositories = [ "https://repo1.maven.org/maven2", ], From 80ee6fb7980a79a1211eec48a9f3ef372d78ea6e Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Wed, 6 Apr 2022 17:12:50 -0500 Subject: [PATCH 03/12] Also emit a workable pom --- BUILD.bazel | 3 ++- ...-unshaded.pom.xml => closure-compiler-unshaded.pom.xml.tpl} | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) rename maven/{closure-compiler-unshaded.pom.xml => closure-compiler-unshaded.pom.xml.tpl} (98%) diff --git a/BUILD.bazel b/BUILD.bazel index 9471c4b5ec3..f254a879ffe 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -46,7 +46,7 @@ sonatype_artifact_bundle( artifact_id = "closure-compiler-unshaded", jar = ":compiler_unshaded", javadoc = ":compiler_lib_no_runtime_libs.javadoc", - pom = "maven/closure-compiler-unshaded.pom.xml", + pom = ":compiler_unshaded-pom", sources = ":compiler_lib_no_runtime_libs.sources", ) @@ -89,6 +89,7 @@ java_export( runtime_deps = [ "//:compiler_lib", ], + pom_template = "maven/closure-compiler-unshaded.pom.xml.tpl" ) java_binary( diff --git a/maven/closure-compiler-unshaded.pom.xml b/maven/closure-compiler-unshaded.pom.xml.tpl similarity index 98% rename from maven/closure-compiler-unshaded.pom.xml rename to maven/closure-compiler-unshaded.pom.xml.tpl index a2513fb11c3..51f3b62039c 100644 --- a/maven/closure-compiler-unshaded.pom.xml +++ b/maven/closure-compiler-unshaded.pom.xml.tpl @@ -44,6 +44,6 @@ closure-compiler-main.pom.xml - {generated_bzl_deps} +{dependencies} From fbed55d697208f50d5aba86e89cba26d43534e7b Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Thu, 7 Apr 2022 10:12:20 -0500 Subject: [PATCH 04/12] Remove unnecessary duplication from following the readme... --- BUILD.bazel | 2 +- WORKSPACE.bazel | 22 ++-------------------- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index f254a879ffe..d40f032d624 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -85,7 +85,7 @@ java_binary( load("@rules_jvm_external//:defs.bzl", "java_export") java_export( name = "compiler_unshaded", - maven_coordinates = "com.google.javascript:closure-compiler-unshaded:v20220401", + maven_coordinates = "com.google.javascript:closure-compiler-unshaded:HEAD-SNAPSHOT", runtime_deps = [ "//:compiler_lib", ], diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index 274e6622b6c..6564c574254 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -33,24 +33,6 @@ load("@google_bazel_common//:workspace_defs.bzl", "google_common_workspace_rules google_common_workspace_rules() -# Use rules_jvm_external to facilitate publishing unshaded maven artifacts -RULES_JVM_EXTERNAL_TAG = "4.2" -RULES_JVM_EXTERNAL_SHA = "cd1a77b7b02e8e008439ca76fd34f5b07aecb8c752961f9640dea15e9e5ba1ca" - -http_archive( - name = "rules_jvm_external", - strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG, - sha256 = RULES_JVM_EXTERNAL_SHA, - url = "https://github.com/bazelbuild/rules_jvm_external/archive/%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() - - maven_import( # http://args4j.kohsuke.org/index.html group_id = "args4j", @@ -170,8 +152,8 @@ jar_jar_repositories() load("@rules_jvm_external//:defs.bzl", "maven_install") maven_install( artifacts = [ - "com.google.protobuf:protobuf-java:3.19.2", - "com.google.protobuf:protobuf-java-util:3.19.2", + "com.google.protobuf:protobuf-java:3.19.3", + "com.google.protobuf:protobuf-java-util:3.19.3", ], repositories = [ "https://repo1.maven.org/maven2", From a2714b79fa2ab27f8f97b71204d259b754babb10 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Thu, 14 Apr 2022 13:53:31 -0500 Subject: [PATCH 05/12] Using the same pattern as when building the bundle to set the version --- BUILD.bazel | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BUILD.bazel b/BUILD.bazel index d40f032d624..526620bc52c 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -83,9 +83,10 @@ java_binary( # Produce an unshaded export jar based on :compiler_lib load("@rules_jvm_external//:defs.bzl", "java_export") +version = ctx.var.get("COMPILER_VERSION", "1.0-SNAPSHOT") java_export( name = "compiler_unshaded", - maven_coordinates = "com.google.javascript:closure-compiler-unshaded:HEAD-SNAPSHOT", + maven_coordinates = "com.google.javascript:closure-compiler-unshaded:{0}".format(version), runtime_deps = [ "//:compiler_lib", ], From 909874859167854b0a8586adf2aaf51707c7a541 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Thu, 14 Apr 2022 13:53:31 -0500 Subject: [PATCH 06/12] Using the same pattern as when building the bundle to set the version --- BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD.bazel b/BUILD.bazel index 526620bc52c..9ae1dd2cfc8 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -83,7 +83,7 @@ java_binary( # Produce an unshaded export jar based on :compiler_lib load("@rules_jvm_external//:defs.bzl", "java_export") -version = ctx.var.get("COMPILER_VERSION", "1.0-SNAPSHOT") +version = "$(COMPILER_VERSION)" or "1.0-SNAPSHOT" java_export( name = "compiler_unshaded", maven_coordinates = "com.google.javascript:closure-compiler-unshaded:{0}".format(version), From 7900eb3f57fcbae3288327acdd34ecd755b085fe Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Thu, 14 Apr 2022 14:40:05 -0500 Subject: [PATCH 07/12] Remove annotation added while reading how the build works --- BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD.bazel b/BUILD.bazel index 9ae1dd2cfc8..ae3daae4f11 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -138,7 +138,7 @@ filegroup( ), ) -java_binary(# also a lie, as this is a java_binary, the _deploy.jar contains all deps +java_binary( name = "compiler_unshaded_no_runtime_libs", main_class = "com.google.javascript.jscomp.CommandLineRunner", runtime_deps = [":compiler_lib_no_runtime_libs"], From feec374fff8b3df3ad388381252283d7958f4ef6 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Thu, 14 Apr 2022 14:41:13 -0500 Subject: [PATCH 08/12] Remove apparently unneeded dependency --- WORKSPACE.bazel | 1 - 1 file changed, 1 deletion(-) diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index 6564c574254..aad86bc9591 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -153,7 +153,6 @@ load("@rules_jvm_external//:defs.bzl", "maven_install") maven_install( artifacts = [ "com.google.protobuf:protobuf-java:3.19.3", - "com.google.protobuf:protobuf-java-util:3.19.3", ], repositories = [ "https://repo1.maven.org/maven2", From 5904345040f5ef7b398f8246a985b462214fa670 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Thu, 14 Apr 2022 14:43:42 -0500 Subject: [PATCH 09/12] Add missing setup so bazel build //... works --- WORKSPACE.bazel | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index aad86bc9591..beddc0bc149 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -12,6 +12,12 @@ http_archive( url = "https://github.com/bazelbuild/rules_jvm_external/archive/%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() + # # To update google_bazel_common, locate the git commit to depend on and # use something like the following to determine the sha256 From 87e48ab1271567a2c70a0da0b463010655bc7786 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Thu, 14 Apr 2022 14:51:07 -0500 Subject: [PATCH 10/12] trailing newline --- WORKSPACE.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index beddc0bc149..ac77c55634f 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -164,4 +164,4 @@ maven_install( "https://repo1.maven.org/maven2", ], strict_visibility = True, -) \ No newline at end of file +) From 188c83a072d877ef4033a2838c10d467e014134f Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Thu, 14 Apr 2022 15:20:30 -0500 Subject: [PATCH 11/12] Update references to "compiler_unshaded" that almost certainly want shaded --- .github/ci_support/test_closure-compiler-npm.sh | 2 +- .github/workflows/ci.yaml | 6 +++--- README.md | 4 ++-- package.json | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/ci_support/test_closure-compiler-npm.sh b/.github/ci_support/test_closure-compiler-npm.sh index d4dbcc75346..6cdde1ba681 100755 --- a/.github/ci_support/test_closure-compiler-npm.sh +++ b/.github/ci_support/test_closure-compiler-npm.sh @@ -20,7 +20,7 @@ # - PWD = closure-compiler-npm repo root # # Params: -# 1. File name of compiler_unshaded_deploy.jar +# 1. File name of compiler_shaded.jar function main() { local compiler_jar="$1" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1869fd28e06..1557fcdab8e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -59,7 +59,7 @@ jobs: # upload-artifact doesn't support paths with symlinks run: | mkdir -p ${{ env.UNSYMLINK_DIR }} - cp -t ${{ env.UNSYMLINK_DIR }} bazel-bin/compiler_unshaded_deploy.jar + cp -t ${{ env.UNSYMLINK_DIR }} bazel-bin/compiler_shaded.jar cp -t ${{ env.UNSYMLINK_DIR }} bazel-bin/*_bundle.jar # Share the following files with other jobs in this workflow. They can be grabbed using ID @@ -70,7 +70,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: unshaded_compiler - path: ${{ env.UNSYMLINK_DIR }}/compiler_unshaded_deploy.jar + path: ${{ env.UNSYMLINK_DIR }}/compiler_shaded.jar if-no-files-found: error # If this build will be uploadaded as a SNAPSHOT, share the Sonatype bundles with the other @@ -124,7 +124,7 @@ jobs: path: compiler/bazel-bin - name: Test closure-compiler-npm - run: compiler/.github/ci_support/test_closure-compiler-npm.sh compiler/bazel-bin/compiler_unshaded_deploy.jar + run: compiler/.github/ci_support/test_closure-compiler-npm.sh compiler/bazel-bin/compiler_shaded.jar deploy-snapshots: name: Deploy Snapshot Bundles to Sonatype diff --git a/README.md b/README.md index d93ad860915..73cc07e65e0 100644 --- a/README.md +++ b/README.md @@ -235,7 +235,7 @@ You can trigger the build process easily with package.json scripts or by calling Bazel manually. ```bash -# bazelisk build //:compiler_unshaded_deploy.jar +# bazelisk build //:compiler_shaded.jar yarn build # bazelisk build :all @@ -270,7 +270,7 @@ directory. You can access it with a call to `java -jar ...` or by using the package.json script: ```bash -# java -jar bazel-bin/compiler_unshaded_deploy.jar [...args] +# java -jar bazel-bin/compiler_shaded.jar [...args] yarn compile [...args] ``` diff --git a/package.json b/package.json index 607c6bc5e4f..04e2e19366f 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "build": "clean && mvn -DskipTests", "build:fast": "mvn -DskipTests -pl externs/pom.xml,pom-main.xml,pom-main-shaded.xml", "clean": "yarn runtime_tests:clean && mvn clean", - "compile": "java -jar bazel-bin/compiler_unshaded_deploy.jar", + "compile": "java -jar bazel-bin/compiler_shaded.jar", "runtime_tests:build": "$npm_package_config_runtime_tests_dir/utils/build.sh", "runtime_tests:clean": "rm -rf $npm_package_config_runtime_tests_dir/**/build/*", "runtime_tests:run": "jest --testRegex $npm_package_config_runtime_tests_dir/utils/test/* --verbose=true", From 97e6a4d9032f91c9245c4bc6f3c89f33f483e324 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Thu, 5 May 2022 14:56:15 -0500 Subject: [PATCH 12/12] Trying my proposed fix, absent any feedback --- .github/ci_support/test_closure-compiler-npm.sh | 2 +- .github/workflows/ci.yaml | 6 +++--- README.md | 4 ++-- package.json | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/ci_support/test_closure-compiler-npm.sh b/.github/ci_support/test_closure-compiler-npm.sh index 6cdde1ba681..dfc93cc2740 100755 --- a/.github/ci_support/test_closure-compiler-npm.sh +++ b/.github/ci_support/test_closure-compiler-npm.sh @@ -20,7 +20,7 @@ # - PWD = closure-compiler-npm repo root # # Params: -# 1. File name of compiler_shaded.jar +# 1. File name of compiler_uberjar_deploy.jar function main() { local compiler_jar="$1" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1557fcdab8e..3300332920b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -59,7 +59,7 @@ jobs: # upload-artifact doesn't support paths with symlinks run: | mkdir -p ${{ env.UNSYMLINK_DIR }} - cp -t ${{ env.UNSYMLINK_DIR }} bazel-bin/compiler_shaded.jar + cp -t ${{ env.UNSYMLINK_DIR }} bazel-bin/compiler_uberjar_deploy.jar cp -t ${{ env.UNSYMLINK_DIR }} bazel-bin/*_bundle.jar # Share the following files with other jobs in this workflow. They can be grabbed using ID @@ -70,7 +70,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: unshaded_compiler - path: ${{ env.UNSYMLINK_DIR }}/compiler_shaded.jar + path: ${{ env.UNSYMLINK_DIR }}/compiler_uberjar_deploy.jar if-no-files-found: error # If this build will be uploadaded as a SNAPSHOT, share the Sonatype bundles with the other @@ -124,7 +124,7 @@ jobs: path: compiler/bazel-bin - name: Test closure-compiler-npm - run: compiler/.github/ci_support/test_closure-compiler-npm.sh compiler/bazel-bin/compiler_shaded.jar + run: compiler/.github/ci_support/test_closure-compiler-npm.sh compiler/bazel-bin/compiler_uberjar_deploy.jar deploy-snapshots: name: Deploy Snapshot Bundles to Sonatype diff --git a/README.md b/README.md index 73cc07e65e0..051a1e8383a 100644 --- a/README.md +++ b/README.md @@ -235,7 +235,7 @@ You can trigger the build process easily with package.json scripts or by calling Bazel manually. ```bash -# bazelisk build //:compiler_shaded.jar +# bazelisk build //:compiler_uberjar_deploy.jar yarn build # bazelisk build :all @@ -270,7 +270,7 @@ directory. You can access it with a call to `java -jar ...` or by using the package.json script: ```bash -# java -jar bazel-bin/compiler_shaded.jar [...args] +# java -jar bazel-bin/compiler_uberjar_deploy.jar [...args] yarn compile [...args] ``` diff --git a/package.json b/package.json index 04e2e19366f..d763def033e 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "build": "clean && mvn -DskipTests", "build:fast": "mvn -DskipTests -pl externs/pom.xml,pom-main.xml,pom-main-shaded.xml", "clean": "yarn runtime_tests:clean && mvn clean", - "compile": "java -jar bazel-bin/compiler_shaded.jar", + "compile": "java -jar bazel-bin/compiler_uberjar_deploy.jar", "runtime_tests:build": "$npm_package_config_runtime_tests_dir/utils/build.sh", "runtime_tests:clean": "rm -rf $npm_package_config_runtime_tests_dir/**/build/*", "runtime_tests:run": "jest --testRegex $npm_package_config_runtime_tests_dir/utils/test/* --verbose=true",