Skip to content

Commit

Permalink
Bump the closure compiler to compiler-20180402
Browse files Browse the repository at this point in the history
This matches the version used by the bazel rules, which
means that if we find discrepencies, they'll be easier
to deal with. Hopefully.
  • Loading branch information
shs96c committed Dec 23, 2018
1 parent 1787a9a commit b623788
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 25 deletions.
55 changes: 30 additions & 25 deletions third_party/closure/bin/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# [Google Closure Compiler](https://developers.google.com/closure/compiler/)

[![Build Status](https://travis-ci.org/google/closure-compiler.svg?branch=master)](https://travis-ci.org/google/closure-compiler)
[![Open Source Helpers](https://www.codetriage.com/google/closure-compiler/badges/users.svg)](https://www.codetriage.com/google/closure-compiler)

The [Closure Compiler](https://developers.google.com/closure/compiler/) is a tool for making JavaScript download and run faster. It is a true compiler for JavaScript. Instead of compiling from a source language to machine code, it compiles from JavaScript to better JavaScript. It parses your JavaScript, 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.

## Getting Started
* [Download the latest version](http://dl.google.com/closure-compiler/compiler-latest.zip) ([Release details here](https://github.com/google/closure-compiler/wiki/Releases))
* [Download the latest version](https://dl.google.com/closure-compiler/compiler-latest.zip) ([Release details here](https://github.com/google/closure-compiler/wiki/Releases))
* [Download a specific version](https://github.com/google/closure-compiler/wiki/Binary-Downloads). Also available via:
- [Maven](https://github.com/google/closure-compiler/wiki/Maven)
- [NPM](https://www.npmjs.com/package/google-closure-compiler)
Expand All @@ -14,16 +15,16 @@ The [Closure Compiler](https://developers.google.com/closure/compiler/) is a too

## Options for Getting Help
1. Post in the [Closure Compiler Discuss Group](https://groups.google.com/forum/#!forum/closure-compiler-discuss).
2. Ask a question on [Stack Overflow](http://stackoverflow.com/questions/tagged/google-closure-compiler).
2. Ask a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/google-closure-compiler).
3. Consult the [FAQ](https://github.com/google/closure-compiler/wiki/FAQ).

## Building it Yourself

Note: The Closure Compiler requires [Java 7 or higher](http://www.java.com/).
Note: The Closure Compiler requires [Java 8 or higher](https://www.java.com/).

### Using [Maven](http://maven.apache.org/)
### Using [Maven](https://maven.apache.org/)

1. Download [Maven](http://maven.apache.org/download.cgi).
1. Download [Maven](https://maven.apache.org/download.cgi).

2. Add sonatype snapshots repository to `~/.m2/settings.xml`:
```
Expand Down Expand Up @@ -51,19 +52,23 @@ unit tests too).
Running `mvn -DskipTests -pl externs/pom.xml,pom-main.xml,pom-main-shaded.xml`
will skip building the GWT version of the compiler. This can speed up the build process significantly.

### Using [Eclipse](http://www.eclipse.org/)
### Using [Eclipse](https://www.eclipse.org/)

1. Download and open the [Eclipse IDE](http://www.eclipse.org/).
1. Download and open [Eclipse IDE](https://www.eclipse.org/). Disable `Project > Build automatically` during this process.
2. On the command line, at the root of this project, run `mvn eclipse:eclipse -DdownloadSources=true` to download JARs and build Eclipse project configuration.
3. Navigate to `File > Import > Maven > Existing Maven Projects` and browse to closure-compiler inside of Eclipse.
4. Import both closure-compiler and the nested externs project.
5. Disregard the warnings about maven-antrun-plugin and build errors.
6. In Package Explorer, remove from the build path:
- `src/com/google/javascript/jscomp/debugger/DebuggerGwtMain.java`
- `src/com/google/javascript/jscomp/gwt/`
7. [Exclude the files](http://stackoverflow.com/questions/1187868/how-can-i-exclude-some-folders-from-my-eclipse-project) in the directory `src/com/google/debugging/sourcemap/super` from the project.
8. Build project in Eclipse (right click on the project `closure-compiler-parent` and select `Build Project`).
9. See *Using Maven* above to build the JAR.
3. Run `mvn clean` and `mvn -DskipTests` to ensure AutoValues are generated and updated.
4. In Eclipse, navigate to `File > Import > Maven > Existing Maven Projects` and browse to closure-compiler.
5. Import both closure-compiler and the nested externs project.
6. Disregard the warnings about maven-antrun-plugin and build errors.
7. Configure the project to use the [Google Eclipse style guide](https://github.com/google/styleguide/blob/gh-pages/eclipse-java-google-style.xml)
8. Edit `.classpath` in closure-compiler-parent. Delete the `<classpathentry ... kind="src" path="src" ... />` line, then add:
```
<classpathentry excluding="com/google/debugging/sourcemap/super/**|com/google/javascript/jscomp/debugger/gwt/DebuggerGwtMain.java|com/google/javascript/jscomp/gwt/|com/google/javascript/jscomp/resources/super-gwt/**" kind="src" path="src"/>
<classpathentry kind="src" path="target/generated-sources/annotations"/>
```
9. Ensure the Eclipse project settings specify 1.8 compliance level in "Java Compiler".
10. Build project in Eclipse (right click on the project `closure-compiler-parent` and select `Build Project`).
11. See *Using Maven* above to build the JAR.

## Running

Expand Down Expand Up @@ -95,14 +100,14 @@ java -jar compiler.jar --help
```

More detailed information about running the Closure Compiler is available in the
[documentation](http://code.google.com/closure/compiler/docs/gettingstarted_app.html).
[documentation](https://developers.google.com/closure/compiler/docs/gettingstarted_app).


### Run using Eclipse

1. Open the class `src/com/google/javascript/jscomp/CommandLineRunner.java` or create your own extended version of the class.
2. Run the class in Eclipse.
3. See the instructions above on how to use the interactive mode - but beware of the [bug](http://stackoverflow.com/questions/4711098/passing-end-of-transmission-ctrl-d-character-in-eclipse-cdt-console) regarding passing "End of Transmission" in the Eclipse console.
3. See the instructions above on how to use the interactive mode - but beware of the [bug](https://stackoverflow.com/questions/4711098/passing-end-of-transmission-ctrl-d-character-in-eclipse-cdt-console) regarding passing "End of Transmission" in the Eclipse console.


## Compiling Multiple Scripts
Expand Down Expand Up @@ -139,7 +144,7 @@ will re-order the inputs automatically.
1. First make sure that it is really a bug and not simply the way that Closure Compiler works (especially true for ADVANCED_OPTIMIZATIONS).
* Check the [official documentation](https://developers.google.com/closure/compiler/)
* Consult the [FAQ](https://github.com/google/closure-compiler/wiki/FAQ)
* Search on [Stack Overflow](http://stackoverflow.com/questions/tagged/google-closure-compiler) and in the [Closure Compiler Discuss Group](https://groups.google.com/forum/#!forum/closure-compiler-discuss)
* Search on [Stack Overflow](https://stackoverflow.com/questions/tagged/google-closure-compiler) and in the [Closure Compiler Discuss Group](https://groups.google.com/forum/#!forum/closure-compiler-discuss)
2. If you still think you have found a bug, make sure someone hasn't already reported it. See the list of [known issues](https://github.com/google/closure-compiler/issues).
3. If it hasn't been reported yet, post a new issue. Make sure to add enough detail so that the bug can be recreated. The smaller the reproduction code, the better.

Expand All @@ -155,9 +160,9 @@ will re-order the inputs automatically.
and that you give us permission to use that code in Closure Compiler.
You maintain the copyright on that code.
If you own all the rights to your code, you can fill out an
[individual CLA](http://code.google.com/legal/individual-cla-v1.0.html).
[individual CLA](https://code.google.com/legal/individual-cla-v1.0.html).
If your employer has any rights to your code, then they also need to fill out
a [corporate CLA](http://code.google.com/legal/corporate-cla-v1.0.html).
a [corporate CLA](https://code.google.com/legal/corporate-cla-v1.0.html).
If you don't know if your employer has any rights to your code, you should
ask before signing anything.
By default, anyone with an @google.com email address already has a CLA
Expand Down Expand Up @@ -197,7 +202,7 @@ limitations under the License.

<tr>
<td>URL</td>
<td>http://www.mozilla.org/rhino</td>
<td>https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino</td>
</tr>

<tr>
Expand Down Expand Up @@ -231,7 +236,7 @@ system have been added.</td>
<table>
<tr>
<td>URL</td>
<td>https://args4j.dev.java.net/</td>
<td>http://args4j.kohsuke.org/</td>
</tr>

<tr>
Expand Down Expand Up @@ -319,7 +324,7 @@ options/arguments in your CUI application.</td>
<table>
<tr>
<td>URL</td>
<td>http://sourceforge.net/projects/junit/</td>
<td>http://junit.org/junit4/</td>
</tr>

<tr>
Expand Down Expand Up @@ -407,7 +412,7 @@ an encoding of structured data.</td>
<table>
<tr>
<td>URL</td>
<td>http://ant.apache.org/bindownload.cgi</td>
<td>https://ant.apache.org/bindownload.cgi</td>
</tr>

<tr>
Expand Down
Binary file modified third_party/closure/bin/compiler.jar
Binary file not shown.

0 comments on commit b623788

Please sign in to comment.