JAL-3033 tarball from site
[jalview.git] / buildcore.xml
1 <project name="JSmol" default="toJs" basedir=".">
2  
3    <property name="site.path" value="site/swingjs" />
4    <property name="core.name" value="_jalview" />
5
6
7    <target name="toJs" id="toJs">
8                         
9         <!-- create a NON svn local directory only containing JS files
10         
11         <echo>Deleting the site directory.</echo>
12                 <delete quiet="true" dir="site" />
13     -->
14         
15         <!-- make core files -->
16
17         <echo>creating and compressing core files - warnings are OK; "does not exist" is trouble</echo>
18         <echo>reading core class list from file coreclasses</echo>      
19         <loadresource property="coreclasses">
20        <file file="coreclasses"/>
21     </loadresource>
22  
23     <antcall target="call-core">
24         <param name="call-core.name" value="${core.name}" />
25         <param name="call-core.list" value="
26                         core/coreswingjs.js
27                 ${coreclasses}
28                 " />
29     </antcall>
30     
31     <echo>......Now copy an html file in site/ and add   core:"core${core.name}",    to the Info block.</echo>  
32     
33   </target>
34
35
36           <target name="call-core" id="call-core">
37                 <echo>......Creating core${call-core.name}.js</echo>
38                 <concat destfile="${site.path}/js/core/tmp.js">
39                         <filelist dir="${site.path}/j2s" files="${call-core.list}" />
40                 </concat> 
41
42                 <replace dir="${site.path}/js/core" includes="tmp.js" token="Clazz." value="Clazz_"/>
43                 <replace dir="${site.path}/js/core" includes="tmp.js" token="Clazz__" value="Clazz._"/>
44                 <echo>......Generating ${site.path}/j2s/core/core${call-core.name}.js</echo>    
45                 <concat destfile="${site.path}/j2s/core/core${call-core.name}.js"><filelist dir="${site.path}/js" files="
46                         core/coretop2.js
47                         core/tmp.js
48                         core/corebottom2.js
49                         " />
50                 </concat>
51                 <echo>......Generating ${site.path}/j2s/core/core${call-core.name}.z.js</echo>  
52                 <java jar="tools/closure_compiler.jar" fork="true" dir="${site.path}/j2s/core" failonerror="false">
53                         <arg line="--js core${call-core.name}.js --js_output_file core${call-core.name}.z.js" />
54             </java>
55                 <delete quiet="true" file="${site.path}/js/core/tmp.js" />
56           </target>
57
58                 
59         
60 </project>