JAL-3274 import build properties and authors resources from JalviewJS site or classes...
[jalview.git] / build-site.xml
1 <?xml version="1.0"?>
2 <!--
3  BH 2018.08.12
4
5  - requires tools/ant-contrib.jar
6   
7  - creates the site/ directory if it does not exist
8  - unzip libjs/*.zip into site/swingjs/j2s
9  - unzips swingjs/SwingJS-site.zip into site/
10  - copies non-java resources from resources/ into site/swingjs/j2s
11  
12 -->
13
14 <project name="swingjs-project" default="tosite" basedir="."
15  xmlns:if="ant:if"
16     xmlns:unless="ant:unless">
17         
18   <target name="tosite">
19                 
20         <!-- input directories -->
21         
22         <!-- location of ant-contrib.jar -->
23         <property name="tools.dir" value = "tools" />
24
25         <!-- SwingjS_site zip file (could be varied if versioning is needed) -->
26         <property name="swingjs.zip" value="swingjs/SwingJS-site.zip" />
27
28         <!-- location of third-party jar contents as precompiled zipped .js files to copy to site/ -->
29         <property name="libjs.dir" value="libjs" />
30  
31         <!-- non-Java resources to copy to site/swingjs/j2s -->
32     <property name="resource.dir" value="resources" />          
33         
34         <!-- build_properties datastamp file to copy to site/swingjs/j2s -->
35     <property name="build_properties" value="classes/.build_properties" />      
36  
37         <!-- non-Java resources to copy to site/ -->
38     <property name="site-resource.dir" value="site-resources" />        
39         
40         <!-- output directories -->
41
42         <property name="site.dir" value="site" />
43         <property name="j2s.dir" value="${site.dir}/swingjs/j2s" />
44          
45     <!-- <for  ...> construct needs ant-contrib.jar -->
46     <taskdef resource="net/sf/antcontrib/antlib.xml">
47       <classpath>
48         <pathelement location="${tools.dir}/ant-contrib.jar" />
49       </classpath>
50     </taskdef>
51
52         <!-- unzip all libjs zip files into site
53         
54            all zip files placed in libjs will be processed
55            
56          -->
57
58         <for param="file.zip">
59           <path>
60             <fileset dir="${libjs.dir}" includes="*.zip"/>
61           </path>
62           <sequential>
63                         <unzip src="@{file.zip}" dest="${site.dir}" overwrite="true"/>          
64           </sequential>
65         </for>
66
67         <!-- unzip SwingJS-site.zip 
68         
69           we do this separately, as we want it done last 
70         
71         -->
72
73         <unzip src="${swingjs.zip}" dest="${site.dir}/" overwrite="true"/>      
74
75         <!-- transfer resources -->
76
77         <echo> Copying ${resource.dir} files into ${j2s.dir} </echo>
78         <copy todir="${j2s.dir}">
79       <fileset dir="${resource.dir}">
80         <include name="**"/>
81           </fileset>
82           <fileset file="${build_properties}"/> 
83     </copy>
84                 
85         <echo> Copying ${site-resource.dir} files into ${site.dir} </echo>
86         <copy todir="${site.dir}">
87       <fileset dir="${site-resource.dir}">
88         <include name="**"/>
89         </fileset>
90     </copy>
91                 
92 </target>
93         
94
95 </project>