xref: /aosp_15_r20/external/antlr/runtime/JavaScript/build/README (revision 16467b971bd3e2009fad32dd79016f2c7e421deb)
1*16467b97STreehugger Robot### DEPENDENCIES ###
2*16467b97STreehugger Robot
3*16467b97STreehugger RobotPrerequisites:
4*16467b97STreehugger Robot  * Java JRE 1.6 or greater.
5*16467b97STreehugger Robot  * Apache Ant 1.7.0 or greater; see http://ant.apache.org/manual/install.html
6*16467b97STreehugger Robot
7*16467b97STreehugger RobotBefore building the JavaScript target you will need to download a few third
8*16467b97STreehugger Robotparty open source libraries:
9*16467b97STreehugger Robot
10*16467b97STreehugger Robot  * ant-contrib: Download ant-contrib here: http://downloads.sourceforge.net/ant-contrib/ant-contrib-1.0b3-bin.zip?modtime=1162486738&big_mirror=0
11*16467b97STreehugger Robot  * Unzip the downloaded file.
12*16467b97STreehugger Robot  * Move ant-contrib-1.0b3.jar from the unzipped directory to runtime/JavaScript/third/
13*16467b97STreehugger Robot
14*16467b97STreehugger Robot  * closure compiler: Download here: http://closure-compiler.googlecode.com/files/compiler-latest.zip
15*16467b97STreehugger Robot  * Unzip the downloaded file.
16*16467b97STreehugger Robot  * Move compiler.jar from the unzipped directory to runtime/JavaScript/third/
17*16467b97STreehugger Robot
18*16467b97STreehugger Robot  * jsdoc-toolkit: Download the latest release from here: http://code.google.com/p/jsdoc-toolkit/downloads/list
19*16467b97STreehugger Robot  * Unzip the downloaded file.
20*16467b97STreehugger Robot  * Move the unzipped folder to runtime/JavaScript/third/jsdoc-toolkit
21*16467b97STreehugger Robot
22*16467b97STreehugger Robot  * jsunit: Download here: https://sourceforge.net/project/showfiles.php?group_id=28041&package_id=19823&release_id=404277
23*16467b97STreehugger Robot  * Unzip the downloaded file.
24*16467b97STreehugger Robot  * Move the unzipped folder to runtime/JavaScript/tests/jsunit
25*16467b97STreehugger Robot
26*16467b97STreehugger Robot### BUILD ###
27*16467b97STreehugger Robot1) In a shell cd to runtime/JavaScript/build.
28*16467b97STreehugger Robot2) Run 'ant'. This will build the JavaScript runtime libraries into the
29*16467b97STreehugger Robot   runtime/JavaScript/lib folder.
30*16467b97STreehugger Robot
31*16467b97STreehugger Robot### TESTS ###
32*16467b97STreehugger RobotCompile Tests:
33*16467b97STreehugger Robot1) Build the Antlr tool itself (see main Antlr documentation for details).
34*16467b97STreehugger Robot   This is most easily done by cd'ing to the root of the antlr code and running
35*16467b97STreehugger Robot   'mvn -Dmaven.test.skip=true package assembly:assembly'.  If using a
36*16467b97STreehugger Robot   different build method, update runtime/JavaScript/build/antlr3.properties to
37*16467b97STreehugger Robot   point to the alternative jar.
38*16467b97STreehugger Robot2) In a shell cd to runtime/JavaScript/build.
39*16467b97STreehugger Robot3) Run 'ant compile-tests'.  This can take a while.  Warnings (but not errors)
40*16467b97STreehugger Robot   issued during this step are expected.  (We test the JS runtime against
41*16467b97STreehugger Robot   grammars that have recoverable problems.)
42*16467b97STreehugger Robot
43*16467b97STreehugger RobotRun Tests:
44*16467b97STreehugger Robot1) Compile the tests using the directions above.
45*16467b97STreehugger Robot2) Open runtime/JavaScript/tests/jsunit/testRunner.html in a browser.  Note
46*16467b97STreehugger Robot   that some browsers (notably, Firefox 3.5) will have trouble with this page
47*16467b97STreehugger Robot   when opened with the 'file://' protocol.  To circumvent this issue, start
48*16467b97STreehugger Robot   and access the page through a lightweight http server (e.g. Mongoose).
49*16467b97STreehugger Robot3) Select the file runtime/JavaScript/tests/functional/all.html (or any other
50*16467b97STreehugger Robot   test html file).
51*16467b97STreehugger Robot4) Hit 'Run' and (hopefully ;) watch the pretty green bar grow.
52