Skip to content

Commit

Permalink
Updated closure compiler.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Oct 29, 2016
1 parent d748c94 commit 003b660
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 33 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"scripts": {
"build": "rollup -c",
"build-uglify": "rollup -c && uglifyjs build/stats.js -cm --preamble \"// stats.js - http://github.com/mrdoob/stats.js\" > build/stats.min.js",
"build-closure": "rollup -c && java -jar utils/compiler/compiler.jar --language_in=ECMASCRIPT5_STRICT --js build/stats.js --js_output_file build/stats.min.js",
"build-closure": "rollup -c && java -jar utils/compiler/closure-compiler-v20160713.jar --language_in=ECMASCRIPT5_STRICT --js build/stats.js --js_output_file build/stats.min.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
Expand Down
9 changes: 0 additions & 9 deletions utils/builder.py

This file was deleted.

Empty file modified utils/compiler/COPYING
100755 → 100644
Empty file.
69 changes: 46 additions & 23 deletions utils/compiler/README.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,41 @@ The [Closure Compiler](https://developers.google.com/closure/compiler/) is a too

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

### Using [Ant](http://ant.apache.org/)

1. Download the [Ant build tool](http://ant.apache.org/bindownload.cgi).

2. At the root of the source tree, there is an Ant file named ```build.xml```.
To use it, navigate to the same directory and type the command

```
ant jar
```
This will produce a jar file called ```build/compiler.jar```.
### Using [Maven](http://maven.apache.org/)

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

2. Add sonatype snapshots repository to `~/.m2/settings.xml`:
```
<profile>
<id>allow-snapshots</id>
<activation><activeByDefault>true</activeByDefault></activation>
<repositories>
<repository>
<id>snapshots-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
</profile>
```

3. Run `mvn -DskipTests` (omit the `-DskipTests` if you want to run all the
unit tests too).

This will produce a jar file called `target/closure-compiler-1.0-SNAPSHOT.jar`.

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

1. Download and open the [Eclipse IDE](http://www.eclipse.org/).
2. Navigate to ```File > New > Project ...``` and create a Java Project. Give
2. Navigate to `File > New > Project ...` and create a Java Project. Give
the project a name.
3. Select ```Create project from existing source``` and choose the root of the
3. Select `Create project from existing source` and choose the root of the
checked-out source tree as the existing directory.
3. Navigate to the ```build.xml``` file. You will see all the build rules in
the Outline pane. Run the ```jar``` rule to build the compiler in
```build/compiler.jar```.
3. Navigate to the `build.xml` file. You will see all the build rules in
the Outline pane. Run the `jar` rule to build the compiler in
`build/compiler.jar`.

## Running

Expand Down Expand Up @@ -91,7 +103,7 @@ You can also use minimatch-style globs.
# Recursively include all js files in subdirs
java -jar compiler.jar --js_output_file=out.js 'src/**.js'

# Recursively include all js files in subdirs, exclusing test files.
# Recursively include all js files in subdirs, excluding test files.
# Use single-quotes, so that bash doesn't try to expand the '!'
java -jar compiler.jar --js_output_file=out.js 'src/**.js' '!**_test.js'
```
Expand All @@ -118,10 +130,21 @@ will re-order the inputs automatically.
1. Consult the [FAQ](https://github.com/google/closure-compiler/wiki/FAQ) to make sure that the behaviour you would like isn't specifically excluded (such as string inlining).
2. Make sure someone hasn't requested the same thing. See the list of [known issues](https://github.com/google/closure-compiler/issues).
3. Read up on [what type of feature requests are accepted](https://github.com/google/closure-compiler/wiki/FAQ#how-do-i-submit-a-feature-request-for-a-new-type-of-optimization).
4. Submit your reqest as an issue.
4. Submit your request as an issue.

### Submitting patches
1. All contributors must sign a contributor license agreement. See the [CONTRIBUTORS](https://raw.githubusercontent.com/google/closure-compiler/master/CONTRIBUTORS) file for details.
1. All contributors must sign a contributor license agreement (CLA).
A CLA basically says that you own the rights to any code you contribute,
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).
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).
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
signed for them.
2. To make sure your changes are of the type that will be accepted, ask about your patch on the [Closure Compiler Discuss Group](https://groups.google.com/forum/#!forum/closure-compiler-discuss)
3. Fork the repository.
4. Make your changes.
Expand Down Expand Up @@ -234,7 +257,7 @@ options/arguments in your CUI application.</td>

<tr>
<td>Version</td>
<td>18.0</td>
<td>20.0</td>
</tr>

<tr>
Expand Down Expand Up @@ -331,7 +354,7 @@ options/arguments in your CUI application.</td>

<tr>
<td>URL</td>
<td>http://code.google.com/p/protobuf/</td>
<td>https://github.com/google/protobuf</td>
</tr>

<tr>
Expand Down Expand Up @@ -437,7 +460,7 @@ without make's wrinkles and with the full portability of pure java code.</td>

<tr>
<td>URL</td>
<td>https://code.google.com/p/google-gson/</td>
<td>https://github.com/google/gson</td>
</tr>

<tr>
Expand Down
Binary file added utils/compiler/closure-compiler-v20160713.jar
Binary file not shown.

0 comments on commit 003b660

Please sign in to comment.