From be530627783b8e62d72ab3dffe42760082accb21 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Mon, 16 Oct 2017 15:35:00 -0500 Subject: [PATCH 01/17] Custom groupId, so we can deploy our fork separately. --- maven/closure-compiler-externs.pom.xml | 4 ++-- maven/closure-compiler-main.pom.xml | 4 ++-- maven/closure-compiler-parent.pom.xml | 2 +- maven/closure-compiler-unshaded.pom.xml | 4 ++-- maven/closure-compiler.pom.xml | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/maven/closure-compiler-externs.pom.xml b/maven/closure-compiler-externs.pom.xml index 9c9c062368a..a9c35590f67 100644 --- a/maven/closure-compiler-externs.pom.xml +++ b/maven/closure-compiler-externs.pom.xml @@ -19,7 +19,7 @@ > 4.0.0 - com.google.javascript + com.vertispan.javascript closure-compiler-externs jar @@ -27,7 +27,7 @@ 1.0-SNAPSHOT - com.google.javascript + com.vertispan.javascript closure-compiler-parent 1.0-SNAPSHOT closure-compiler-parent.pom.xml diff --git a/maven/closure-compiler-main.pom.xml b/maven/closure-compiler-main.pom.xml index a685a4cb3b8..f3ea9761a18 100644 --- a/maven/closure-compiler-main.pom.xml +++ b/maven/closure-compiler-main.pom.xml @@ -19,7 +19,7 @@ > 4.0.0 - com.google.javascript + com.vertispan.javascript closure-compiler-main pom @@ -38,7 +38,7 @@ 2009 - com.google.javascript + com.vertispan.javascript closure-compiler-parent 1.0-SNAPSHOT closure-compiler-parent.pom.xml diff --git a/maven/closure-compiler-parent.pom.xml b/maven/closure-compiler-parent.pom.xml index 3e7bf54b6a4..6fce0a63a20 100644 --- a/maven/closure-compiler-parent.pom.xml +++ b/maven/closure-compiler-parent.pom.xml @@ -18,7 +18,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" > 4.0.0 - com.google.javascript + com.vertispan.javascript closure-compiler-parent pom diff --git a/maven/closure-compiler-unshaded.pom.xml b/maven/closure-compiler-unshaded.pom.xml index 84b5fdb3cf1..57e0981a324 100644 --- a/maven/closure-compiler-unshaded.pom.xml +++ b/maven/closure-compiler-unshaded.pom.xml @@ -19,7 +19,7 @@ > 4.0.0 - com.google.javascript + com.vertispan.javascript closure-compiler-unshaded jar @@ -38,7 +38,7 @@ 2009 - com.google.javascript + com.vertispan.javascript closure-compiler-main 1.0-SNAPSHOT closure-compiler-main.pom.xml diff --git a/maven/closure-compiler.pom.xml b/maven/closure-compiler.pom.xml index 00fd1057d77..a0fa709c1fc 100644 --- a/maven/closure-compiler.pom.xml +++ b/maven/closure-compiler.pom.xml @@ -19,7 +19,7 @@ > 4.0.0 - com.google.javascript + com.vertispan.javascript closure-compiler jar @@ -38,7 +38,7 @@ 2009 - com.google.javascript + com.vertispan.javascript closure-compiler-main 1.0-SNAPSHOT closure-compiler-main.pom.xml From 2ceb662d3386d9505eba88a29a1e2d15eac8502b Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Fri, 14 Jun 2019 21:09:50 -0500 Subject: [PATCH 02/17] At the top of every bundle, print all defines, if any --- .../jscomp/AbstractCommandLineRunner.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java b/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java index 8f0ab2c012e..dc8c8812006 100644 --- a/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java +++ b/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java @@ -49,6 +49,7 @@ import com.google.javascript.jscomp.deps.SourceCodeEscapers; import com.google.javascript.jscomp.ijs.IjsErrors; import com.google.javascript.jscomp.parsing.Config; +import com.google.javascript.rhino.IR; import com.google.javascript.rhino.Node; import com.google.javascript.rhino.StaticSourceFile.SourceKind; import com.google.javascript.rhino.TokenStream; @@ -77,6 +78,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Set; import java.util.logging.Level; import java.util.zip.ZipEntry; @@ -2396,6 +2398,18 @@ void printBundleTo(JSChunk module, Appendable out) throws IOException { } } + // First, print all defines passed in + Set> defines = compiler.getOptions().getDefineReplacements().entrySet(); + if (!defines.isEmpty()) { + Node[] defineNodes = defines.stream() + .map((entry) -> IR.propdef(IR.stringKey(entry.getKey()), entry.getValue())) + .toArray(Node[]::new); + + Node wrapper = IR.objectlit(defineNodes); + Node assign = IR.assign(IR.getprop(IR.thisNode(), "CLOSURE_UNCOMPILED_DEFINES"), wrapper); + out.append(new CodePrinter.Builder(assign).setPrettyPrint(true).build()); + } + for (CompilerInput input : inputs) { String name = input.getName(); String code = input.getSourceFile().getCode(); From 6aa0173bde9a7436fd743bd2ce175ce3825f7dc1 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Fri, 14 Jun 2019 21:03:12 -0500 Subject: [PATCH 03/17] Build bundle source as string, with relative path from bundle file so sourcemaps work. Sort of. --- .../jscomp/AbstractCommandLineRunner.java | 23 +++++++++++-------- .../javascript/jscomp/CommandLineRunner.java | 15 ++++++++++-- .../jscomp/CommandLineRunnerTest.java | 4 ++-- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java b/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java index dc8c8812006..8a80603aca2 100644 --- a/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java +++ b/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java @@ -287,7 +287,7 @@ protected CommandLineConfig getCommandLineConfig() { */ @GwtIncompatible("Unnecessary") protected abstract void prepForBundleAndAppendTo( - Appendable out, CompilerInput input, String content) throws IOException; + Appendable out, CompilerInput input, String content, String outputPath) throws IOException; /** Writes whatever runtime libraries are needed to bundle. */ @GwtIncompatible("Unnecessary") @@ -1646,6 +1646,7 @@ int processResults(Result result, List modules, B options) throws IOExc outputManifest(); outputBundle(); outputModuleGraphJson(); + outputSourceMap(options, config.jsOutputFile); return 0; } else if (options.outputJs != OutputJs.NONE && result.success) { outputModuleGraphJson(); @@ -2274,17 +2275,19 @@ private void outputManifestOrBundle(List outputFiles, boolean isManifest // Generate per-module manifests or bundles. Iterable modules = compiler.getModuleGraph().getAllChunks(); for (JSChunk module : modules) { - try (Writer out = fileNameToOutputWriter2(expandCommandLinePath(output, module))) { + String outputPath = expandCommandLinePath(output, module); + try (Writer out = fileNameToOutputWriter2(outputPath)) { if (isManifest) { printManifestTo(module, out); } else { - printBundleTo(module, out); + printBundleTo(module, out, outputPath); } } } } else { // Generate a single file manifest or bundle. - try (Writer out = fileNameToOutputWriter2(expandCommandLinePath(output, null))) { + String outputPath = expandCommandLinePath(output, null); + try (Writer out = fileNameToOutputWriter2(outputPath)) { if (config.module.isEmpty()) { // For a single-module compilation, generate a single headerless manifest or bundle // containing only the strong files. @@ -2292,11 +2295,11 @@ private void outputManifestOrBundle(List outputFiles, boolean isManifest if (isManifest) { printManifestTo(module, out); } else { - printBundleTo(module, out); + printBundleTo(module, out, outputPath); } } else { // For a multi-module compilation, generate a single manifest file with module headers. - printModuleGraphManifestOrBundleTo(compiler.getModuleGraph(), out, isManifest); + printModuleGraphManifestOrBundleTo(compiler.getModuleGraph(), out, isManifest, outputPath); } } } @@ -2323,7 +2326,7 @@ void printModuleGraphJsonTo(Appendable out) throws IOException { /** Prints a set of modules to the manifest or bundle file. */ @VisibleForTesting @GwtIncompatible("Unnecessary") - void printModuleGraphManifestOrBundleTo(JSChunkGraph graph, Appendable out, boolean isManifest) + void printModuleGraphManifestOrBundleTo(JSChunkGraph graph, Appendable out, boolean isManifest, String outputPath) throws IOException { Joiner commas = Joiner.on(","); boolean requiresNewline = false; @@ -2346,7 +2349,7 @@ void printModuleGraphManifestOrBundleTo(JSChunkGraph graph, Appendable out, bool "{%s%s}\n", module.getName(), dependencies.isEmpty() ? "" : ":" + dependencies)); printManifestTo(module, out); } else { - printBundleTo(module, out); + printBundleTo(module, out, outputPath); } requiresNewline = true; } @@ -2380,7 +2383,7 @@ void printManifestTo(JSChunk module, Appendable out) throws IOException { */ @VisibleForTesting @GwtIncompatible("Unnecessary") - void printBundleTo(JSChunk module, Appendable out) throws IOException { + void printBundleTo(JSChunk module, Appendable out, String outputPath) throws IOException { ImmutableList inputs = module.getInputs(); // Prebuild ASTs before they're needed in getLoadFlags, for performance and because // StackOverflowErrors can be hit if not prebuilt. @@ -2428,7 +2431,7 @@ void printBundleTo(JSChunk module, Appendable out) throws IOException { out.append(displayName); out.append("\n"); - prepForBundleAndAppendTo(out, input, code); + prepForBundleAndAppendTo(out, input, code, outputPath); out.append("\n"); } diff --git a/src/com/google/javascript/jscomp/CommandLineRunner.java b/src/com/google/javascript/jscomp/CommandLineRunner.java index d999e1504c3..d10d5b1f3a0 100644 --- a/src/com/google/javascript/jscomp/CommandLineRunner.java +++ b/src/com/google/javascript/jscomp/CommandLineRunner.java @@ -2092,9 +2092,20 @@ private ClosureBundler getBundler() { } @Override - protected void prepForBundleAndAppendTo(Appendable out, CompilerInput input, String content) + protected void prepForBundleAndAppendTo(Appendable out, CompilerInput input, String content, String outputPath) throws IOException { - getBundler().withPath(input.getName()).appendTo(out, input, content); + String pathToInput = new File(input.getName()).getCanonicalPath(); + String pathToOutput = new File(outputPath).getParentFile().getCanonicalPath(); + String relativePath = Paths.get(pathToOutput).relativize(Paths.get(pathToInput)).toString(); + + ClosureBundler bundler; + if (!relativePath.startsWith("..")) { + bundler = getBundler().useEval(true).withSourceUrl(relativePath); + } else { + bundler = getBundler(); + } + + bundler.withPath(input.getName()).appendTo(out, input, content); } @Override diff --git a/test/com/google/javascript/jscomp/CommandLineRunnerTest.java b/test/com/google/javascript/jscomp/CommandLineRunnerTest.java index 605cf7d968b..e2108742b83 100644 --- a/test/com/google/javascript/jscomp/CommandLineRunnerTest.java +++ b/test/com/google/javascript/jscomp/CommandLineRunnerTest.java @@ -1785,7 +1785,7 @@ public void testChainModuleManifest() throws Exception { StringBuilder builder = new StringBuilder(); lastCommandLineRunner.printModuleGraphManifestOrBundleTo( - lastCompiler.getModuleGraph(), builder, true); + lastCompiler.getModuleGraph(), builder, true, null); assertThat(builder.toString()) .isEqualTo( Joiner.on('\n') @@ -1813,7 +1813,7 @@ public void testStarModuleManifest() throws Exception { StringBuilder builder = new StringBuilder(); lastCommandLineRunner.printModuleGraphManifestOrBundleTo( - lastCompiler.getModuleGraph(), builder, true); + lastCompiler.getModuleGraph(), builder, true, null); assertThat(builder.toString()) .isEqualTo( Joiner.on('\n') From 99a33e5d24e0256a3c381c4fc81eb418ee4cf526 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Fri, 14 Jun 2019 21:51:50 -0500 Subject: [PATCH 04/17] Bump versions --- maven/closure-compiler-externs.pom.xml | 4 ++-- maven/closure-compiler-main.pom.xml | 2 +- maven/closure-compiler-parent.pom.xml | 2 +- maven/closure-compiler-unshaded.pom.xml | 2 +- maven/closure-compiler.pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/maven/closure-compiler-externs.pom.xml b/maven/closure-compiler-externs.pom.xml index a9c35590f67..17c24008312 100644 --- a/maven/closure-compiler-externs.pom.xml +++ b/maven/closure-compiler-externs.pom.xml @@ -24,12 +24,12 @@ jar Closure Compiler Externs - 1.0-SNAPSHOT + 0.1-SNAPSHOT com.vertispan.javascript closure-compiler-parent - 1.0-SNAPSHOT + 0.1-SNAPSHOT closure-compiler-parent.pom.xml diff --git a/maven/closure-compiler-main.pom.xml b/maven/closure-compiler-main.pom.xml index f3ea9761a18..fe58a86f11f 100644 --- a/maven/closure-compiler-main.pom.xml +++ b/maven/closure-compiler-main.pom.xml @@ -40,7 +40,7 @@ com.vertispan.javascript closure-compiler-parent - 1.0-SNAPSHOT + 0.1-SNAPSHOT closure-compiler-parent.pom.xml diff --git a/maven/closure-compiler-parent.pom.xml b/maven/closure-compiler-parent.pom.xml index 6fce0a63a20..92b8db19ed6 100644 --- a/maven/closure-compiler-parent.pom.xml +++ b/maven/closure-compiler-parent.pom.xml @@ -23,7 +23,7 @@ pom Closure Compiler Parent - 1.0-SNAPSHOT + 0.1-SNAPSHOT https://github.com/google/closure-compiler/ diff --git a/maven/closure-compiler-unshaded.pom.xml b/maven/closure-compiler-unshaded.pom.xml index 57e0981a324..b8b5ce40037 100644 --- a/maven/closure-compiler-unshaded.pom.xml +++ b/maven/closure-compiler-unshaded.pom.xml @@ -40,7 +40,7 @@ com.vertispan.javascript closure-compiler-main - 1.0-SNAPSHOT + 0.1-SNAPSHOT closure-compiler-main.pom.xml diff --git a/maven/closure-compiler.pom.xml b/maven/closure-compiler.pom.xml index a0fa709c1fc..be1a6f44022 100644 --- a/maven/closure-compiler.pom.xml +++ b/maven/closure-compiler.pom.xml @@ -40,7 +40,7 @@ com.vertispan.javascript closure-compiler-main - 1.0-SNAPSHOT + 0.1-SNAPSHOT closure-compiler-main.pom.xml From 048270572e46b43ec0d5d7279e389ee57425f08b Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Fri, 14 Jun 2019 21:53:49 -0500 Subject: [PATCH 05/17] Attempt at setting up circleci --- .circleci/config.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000000..ab6844d0c8e --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,15 @@ +# Use the latest 2.1 version of CircleCI pipeline processing engine, see https://circleci.com/docs/2.0/configuration-reference/ +version: 2.1 + +# Use a package of configuration called an orb, see https://circleci.com/docs/2.0/orb-intro/ +orbs: + # Declare a dependency on the welcome-orb + welcome: circleci/welcome-orb@0.3.1 + +# Orchestrate or schedule a set of jobs, see https://circleci.com/docs/2.0/workflows/ +workflows: + # Name the workflow "Welcome" + Welcome: + # Run the welcome/run job in its own container + jobs: + - welcome/run From b12366b39b85a274bc918a148976ca38d4e27d50 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Thu, 12 Sep 2019 15:39:13 -0500 Subject: [PATCH 06/17] Fix a few versions that didn't match with parent poms --- maven/closure-compiler-unshaded.pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maven/closure-compiler-unshaded.pom.xml b/maven/closure-compiler-unshaded.pom.xml index b8b5ce40037..c559dc9ac6f 100644 --- a/maven/closure-compiler-unshaded.pom.xml +++ b/maven/closure-compiler-unshaded.pom.xml @@ -24,7 +24,7 @@ jar Closure Compiler Unshaded - 1.0-SNAPSHOT + 0.1-SNAPSHOT https://developers.google.com/closure/compiler/ From d998268831e8e977be060088518faddc2dcb4988 Mon Sep 17 00:00:00 2001 From: Justin Hickman Date: Thu, 12 Sep 2019 15:39:59 -0500 Subject: [PATCH 07/17] update circleci configuration --- .circleci/config.yml | 49 ++++++++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ab6844d0c8e..68cb7b33c8f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,15 +1,34 @@ -# Use the latest 2.1 version of CircleCI pipeline processing engine, see https://circleci.com/docs/2.0/configuration-reference/ -version: 2.1 - -# Use a package of configuration called an orb, see https://circleci.com/docs/2.0/orb-intro/ -orbs: - # Declare a dependency on the welcome-orb - welcome: circleci/welcome-orb@0.3.1 - -# Orchestrate or schedule a set of jobs, see https://circleci.com/docs/2.0/workflows/ -workflows: - # Name the workflow "Welcome" - Welcome: - # Run the welcome/run job in its own container - jobs: - - welcome/run +version: 2 +jobs: + build: + working_directory: ~/repo + docker: + - image: circleci/openjdk:8-jdk-stretch + environment: + MAVEN_OPTS: -Xmx3200m + _JAVA_OPTIONS: "-Xms1g -Xmx1g" + steps: + - checkout + - run: + name: environment check + command: | + java -XX:+PrintFlagsFinal -version | grep -iE 'HeapSize|PermSize|ThreadStackSize' + env MAVEN_OPTS="-XX:+PrintFlagsFinal" mvn -version | grep -iE 'HeapSize|PermSize|ThreadStackSize' + mvn -version + + # Download and cache dependencies + - restore_cache: + keys: + - v1-dependencies-{{ checksum "pom.xml" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + + - run: mvn integration-test + + - save_cache: + paths: + - ~/.m2 + key: v1-dependencies-{{ checksum "pom.xml" }} + + + From 7359f432970ddd4c92c585572691bb34817dcec9 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Sat, 23 May 2020 14:49:16 -0500 Subject: [PATCH 08/17] Increment version after reverting a patch that is no longer required The patch (now missing from history) added compatibility with elemental2 1.0.0-RC1, but with the release of GWT 2.9 and elemental2 1.0.0, we're starting to remove these tweaks. --- maven/closure-compiler-externs.pom.xml | 4 ++-- maven/closure-compiler-main.pom.xml | 4 ++-- maven/closure-compiler-parent.pom.xml | 2 +- maven/closure-compiler-unshaded.pom.xml | 4 ++-- maven/closure-compiler.pom.xml | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/maven/closure-compiler-externs.pom.xml b/maven/closure-compiler-externs.pom.xml index 17c24008312..7954b69df30 100644 --- a/maven/closure-compiler-externs.pom.xml +++ b/maven/closure-compiler-externs.pom.xml @@ -24,12 +24,12 @@ jar Closure Compiler Externs - 0.1-SNAPSHOT + 0.2-SNAPSHOT com.vertispan.javascript closure-compiler-parent - 0.1-SNAPSHOT + 0.2-SNAPSHOT closure-compiler-parent.pom.xml diff --git a/maven/closure-compiler-main.pom.xml b/maven/closure-compiler-main.pom.xml index fe58a86f11f..63608de8a8d 100644 --- a/maven/closure-compiler-main.pom.xml +++ b/maven/closure-compiler-main.pom.xml @@ -24,7 +24,7 @@ pom Closure Compiler Main - 1.0-SNAPSHOT + 0.2-SNAPSHOT https://developers.google.com/closure/compiler/ @@ -40,7 +40,7 @@ com.vertispan.javascript closure-compiler-parent - 0.1-SNAPSHOT + 0.2-SNAPSHOT closure-compiler-parent.pom.xml diff --git a/maven/closure-compiler-parent.pom.xml b/maven/closure-compiler-parent.pom.xml index 92b8db19ed6..fbea1e0f722 100644 --- a/maven/closure-compiler-parent.pom.xml +++ b/maven/closure-compiler-parent.pom.xml @@ -23,7 +23,7 @@ pom Closure Compiler Parent - 0.1-SNAPSHOT + 0.2-SNAPSHOT https://github.com/google/closure-compiler/ diff --git a/maven/closure-compiler-unshaded.pom.xml b/maven/closure-compiler-unshaded.pom.xml index c559dc9ac6f..39061ca5f83 100644 --- a/maven/closure-compiler-unshaded.pom.xml +++ b/maven/closure-compiler-unshaded.pom.xml @@ -24,7 +24,7 @@ jar Closure Compiler Unshaded - 0.1-SNAPSHOT + 0.2-SNAPSHOT https://developers.google.com/closure/compiler/ @@ -40,7 +40,7 @@ com.vertispan.javascript closure-compiler-main - 0.1-SNAPSHOT + 0.2-SNAPSHOT closure-compiler-main.pom.xml diff --git a/maven/closure-compiler.pom.xml b/maven/closure-compiler.pom.xml index be1a6f44022..63d8e1d219b 100644 --- a/maven/closure-compiler.pom.xml +++ b/maven/closure-compiler.pom.xml @@ -24,7 +24,7 @@ jar Closure Compiler - 1.0-SNAPSHOT + 0.2-SNAPSHOT https://developers.google.com/closure/compiler/ @@ -40,7 +40,7 @@ com.vertispan.javascript closure-compiler-main - 0.1-SNAPSHOT + 0.2-SNAPSHOT closure-compiler-main.pom.xml From 593e177f09a80bc75b08c853e3758dc1c67d3109 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Sun, 31 May 2020 14:27:29 -0500 Subject: [PATCH 09/17] Allow circleci to deploy to the j2cl repo --- .circleci/config.yml | 8 +++++++- .circleci/settings.xml | 13 +++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .circleci/settings.xml diff --git a/.circleci/config.yml b/.circleci/config.yml index 68cb7b33c8f..5d256adf48f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,7 +23,7 @@ jobs: # fallback to using the latest cache if no exact match is found - v1-dependencies- - - run: mvn integration-test + - run: mvn deploy -s .circleci/settings.xml -Dartifactory.username=$ARTIFACTORY_USER -Dartifactory.password=$ARTIFACTORY_APIKEY - save_cache: paths: @@ -32,3 +32,9 @@ jobs: +workflows: + version: 2 + ci_build: + jobs: + - build: + context: deploy-keys \ No newline at end of file diff --git a/.circleci/settings.xml b/.circleci/settings.xml new file mode 100644 index 00000000000..74a7c1cf2da --- /dev/null +++ b/.circleci/settings.xml @@ -0,0 +1,13 @@ + + + + + vertispan-snapshots + ${artifactory.username} + ${artifactory.password} + + + + From ac7195f27496156d4b73d19dec738d2532a25a3e Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Mon, 1 Jun 2020 16:38:29 -0500 Subject: [PATCH 10/17] Revert "Remove historic Entity, EntityReference, NameList and Notation types" This reverts commit fdce7045538dd1252b116c47ddc608a5b3131dd3. --- externs/browser/w3c_dom1.js | 71 +++++++++++++++++++++++++++++++++++++ externs/browser/w3c_dom3.js | 64 +++++++++++++++++++++++++++++++++ 2 files changed, 135 insertions(+) diff --git a/externs/browser/w3c_dom1.js b/externs/browser/w3c_dom1.js index cb0537cefed..bb46db33918 100644 --- a/externs/browser/w3c_dom1.js +++ b/externs/browser/w3c_dom1.js @@ -390,6 +390,14 @@ Document.prototype.createDocumentFragment = function() {}; */ Document.prototype.createElement = function(tagName, opt_typeExtension) {}; +/** + * @param {string} name + * @return {!EntityReference} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createEntityReference + * @nosideeffects + */ +Document.prototype.createEntityReference = function(name) {}; + /** * @param {string} target * @param {string} data @@ -795,12 +803,75 @@ function CDATASection() {} */ function DocumentType() {} +/** + * @type {NamedNodeMap} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1788794630 + */ +DocumentType.prototype.entities; + /** * @type {string} * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1844763134 */ DocumentType.prototype.name; +/** + * @type {NamedNodeMap} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-D46829EF + */ +DocumentType.prototype.notations; + +/** + * @constructor + * @extends {Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-5431D1B9 + */ +function Notation() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-54F2B4D0 + */ +Notation.prototype.publicId; + +/** + * @type {string} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-E8AAB1D0 + */ +Notation.prototype.systemId; + +/** + * @constructor + * @extends {Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-527DCFF2 + */ +function Entity() {} + +/** + * @type {string} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-D7303025 + */ +Entity.prototype.publicId; + +/** + * @type {string} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-D7C29F3E + */ +Entity.prototype.systemId; + +/** + * @type {string} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-6ABAEB38 + */ +Entity.prototype.notationName; + +/** + * @constructor + * @extends {Node} + * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-11C98490 + */ +function EntityReference() {} + /** * @constructor * @extends {Node} diff --git a/externs/browser/w3c_dom3.js b/externs/browser/w3c_dom3.js index c87a840ebed..4912b04fb85 100644 --- a/externs/browser/w3c_dom3.js +++ b/externs/browser/w3c_dom3.js @@ -72,6 +72,52 @@ DOMStringList.prototype.contains = function(str) {}; */ DOMStringList.prototype.item = function(index) {}; +/** + * @constructor + * @implements {IArrayLike} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#NameList + */ +function NameList() {} + +/** + * @type {number} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#NameList-length + */ +NameList.prototype.length; + +/** + * @param {string} str + * @return {boolean} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#NameList-contains + * @nosideeffects + */ +NameList.prototype.contains = function(str) {}; + +/** + * @param {?string} namespaceURI + * @param {string} name + * @return {boolean} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#NameList-containsNS + * @nosideeffects + */ +NameList.prototype.containsNS = function(namespaceURI, name) {}; + +/** + * @param {number} index + * @return {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#NameList-getName + * @nosideeffects + */ +NameList.prototype.getName = function(index) {}; + +/** + * @param {number} index + * @return {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#NameList-getNamespaceURI + * @nosideeffects + */ +NameList.prototype.getNamespaceURI = function(index) {}; + /** * @constructor * @implements {IArrayLike} @@ -553,3 +599,21 @@ DocumentType.prototype.publicId; * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-Core-DocType-systemId */ DocumentType.prototype.systemId; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Entity3-inputEncoding + */ +Entity.prototype.inputEncoding; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Entity3-encoding + */ +Entity.prototype.xmlEncoding; + +/** + * @type {string} + * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Entity3-version + */ +Entity.prototype.xmlVersion; From 528dbdcb9b9f6ca6af9a0f45bc4ba0ea094a393a Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Thu, 5 Aug 2021 14:40:50 -0500 Subject: [PATCH 11/17] Increment version after rebase --- maven/closure-compiler-externs.pom.xml | 4 ++-- maven/closure-compiler-main.pom.xml | 4 ++-- maven/closure-compiler-parent.pom.xml | 2 +- maven/closure-compiler-unshaded.pom.xml | 4 ++-- maven/closure-compiler.pom.xml | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/maven/closure-compiler-externs.pom.xml b/maven/closure-compiler-externs.pom.xml index 7954b69df30..3e7ac7594cd 100644 --- a/maven/closure-compiler-externs.pom.xml +++ b/maven/closure-compiler-externs.pom.xml @@ -24,12 +24,12 @@ jar Closure Compiler Externs - 0.2-SNAPSHOT + 0.3-SNAPSHOT com.vertispan.javascript closure-compiler-parent - 0.2-SNAPSHOT + 0.3-SNAPSHOT closure-compiler-parent.pom.xml diff --git a/maven/closure-compiler-main.pom.xml b/maven/closure-compiler-main.pom.xml index 63608de8a8d..7de576e8900 100644 --- a/maven/closure-compiler-main.pom.xml +++ b/maven/closure-compiler-main.pom.xml @@ -24,7 +24,7 @@ pom Closure Compiler Main - 0.2-SNAPSHOT + 0.3-SNAPSHOT https://developers.google.com/closure/compiler/ @@ -40,7 +40,7 @@ com.vertispan.javascript closure-compiler-parent - 0.2-SNAPSHOT + 0.3-SNAPSHOT closure-compiler-parent.pom.xml diff --git a/maven/closure-compiler-parent.pom.xml b/maven/closure-compiler-parent.pom.xml index fbea1e0f722..66e0bb76466 100644 --- a/maven/closure-compiler-parent.pom.xml +++ b/maven/closure-compiler-parent.pom.xml @@ -23,7 +23,7 @@ pom Closure Compiler Parent - 0.2-SNAPSHOT + 0.3-SNAPSHOT https://github.com/google/closure-compiler/ diff --git a/maven/closure-compiler-unshaded.pom.xml b/maven/closure-compiler-unshaded.pom.xml index 39061ca5f83..6c09ef8f693 100644 --- a/maven/closure-compiler-unshaded.pom.xml +++ b/maven/closure-compiler-unshaded.pom.xml @@ -24,7 +24,7 @@ jar Closure Compiler Unshaded - 0.2-SNAPSHOT + 0.3-SNAPSHOT https://developers.google.com/closure/compiler/ @@ -40,7 +40,7 @@ com.vertispan.javascript closure-compiler-main - 0.2-SNAPSHOT + 0.3-SNAPSHOT closure-compiler-main.pom.xml diff --git a/maven/closure-compiler.pom.xml b/maven/closure-compiler.pom.xml index 63d8e1d219b..d816d534ffb 100644 --- a/maven/closure-compiler.pom.xml +++ b/maven/closure-compiler.pom.xml @@ -24,7 +24,7 @@ jar Closure Compiler - 0.2-SNAPSHOT + 0.3-SNAPSHOT https://developers.google.com/closure/compiler/ @@ -40,7 +40,7 @@ com.vertispan.javascript closure-compiler-main - 0.2-SNAPSHOT + 0.3-SNAPSHOT closure-compiler-main.pom.xml From ca3ff5471b920eead7efcb0b17311f8fa0897a27 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Wed, 25 Aug 2021 10:13:00 -0500 Subject: [PATCH 12/17] Update how we build to match upstream --- bazel/sonatype_artifact_bundle.bzl | 2 +- deploy.sh | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100755 deploy.sh diff --git a/bazel/sonatype_artifact_bundle.bzl b/bazel/sonatype_artifact_bundle.bzl index 703d1a4608b..5cfc04053b3 100644 --- a/bazel/sonatype_artifact_bundle.bzl +++ b/bazel/sonatype_artifact_bundle.bzl @@ -35,7 +35,7 @@ Returns: _bundle.jar: The bundle JAR """ -_SNAPSHOT = "1.0-SNAPSHOT" +_SNAPSHOT = "0.3-SNAPSHOT" def _sonatype_artifact_bundle(ctx): version = ctx.var.get("COMPILER_VERSION", _SNAPSHOT) diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 00000000000..9f05614b4b4 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,23 @@ +bazel build //:sonatype_bundles +VERSION=0.3-SNAPSHOT + +mkdir tmp +cd tmp + +mkdir parent +unzip -n ../bazel-bin/closure-compiler-parent_bundle.jar -d parent +mvn deploy:deploy-file -Dfile=parent/pom.xml -DpomFile=parent/pom.xml -Durl=https://repo.vertispan.com/j2cl/ -DrepositoryId=vertispan-snapshots + + +mkdir main +unzip -n ../bazel-bin/closure-compiler-main_bundle.jar -d main +mvn deploy:deploy-file -Dfile=main/pom.xml -DpomFile=main/pom.xml -Durl=https://repo.vertispan.com/j2cl/ -DrepositoryId=vertispan-snapshots + + +mkdir unshaded +unzip -n ../bazel-bin/closure-compiler-unshaded_bundle.jar -d unshaded +mvn deploy:deploy-file -Dfile=unshaded/closure-compiler-unshaded-${VERSION}.jar -Djavadoc=unshaded/closure-compiler-unshaded-${VERSION}-javadoc.jar -Dsources=unshaded/closure-compiler-unshaded-${VERSION}-sources.jar -DpomFile=unshaded/pom.xml -Durl=https://repo.vertispan.com/j2cl/ -DrepositoryId=vertispan-snapshots + + +cd - +rm -rf tmp \ No newline at end of file From ab0898473d291b98239411dcdbee55ccf28ee46f Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Wed, 25 Aug 2021 10:14:01 -0500 Subject: [PATCH 13/17] Add closure-library externs for csp, and our own hack file for elemental2 --- .../browser/cspviolationobserver_externs.js | 86 +++++++++++++++++++ externs/browser/elemental2-1.1.0-hack.js | 54 ++++++++++++ 2 files changed, 140 insertions(+) create mode 100644 externs/browser/cspviolationobserver_externs.js create mode 100644 externs/browser/elemental2-1.1.0-hack.js diff --git a/externs/browser/cspviolationobserver_externs.js b/externs/browser/cspviolationobserver_externs.js new file mode 100644 index 00000000000..77ce701059f --- /dev/null +++ b/externs/browser/cspviolationobserver_externs.js @@ -0,0 +1,86 @@ +/** + * @license + * Copyright The Closure Library Authors. + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * @fileoverview Externs used by cspviolationobserver.js that are not available + * in the open-source Closure compiler release. This file should be deleted + * once w3c_reporting_observer.js is available in open-source externs. + * + * @externs + */ + +// TODO(user): Remove this file once w3c_reporting_observer.js is +// available in the open-source Closure compiler. + +/** + * https://w3c.github.io/reporting/#interface-reporting-observer + * @constructor + * @param {!ReportingObserverCallback} callback + * @param {!ReportingObserverOptions} opts + */ +function ReportingObserver2(callback, opts) {} +/** @return {void} */ +ReportingObserver2.prototype.observe = function() {}; +/** @return {void} */ +ReportingObserver2.prototype.disconnect = function() {}; +/** @return {!Array} */ +ReportingObserver2.prototype.takeRecords = function() {}; + +/** + * @typedef {ReportingObserver2|ReportingObserver} + * @suppress {duplicate} + */ +var ReportingObserver; + + +/** + * @typedef {!function(!Array, !ReportingObserver): void} + * @suppress {duplicate} + */ +var ReportingObserverCallback; + + +/** + * @constructor + */ +function ReportingObserverOptions2() {} +/** @type {undefined|!Array} */ +ReportingObserverOptions2.prototype.types; +/** @type {boolean} */ +ReportingObserverOptions2.prototype.buffered; + +/** + * @typedef {ReportingObserverOptions2|ReportingObserverOptions} + * @suppress {duplicate} + */ +var ReportingObserverOptions; + + +/** + * @constructor + * @suppress {duplicate} + */ +function Report2() {} +/** @type {string} */ Report2.prototype.type; +/** @type {string} */ Report2.prototype.url; +/** @type {?ReportBody} */ Report2.prototype.body; + +/** + * @typedef {Report2|Report} + * @suppress {duplicate} + */ +var Report; + + +/** + * @constructor + */ +function ReportBody2() {} + +/** + * @typedef {ReportBody2|ReportBody2} + * @suppress {duplicate} + */ +var ReportBody; diff --git a/externs/browser/elemental2-1.1.0-hack.js b/externs/browser/elemental2-1.1.0-hack.js new file mode 100644 index 00000000000..d8abbfaf674 --- /dev/null +++ b/externs/browser/elemental2-1.1.0-hack.js @@ -0,0 +1,54 @@ +/** + * @fileoverview Describes types present in elemental2 1.1.0 that are not in closure-compiler, since they aren't + * real browser types. Presently this only contains the `WebWorker` type which never existed as a browser type, + * but showed up in closure-compiler as a typo or early draft or something. As long as elemental2 1.1.0 is + * supported, we must keep this file in our closure-compiler fork. + * + * TODO Remove this once elemental2 1.1.0 is considered to be unsupported by j2cl - this day may not come soon, + * if ever, as it is a "stable" release. + * + * @externs + */ + +/** + * @see http://dev.w3.org/html5/workers/ + * @constructor + * @implements {EventTarget} + */ +function WebWorker() {} + +/** @override */ +WebWorker.prototype.addEventListener = function(type, listener, opt_options) {}; + +/** @override */ +WebWorker.prototype.removeEventListener = function( + type, listener, opt_options) {}; + +/** @override */ +WebWorker.prototype.dispatchEvent = function(evt) {}; + +/** + * Stops the worker process + * @return {undefined} + */ +WebWorker.prototype.terminate = function() {}; + +/** + * Posts a message to the worker thread. + * @param {string} message + * @return {undefined} + */ +WebWorker.prototype.postMessage = function(message) {}; + +/** + * Sent when the worker thread posts a message to its creator. + * @type {?function(!MessageEvent<*>): void} + */ +WebWorker.prototype.onmessage; + +/** + * Sent when the worker thread encounters an error. + * @type {?function(!ErrorEvent): void} + */ +WebWorker.prototype.onerror; + From a46e538f31efbf4db8bc5897b07fbf041632d6e3 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Tue, 8 Mar 2022 11:09:43 -0600 Subject: [PATCH 14/17] Update readme, poms, and deploy script for first release --- README.md | 27 ++++++++++++++++++ bazel/sonatype_artifact_bundle.bzl | 4 +-- deploy.sh | 40 +++++++++++++++++++++++---- maven/closure-compiler-parent.pom.xml | 30 ++++++++++++-------- 4 files changed, 82 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 0f755a3bea5..3bb1ce5a3b2 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,33 @@ analyzes it, removes dead code and rewrites and minimizes what's left. It also checks syntax, variable references, and types, and warns about common JavaScript pitfalls. +--- + +This is Vertispan LLC's fork of the Closure Compiler targeted to support J2CL, +which includes a few changes from Google's original repository, including: + + * Externs that specifically match various stable versions of Elemental2. + * Sourcemap support for BUNDLE optimization levels. + * Include defines in BUNDLE output. + * Restore the `PersistentInputStore` API - note that with the introduction of + the (experimental) `TypedAst` feature, we may drop this soon. + +As the upstream project undergoes regular tagged releases, the Vertispan +releases in turn will be versioned and tagged to match them, following a pattern +of `-`, where the `` is the tag that +Google released, followed by ``, an integer to increment for each +tagged release - when a new Closure Compiler release is released, the release +count will reset to `1`. Note that not all upstream tags will necessarily get an +associated Vertispan release. Later releases off of the same upstream tag will +then increment that count, should they be needed. + +The release process is to rebase this set of commits, then update the version in +the poms appropriately. When a release is pushed to Maven Central, a tag will +be pushed to our git repository with a matching version. Snapshot releases will +use a `-SNAPSHOT` suffix after the release count. + +--- + ## Getting Started The easiest way to install the compiler is with [NPM](https://npmjs.com) or diff --git a/bazel/sonatype_artifact_bundle.bzl b/bazel/sonatype_artifact_bundle.bzl index 5cfc04053b3..b13f3e91a82 100644 --- a/bazel/sonatype_artifact_bundle.bzl +++ b/bazel/sonatype_artifact_bundle.bzl @@ -42,11 +42,11 @@ def _sonatype_artifact_bundle(ctx): password = None generate_signatures = True - if version == _SNAPSHOT: + if version.endswith("-SNAPSHOT"): # A SNAPSHOT version can't be uploaded as a release # and thus doesn't need to be signed generate_signatures = False - elif not version.startswith("v") or not version[1:].isdigit(): + elif not version.startswith("v"): fail("--define=COMPILER_VERSION was malformed; got '{0}'".format(version)) else: password = _fail_missing_define(ctx, "CLEARTEXT_GPG_PASSPHRASE") diff --git a/deploy.sh b/deploy.sh index 9f05614b4b4..c8a6df51ed6 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,22 +1,52 @@ -bazel build //:sonatype_bundles -VERSION=0.3-SNAPSHOT +#!/bin/bash + +# Deployment script modeled roughly after upstream's js deployment wiring, +# this file runs the bazel command to produce bundles, then immediately +# unbundles the zip and deploys each artifact. This script differs slightly +# in that it uses gpg:sign-and-deploy-file to handle attaching signatures, +# and only uploads the artifacts that Vertispan is presently interested in. + +set -e + +DEFAULT_DEPLOY_URL=https://repo.vertispan.com/j2cl/ +DEFAULT_DEPLOY_REPO_ID=vertispan-snapshots + +VERSION=${1:-HEAD-SNAPSHOT} +DEPLOY_URL=${2:-$DEFAULT_DEPLOY_URL} +DEPLOY_REPO_ID=${3:-$DEFAULT_DEPLOY_REPO_ID} + +#TODO Find another way to pass in gpg passphrase - apparently +# this is the only way bazel can work with parameters passed +# in? Also, it is unnecessary, since we have to call sign-and-deploy-file +# anyway to let maven upload without manually pushing a +# bundle, so it is unnecessary. +# It might be easier to modify the .bzl instead of supporting +# this, and just have bazel produce the jars+poms. +bazel build //:sonatype_bundles --define=COMPILER_VERSION=$VERSION --define=CLEARTEXT_GPG_PASSPHRASE=$CLEARTEXT_GPG_PASSPHRASE + + +if [ -z "$CLEARTEXT_GPG_PASSPHRASE" ]; then + GOAL="deploy:deploy-file" +else + GOAL="gpg:sign-and-deploy-file" +fi mkdir tmp cd tmp mkdir parent unzip -n ../bazel-bin/closure-compiler-parent_bundle.jar -d parent -mvn deploy:deploy-file -Dfile=parent/pom.xml -DpomFile=parent/pom.xml -Durl=https://repo.vertispan.com/j2cl/ -DrepositoryId=vertispan-snapshots +mvn $GOAL -Dfile=parent/pom.xml -DpomFile=parent/pom.xml -Durl=$DEPLOY_URL -DrepositoryId=$DEPLOY_REPO_ID mkdir main unzip -n ../bazel-bin/closure-compiler-main_bundle.jar -d main -mvn deploy:deploy-file -Dfile=main/pom.xml -DpomFile=main/pom.xml -Durl=https://repo.vertispan.com/j2cl/ -DrepositoryId=vertispan-snapshots +mvn $GOAL -Dfile=main/pom.xml -DpomFile=main/pom.xml -Durl=$DEPLOY_URL -DrepositoryId=$DEPLOY_REPO_ID mkdir unshaded unzip -n ../bazel-bin/closure-compiler-unshaded_bundle.jar -d unshaded -mvn deploy:deploy-file -Dfile=unshaded/closure-compiler-unshaded-${VERSION}.jar -Djavadoc=unshaded/closure-compiler-unshaded-${VERSION}-javadoc.jar -Dsources=unshaded/closure-compiler-unshaded-${VERSION}-sources.jar -DpomFile=unshaded/pom.xml -Durl=https://repo.vertispan.com/j2cl/ -DrepositoryId=vertispan-snapshots +mvn $GOAL -Dfile=unshaded/closure-compiler-unshaded-${VERSION}.jar -Djavadoc=unshaded/closure-compiler-unshaded-${VERSION}-javadoc.jar -Dsources=unshaded/closure-compiler-unshaded-${VERSION}-sources.jar -DpomFile=unshaded/pom.xml -Durl=$DEPLOY_URL -DrepositoryId=$DEPLOY_REPO_ID cd - diff --git a/maven/closure-compiler-parent.pom.xml b/maven/closure-compiler-parent.pom.xml index 66e0bb76466..e44fee94365 100644 --- a/maven/closure-compiler-parent.pom.xml +++ b/maven/closure-compiler-parent.pom.xml @@ -25,7 +25,7 @@ Closure Compiler Parent 0.3-SNAPSHOT - https://github.com/google/closure-compiler/ + https://github.com/vertispan/closure-compiler/ Closure Compiler is a JavaScript optimizing compiler. It parses your JavaScript, analyzes it, removes dead code and rewrites and minimizes @@ -33,6 +33,11 @@ warns about common JavaScript pitfalls. It is used in many of Google's JavaScript apps, including Gmail, Google Web Search, Google Maps, and Google Docs. + This distribution is slightly modified from the original for easier use + with J2CL outside of Bazel by Vertispan LLC. The links and references in + this pom.xml will reference the Vertispan fork, to ensure that any error + introduced by our changes are not incorrectly blamed on the upstream + Google repository. 2009 @@ -42,31 +47,32 @@ - scm:git:https://github.com/google/closure-compiler.git + scm:git:https://github.com/vertispan/closure-compiler.git - scm:git:git@github.com:google/closure-compiler.git + scm:git:git@github.com:vertispan/closure-compiler.git - https://github.com/google/closure-compiler + https://github.com/vertispan/closure-compiler - code.google.com - http://github.com/google/closure-compiler/issues + GitHub Issues + http://github.com/vertispan/closure-compiler/issues - - Google - http://www.google.com - - closure-compiler-authors Closure Compiler Authors - closure-compiler-discuss@googlegroups.com + closure-compiler-discuss@googlegroups.com + + + Colin Alworth + colin@vertispan.com + Vertispan LLC + https://www.vertispan.com/ From 33feccc3388ea58851ea400639f9076b056af225 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Mon, 18 Apr 2022 07:28:41 -0500 Subject: [PATCH 15/17] Guard against input and output being on different fs roots --- .../javascript/jscomp/CommandLineRunner.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/com/google/javascript/jscomp/CommandLineRunner.java b/src/com/google/javascript/jscomp/CommandLineRunner.java index d10d5b1f3a0..75e8a4a1643 100644 --- a/src/com/google/javascript/jscomp/CommandLineRunner.java +++ b/src/com/google/javascript/jscomp/CommandLineRunner.java @@ -75,6 +75,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.TreeMap; import java.util.logging.Level; @@ -2094,14 +2095,18 @@ private ClosureBundler getBundler() { @Override protected void prepForBundleAndAppendTo(Appendable out, CompilerInput input, String content, String outputPath) throws IOException { - String pathToInput = new File(input.getName()).getCanonicalPath(); - String pathToOutput = new File(outputPath).getParentFile().getCanonicalPath(); - String relativePath = Paths.get(pathToOutput).relativize(Paths.get(pathToInput)).toString(); - - ClosureBundler bundler; - if (!relativePath.startsWith("..")) { - bundler = getBundler().useEval(true).withSourceUrl(relativePath); + Path pathToInput = Paths.get(new File(input.getName()).getCanonicalPath()); + Path pathToOutput = Paths.get(new File(outputPath).getParentFile().getCanonicalPath()); + final ClosureBundler bundler; + if (Objects.equals(pathToInput.getRoot(), pathToOutput.getRoot())) { + String relativePath = pathToOutput.relativize(pathToInput).toString(); + if (!relativePath.startsWith("..")) { + bundler = getBundler().useEval(true).withSourceUrl(relativePath); + } else { + bundler = getBundler(); + } } else { + // Didn't share a root (such as two different windows drives), must not relativize bundler = getBundler(); } From adb682cfee2b61f54765993bdf97aa0a75d20f8e Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Thu, 6 Oct 2022 08:46:22 -0500 Subject: [PATCH 16/17] RTCConfigurationInterface_ workaround --- externs/browser/w3c_rtc.js | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/externs/browser/w3c_rtc.js b/externs/browser/w3c_rtc.js index f68a5ae96bc..7febd88508c 100644 --- a/externs/browser/w3c_rtc.js +++ b/externs/browser/w3c_rtc.js @@ -1821,6 +1821,43 @@ RTCIceServerInterface_.prototype.credential; */ var RTCIceServer; +//WORKAROUND for elemental2 - we need to keep these externs around as long as elemental2-dom 1.1.0 is a going concern +/** + * @typedef {{ + * iceServers: !Array, + * iceTransportPolicy: (string|undefined), + * sdpSemantics: (string|undefined) + * }} + * @private + */ +var RTCConfigurationRecord_; + +/** + * @interface + * @private + */ +function RTCConfigurationInterface_() {} +/** + * @type {!Array} + */ +RTCConfigurationInterface_.prototype.iceServers; + +/** + * Allows specifying the ICE transport policy. Valid values are "all" and + * "relay", with "all" being the default. + * @type {string|undefined} + */ +RTCConfigurationInterface_.prototype.iceTransportPolicy; +/** + * Allows specifying the SDP semantics. Valid values are "plan-b" and + * "unified-plan". + * + * @see {@link https://webrtc.org/web-apis/chrome/unified-plan/} + * @type {string|undefined} + */ +RTCConfigurationInterface_.prototype.sdpSemantics; +//END WORKAROUND + /** * @record * @see https://www.w3.org/TR/webrtc/#dom-rtcconfiguration From c1d5f0036d19ac1d70ab1e71bd10134d8b87a4a2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 10:21:57 +0000 Subject: [PATCH 17/17] Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 31eab42b9db..8ff9cd4234e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -51,7 +51,7 @@ jobs: # Clone closure-compiler repo from the commit under test into current directory. - name: Checkout Current closure-compiler Commit # https://github.com/marketplace/actions/checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 # https://github.com/bazelbuild/setup-bazelisk - uses: bazelbuild/setup-bazelisk@v2 @@ -104,7 +104,7 @@ jobs: # Clone closure-compiler-npm repo from master into the current directory. - name: Checkout Current closure-compiler-npm Commit # https://github.com/marketplace/actions/checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: google/closure-compiler-npm ref: master @@ -113,7 +113,7 @@ jobs: # submodule - name: Checkout Current closure-compiler Commit # https://github.com/marketplace/actions/checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: compiler @@ -152,7 +152,7 @@ jobs: # Clone closure-compiler repo from the commit under test into current directory. - name: Checkout Current closure-compiler Commit # https://github.com/marketplace/actions/checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v3