Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm using <a href="http://requirejs.org/" rel="noreferrer">RequireJS</a> in my project, which includes a script that traces out dependencies between modules, and combines them into a single JavaScript file. Optionally, it can also minify the combined js file with the Google Closure compiler. Once it's in this form, where all dependencies are included in a single js file, the file can be easily compiled using jsc. </p> <p>Here's a segment of my ant script which I use to create the single combined js file, compile it to a class file, and then create an executable JAR:</p> <pre><code>&lt;target name="compile-single-js"&gt; &lt;mkdir dir="${build-js}"/&gt; &lt;java classname="org.mozilla.javascript.tools.shell.Main"&gt; &lt;classpath&gt; &lt;path refid="rhino-classpath"/&gt; &lt;path refid="closure-classpath"/&gt; &lt;/classpath&gt; &lt;arg value="${js-build-script}"/&gt; &lt;arg value="${js-build-dir}"/&gt; &lt;arg value="name=${build-js-main-rhino-frontend-module}"/&gt; &lt;arg value="out=${build-js-main}"/&gt; &lt;arg value="baseUrl=."/&gt; &lt;arg value="includeRequire=true"/&gt; &lt;arg value="inlineText=true"/&gt; &lt;arg value="optimize=none"/&gt; &lt;/java&gt; &lt;/target&gt; &lt;target name="compile-single-class" depends="compile-single-js"&gt; &lt;mkdir dir="${build-class}"/&gt; &lt;!-- TODO: set -opt --&gt; &lt;java classname="org.mozilla.javascript.tools.jsc.Main"&gt; &lt;classpath&gt; &lt;path refid="rhino-classpath"/&gt; &lt;/classpath&gt; &lt;arg value="-o"/&gt; &lt;arg value="${build-class-main-name}.class"/&gt; &lt;arg value="${build-js-main}"/&gt; &lt;/java&gt; &lt;move file="${build-js}/${build-class-main-name}.class" todir="${build-class}"/&gt; &lt;/target&gt; &lt;target name="jar-single-class" depends="compile-single-class"&gt; &lt;mkdir dir="${build-jar}"/&gt; &lt;jar destfile="${build-jar-main}" basedir="${build-class}" includes="${build-class-main-name}.class"&gt; &lt;manifest&gt; &lt;attribute name="Main-Class" value="${build-class-main-name}" /&gt; &lt;/manifest&gt; &lt;/jar&gt; &lt;/target&gt; </code></pre> <p>The complete build script can be found <a href="https://svn.apache.org/repos/asf/commons/sandbox/gsoc/2010/scxml-js/trunk/build.xml" rel="noreferrer">here</a>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload