source: other-projects/nz-flag-design/trunk/design-2d/Original editor.method.ac/build/tools/README@ 29468

Last change on this file since 29468 was 29468, checked in by sjs49, 9 years ago

Initial commit for editor.method.ac for flag design

  • Property svn:executable set to *
File size: 7.0 KB
Line 
1/*
2 * Copyright 2009 Google Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17//
18// Contents
19//
20
21The Closure Compiler performs checking, instrumentation, and
22optimizations on JavaScript code. The purpose of this README is to
23explain how to build and run the Closure Compiler.
24
25The Closure Compiler requires Java 6 or higher.
26http://www.java.com/
27
28
29//
30// Building The Closure Compiler
31//
32
33There are three ways to get a Closure Compiler executable.
34
351) Use one we built for you.
36
37Pre-built Closure binaries can be found at
38http://code.google.com/p/closure-compiler/downloads/list
39
40
412) Check out the source and build it with Apache Ant.
42
43First, check out the full source tree of the Closure Compiler. There
44are instructions on how to do this at the project site.
45http://code.google.com/p/closure-compiler/source/checkout
46
47Apache Ant is a cross-platform build tool.
48http://ant.apache.org/
49
50At the root of the source tree, there is an Ant file named
51build.xml. To use it, navigate to the same directory and type the
52command
53
54ant jar
55
56This will produce a jar file called "build/compiler.jar".
57
58
593) Check out the source and build it with Eclipse.
60
61Eclipse is a cross-platform IDE.
62http://www.eclipse.org/
63
64Under Eclipse's File menu, click "New > Project ..." and create a
65"Java Project." You will see an options screen. Give the project a
66name, select "Create project from existing source," and choose the
67root of the checked-out source tree as the existing directory. Verify
68that you are using JRE version 6 or higher.
69
70Eclipse can use the build.xml file to discover rules. When you
71navigate to the build.xml file, you will see all the build rules in
72the "Outline" pane. Run the "jar" rule to build the compiler in
73build/compiler.jar.
74
75
76//
77// Running The Closure Compiler
78//
79
80Once you have the jar binary, running the Closure Compiler is straightforward.
81
82On the command line, type
83
84java -jar compiler.jar
85
86This starts the compiler in interactive mode. Type
87
88var x = 17 + 25;
89
90then hit "Enter", then hit "Ctrl-Z" (on Windows) or "Ctrl-D" (on Mac or Linux)
91and "Enter" again. The Compiler will respond:
92
93var x=42;
94
95The Closure Compiler has many options for reading input from a file,
96writing output to a file, checking your code, and running
97optimizations. To learn more, type
98
99java -jar compiler.jar --help
100
101You can read more detailed documentation about the many flags at
102http://code.google.com/closure/compiler/docs/gettingstarted_app.html
103
104
105//
106// Compiling Multiple Scripts
107//
108
109If you have multiple scripts, you should compile them all together with
110one compile command.
111
112java -jar compiler.jar --js=in1.js --js=in2.js ... --js_output_file=out.js
113
114The Closure Compiler will concatenate the files in the order they're
115passed at the command line.
116
117If you need to compile many, many scripts together, you may start to
118run into problems with managing dependencies between scripts. You
119should check out the Closure Library. It contains functions for
120enforcing dependencies between scripts, and a tool called calcdeps.py
121that knows how to give scripts to the Closure Compiler in the right
122order.
123
124http://code.google.com/p/closure-library/
125
126//
127// Licensing
128//
129
130Unless otherwise stated, all source files are licensed under
131the Apache License, Version 2.0.
132
133
134-----
135Code under:
136src/com/google/javascript/rhino
137test/com/google/javascript/rhino
138
139URL: http://www.mozilla.org/rhino
140Version: 1.5R3, with heavy modifications
141License: Netscape Public License and MPL / GPL dual license
142
143Description: A partial copy of Mozilla Rhino. Mozilla Rhino is an
144implementation of JavaScript for the JVM. The JavaScript parser and
145the parse tree data structures were extracted and modified
146significantly for use by Google's JavaScript compiler.
147
148Local Modifications: The packages have been renamespaced. All code not
149relavant to parsing has been removed. A JSDoc parser and static typing
150system have been added.
151
152
153-----
154Code in:
155lib/libtrunk_rhino_parser_jarjared.jar
156
157Rhino
158URL: http://www.mozilla.org/rhino
159Version: Trunk
160License: Netscape Public License and MPL / GPL dual license
161
162Description: Mozilla Rhino is an implementation of JavaScript for the JVM.
163
164Local Modifications: None. We've used JarJar to renamespace the code
165post-compilation. See:
166http://code.google.com/p/jarjar/
167
168
169-----
170Code in:
171lib/args4j_deploy.jar
172
173Args4j
174URL: https://args4j.dev.java.net/
175Version: 2.0.9
176License: MIT
177
178Description:
179args4j is a small Java class library that makes it easy to parse command line
180options/arguments in your CUI application.
181
182Local Modifications: None.
183
184
185-----
186Code in:
187lib/guava-r06.jar
188
189Guava Libraries
190URL: http://code.google.com/p/guava-libraries/
191Version: R6
192License: Apache License 2.0
193
194Description: Google's core Java libraries.
195
196Local Modifications: None.
197
198
199-----
200Code in:
201lib/hamcrest-core-1.1.jar
202
203Hamcrest
204URL: http://code.google.com/p/hamcrest
205License: BSD
206License File: LICENSE
207
208Description:
209Provides a library of matcher objects (also known as constraints or
210predicates) allowing 'match' rules to be defined declaratively, to be used in
211other frameworks. Typical scenarios include testing frameworks, mocking
212libraries and UI validation rules.
213
214Local modifications:
215The original jars contained both source code and compiled classes.
216
217hamcrest-core-1.1.jar just contains the compiled classes.
218
219
220
221-----
222Code in:
223lib/jsr305.jar
224
225Annotations for software defect detection
226URL: http://code.google.com/p/jsr-305/
227Version: svn revision 47
228License: BSD License
229
230Description: Annotations for software defect detection.
231
232Local Modifications: None.
233
234
235----
236Code in:
237lib/junit.jar
238
239JUnit
240URL: http://sourceforge.net/projects/junit/
241Version: 4.5
242License: Common Public License 1.0
243
244Description: A framework for writing and running automated tests in Java.
245
246Local Modifications: None.
247
248
249---
250Code in:
251lib/protobuf-java-2.3.0.jar
252
253Protocol Buffers
254URL: http://code.google.com/p/protobuf/
255Version: 2.3.0
256License: New BSD License
257
258Description: Supporting libraries for protocol buffers,
259an encoding of structured data.
260
261Local Modifications: None
262
263
264---
265Code in:
266lib/ant_deploy.jar
267
268URL: http://ant.apache.org/bindownload.cgi
269Version: 1.6.5
270License: Apache License 2.0
271Description:
272 Ant is a Java based build tool. In theory it is kind of like "make"
273 without make's wrinkles and with the full portability of pure java code.
274
275Local Modifications:
276 Modified apache-ant-1.6.5/bin/ant to look in the ant.runfiles directory
277
278
279---
280Code in:
281lib/json.jar
282URL: http://json.org/java/index.html
283Version: JSON version 2
284License: MIT license
285Description:
286JSON is a set of java files for use in transmitting data in JSON format.
287
288Local Modifications: None
289
Note: See TracBrowser for help on using the repository browser.