Skip to content

Commit a3db6bd

Browse files
committed
Updated to latest Closure Compiler.
1 parent eab23ba commit a3db6bd

File tree

8 files changed

+70
-86
lines changed

8 files changed

+70
-86
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
},
2222
"scripts": {
2323
"build": "rollup -c",
24-
"build-min": "rollup -c && uglifyjs build/three.js -cm --preamble \"\/\/ threejs.org\/license\" > build/three.min.js",
25-
"build-closure": "rollup -c && java -jar utils/build/compiler/compiler.jar --warning_level=VERBOSE --jscomp_off=globalThis --jscomp_off=checkTypes --externs utils/build/externs/common.js --externs utils/build/externs/extras.js --language_in=ECMASCRIPT5_STRICT --js build/three.js --js_output_file build/three.min.js",
24+
"build-uglify": "rollup -c && uglifyjs build/three.js -cm --preamble \"\/\/ threejs.org\/license\" > build/three.min.js",
25+
"build-closure": "rollup -c && java -jar utils/build/compiler/closure-compiler-v20160713.jar --warning_level=VERBOSE --jscomp_off=globalThis --jscomp_off=checkTypes --externs utils/build/externs.js --language_in=ECMASCRIPT5_STRICT --js build/three.js --js_output_file build/three.min.js",
2626
"dev": "rollup -c -w",
2727
"test": "echo \"Error: no test specified\" && exit 1"
2828
},

utils/build/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ The build system now makes use of Node and npm.
77

88
## Building
99

10-
- Execute 'npm run build-min'
10+
- Execute 'npm run build-closure'

utils/build/compiler/README.md

Lines changed: 66 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
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.
66

