1 <project name="JSmol" default="toJs" basedir=".">
3 <taskdef resource="net/sf/antcontrib/antcontrib.properties">
5 <pathelement location="./utils/ant-contrib-1.0b3.jar" />
9 <target name="build-all-cores" id="build-all-cores">
10 <foreach target="CallToJs" param="classlist">
12 <fileset dir="./classlists/" includes="*.txt" />
17 <target name="CallToJs" id="CallToJs" description="Don't call this directly - used by build-all-cores to configure the toJs task for each set of classes in classlist">
18 <propertyregex property="core.name" input="${classlist}" replace="" regexp="\.txt"/>
19 <antcall target="toJs"/>
22 <target name="toJs" id="toJs">
23 <!-- sensible defaults for default target -->
24 <property name="site.path" value="site/swingjs" />
25 <property name="core.name" value="_jalview" />
26 <property name="classlist"
27 description="Class list .txt generated by java2script classloader to be bundled into corefile - default is _j2sclasslist.txt"
28 value="_j2sclasslist.txt" />
29 <!-- create a NON svn local directory only containing JS files
31 <echo>Deleting the site directory.</echo>
32 <delete quiet="true" dir="site" />
35 <!-- make core files -->
37 <echo>creating and compressing core files - warnings are OK; "does not exist" is trouble</echo>
38 <echo>reading core class list from file coreclasses</echo>
39 <loadresource property="coreclasses">
40 <file file="${classlist}"/>
43 <antcall target="call-core">
44 <param name="call-core.name" value="${core.name}" />
45 <param name="call-core.list" value="
51 <echo>......Now copy an html file in site/ and add core:"${core.name}", to the Info block.</echo>
56 <target name="call-core" id="call-core">
57 <echo>......Creating core${call-core.name}.js</echo>
58 <concat destfile="${site.path}/js/core/tmp.js">
59 <filelist dir="${site.path}/j2s" files="${call-core.list}" />
62 <replace dir="${site.path}/js/core" includes="tmp.js" token="Clazz." value="Clazz_"/>
63 <replace dir="${site.path}/js/core" includes="tmp.js" token="Clazz__" value="Clazz._"/>
64 <echo>......Generating ${site.path}/j2s/core/core${call-core.name}.js</echo>
65 <concat destfile="${site.path}/j2s/core/core${call-core.name}.js">
66 <filelist dir="${site.path}/js" files="
72 <echo>......Generating ${site.path}/j2s/core/core${call-core.name}.z.js</echo>
73 <java jar="tools/closure_compiler.jar" fork="true" dir="${site.path}/j2s/core" failonerror="false">
74 <arg line="--js core${call-core.name}.js --js_output_file core${call-core.name}.z.js" />
76 <delete quiet="true" file="${site.path}/js/core/tmp.js" />