77
## Getting Started
8-
* [Download the latest version](http://dl.google.com/closure-compiler/compiler-latest.zip)
8+
* [Download the latest version](http://dl.google.com/closure-compiler/compiler-latest.zip) ([Release details here](https://github.com/google/closure-compiler/wiki/Releases))
9+
* [Download a specific version](https://github.com/google/closure-compiler/wiki/Binary-Downloads). Also available via:
10+
- [Maven](https://github.com/google/closure-compiler/wiki/Maven)
11+
- [NPM](https://www.npmjs.com/package/google-closure-compiler)
912
* See the [Google Developers Site](https://developers.google.com/closure/compiler/docs/gettingstarted_app) for documentation including instructions for running the compiler from the command line.
1013

1114
## Options for Getting Help
@@ -17,29 +20,41 @@ The [Closure Compiler](https://developers.google.com/closure/compiler/) is a too
1720

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

20-
### Using [Ant](http://ant.apache.org/)
23+
### Using [Maven](http://maven.apache.org/)
2124

22-
1. Download the [Ant build tool](http://ant.apache.org/bindownload.cgi).
25+
1. Download [Maven](http://maven.apache.org/download.cgi).
2326

24-
2. At the root of the source tree, there is an Ant file named ```build.xml```.
25-
To use it, navigate to the same directory and type the command
27+
2. Add sonatype snapshots repository to `~/.m2/settings.xml`:
28+
```
29+
<profile>
30+
<id>allow-snapshots</id>
31+
<activation><activeByDefault>true</activeByDefault></activation>
32+
<repositories>
33+
<repository>
34+
<id>snapshots-repo</id>
35+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
36+
<releases><enabled>false</enabled></releases>
37+
<snapshots><enabled>true</enabled></snapshots>
38+
</repository>
39+
</repositories>
40+
</profile>
41+
```
2642

27-
```
28-
ant jar
29-
```
43+
3. Run `mvn -DskipTests` (omit the `-DskipTests` if you want to run all the
44+
unit tests too).
3045

31-
This will produce a jar file called ```build/compiler.jar```.
46+
This will produce a jar file called `target/closure-compiler-1.0-SNAPSHOT.jar`.
3247

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

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

4459
## Running
4560

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

91-
# Recursively include all js files in subdirs, exclusing test files.
106+
# Recursively include all js files in subdirs, excluding test files.
92107
# Use single-quotes, so that bash doesn't try to expand the '!'
93108
java -jar compiler.jar --js_output_file=out.js 'src/**.js' '!**_test.js'
94109
```
@@ -115,10 +130,21 @@ will re-order the inputs automatically.
115130
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).
116131
2. Make sure someone hasn't requested the same thing. See the list of [known issues](https://github.com/google/closure-compiler/issues).
117132
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).
118-
4. Submit your reqest as an issue.
133+
4. Submit your request as an issue.
119134

120135
### Submitting patches
121-
1. All contributors must sign a contributor license agreement. See the [CONTRIBUTORS](https://raw.githubusercontent.com/google/closure-compiler/master/CONTRIBUTORS) file for details.
136+
1. All contributors must sign a contributor license agreement (CLA).
137+
A CLA basically says that you own the rights to any code you contribute,
138+
and that you give us permission to use that code in Closure Compiler.
139+
You maintain the copyright on that code.
140+
If you own all the rights to your code, you can fill out an
141+
[individual CLA](http://code.google.com/legal/individual-cla-v1.0.html).
142+
If your employer has any rights to your code, then they also need to fill out
143+
a [corporate CLA](http://code.google.com/legal/corporate-cla-v1.0.html).
144+
If you don't know if your employer has any rights to your code, you should
145+
ask before signing anything.
146+
By default, anyone with an @google.com email address already has a CLA
147+
signed for them.
122148
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)
123149
3. Fork the repository.
124150
4. Make your changes.
@@ -226,12 +252,12 @@ options/arguments in your CUI application.</td>
226252

227253
<tr>
228254
<td>URL</td>
229-
<td>http://code.google.com/p/guava-libraries/</td>
255+
<td>https://github.com/google/guava</td>
230256
</tr>
231257

232258
<tr>
233259
<td>Version</td>
234-
<td>18.0</td>
260+
<td>20.0</td>
235261
</tr>
236262

237263
<tr>
@@ -328,7 +354,7 @@ options/arguments in your CUI application.</td>
328354

329355
<tr>
330356
<td>URL</td>
331-
<td>http://code.google.com/p/protobuf/</td>
357+
<td>https://github.com/google/protobuf</td>
332358
</tr>
333359

334360
<tr>
@@ -353,24 +379,22 @@ an encoding of structured data.</td>
353379
</tr>
354380
</table>
355381

356-
### Ant
382+
### Truth
357383

358384
<table>
359385
<tr>
360386
<td>Code Path</td>
361-
<td>
362-
<code>lib/ant.jar</code>, <code>lib/ant-launcher.jar</code>
363-
</td>
387+
<td><code>lib/truth.jar</code></td>
364388
</tr>
365389

366390
<tr>
367391
<td>URL</td>
368-
<td>http://ant.apache.org/bindownload.cgi</td>
392+
<td>https://github.com/google/truth</td>
369393
</tr>
370394

371395
<tr>
372396
<td>Version</td>
373-
<td>1.8.1</td>
397+
<td>0.24</td>
374398
</tr>
375399

376400
<tr>
@@ -380,42 +404,7 @@ an encoding of structured data.</td>
380404

381405
<tr>
382406
<td>Description</td>
383-
<td>Ant is a Java based build tool. In theory it is kind of like "make"
384-
without make's wrinkles and with the full portability of pure java code.</td>
385-
</tr>
386-
387-
<tr>
388-
<td>Local Modifications</td>
389-
<td>None</td>
390-
</tr>
391-
</table>
392-
393-
### JSON
394-
395-
<table>
396-
<tr>
397-
<td>Code Path</td>
398-
<td><code>lib/json.jar</code></td>
399-
</tr>
400-
401-
<tr>
402-
<td>URL</td>
403-
<td>http://json.org/java/index.html</td>
404-
</tr>
405-
406-
<tr>
407-
<td>Version</td>
408-
<td>JSON version 20090211</td>
409-
</tr>
410-
411-
<tr>
412-
<td>License</td>
413-
<td>MIT license</td>
414-
</tr>
415-
416-
<tr>
417-
<td>Description</td>
418-
<td>JSON is a set of java files for use in transmitting data in JSON format.</td>
407+
<td>Assertion/Proposition framework for Java unit tests</td>
419408
</tr>
420409

421410
<tr>
@@ -424,35 +413,35 @@ without make's wrinkles and with the full portability of pure java code.</td>
424413
</tr>
425414
</table>
426415

427-
### Mockito
416+
### Ant
428417

429418
<table>
430419
<tr>
431420
<td>Code Path</td>
432-
<td><code>lib/mockito-core.jar</code></td>
421+
<td>
422+
<code>lib/ant.jar</code>, <code>lib/ant-launcher.jar</code>
423+
</td>
433424
</tr>
434425

435426
<tr>
436427
<td>URL</td>
437-
<td>https://code.google.com/p/mockito</td>
428+
<td>http://ant.apache.org/bindownload.cgi</td>
438429
</tr>
439430

440431
<tr>
441432
<td>Version</td>
442-
<td>1.9.5</td>
433+
<td>1.8.1</td>
443434
</tr>
444435

445436
<tr>
446437
<td>License</td>
447-
<td>MIT license</td>
438+
<td>Apache License 2.0</td>
448439
</tr>
449440

450441
<tr>
451442
<td>Description</td>
452-
<td>Mockito is an open source testing framework for Java. The framework allows the
453-
creation of Test Double objects (called "Mock Objects") in automated unit tests
454-
for the purpose of Test-driven Development (TDD) or Behavior Driven Development
455-
(BDD).</td>
443+
<td>Ant is a Java based build tool. In theory it is kind of like "make"
444+
without make's wrinkles and with the full portability of pure java code.</td>
456445
</tr>
457446

458447
<tr>
@@ -461,32 +450,32 @@ for the purpose of Test-driven Development (TDD) or Behavior Driven Development
461450
</tr>
462451
</table>
463452

464-
### Objenesis
453+
### GSON
465454

466455
<table>
467456
<tr>
468457
<td>Code Path</td>
469-
<td><code>lib/objenesis.jar</code></td>
458+
<td><code>lib/gson.jar</code></td>
470459
</tr>
471460

472461
<tr>
473462
<td>URL</td>
474-
<td>http://objenesis.org</td>
463+
<td>https://github.com/google/gson</td>
475464
</tr>
476465

477466
<tr>
478467
<td>Version</td>
479-
<td>1.2</td>
468+
<td>2.2.4</td>
480469
</tr>
481470

482471
<tr>
483472
<td>License</td>
484-
<td>Apache 2.0 license</td>
473+
<td>Apache license 2.0</td>
485474
</tr>
486475

487476
<tr>
488477
<td>Description</td>
489-
<td>Depended by lib/mockito-core.jar, not used directly.</td>
478+
<td>A Java library to convert JSON to Java objects and vice-versa</td>
490479
</tr>
491480

492481
<tr>
Binary file not shown.

utils/build/compiler/compiler.jar

-5.84 MB
Binary file not shown.
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
var AudioContext;
2-
var console;
1+
var THREE;
32
var define;
43
var module;
54
var exports;
6-
var JSON;
75
var performance;
86
var WebGL2RenderingContext;

utils/build/externs/examples.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

utils/build/externs/extras.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)