<?xml version="1.0"?>
<!--
- BH 2018.07.10
-
- Just a crude unzip of non-Jalview classes for development purposes -BH 2018
- Jim can generalize.
+ BH 2018.08.12
+
+ - requires tools/ant-contrib.jar
+
+ - creates the site/ directory if it does not exist
+ - unzip libjs *.zip into site/swingjs/j2s
+ - unzips SwingJS-site.zip into site/
+ - copies non-java resources into site/swingjs/j2s
-->
+
<project name="jalviewX" default="tosite" basedir="."
xmlns:if="ant:if"
xmlns:unless="ant:unless">
<target name="tosite">
+
+ <!-- input directories -->
- <!-- inputs directories -->
- <property name="resourceDir" value="resources" />
- <property name="libjsDir" value="libjs"/>
- <property name="swingjsDir" value="swingjs"/>
-
- <!-- inputs zip files -->
- <property name="swingjs.zip" value="${swingjsDir}/SwingJS-site.zip" />
+ <!-- location of ant-contrib.jar -->
+ <property name="tools.dir" value = "tools" />
- <!-- packages -->
- <property name="varna.zip" value="${libjsDir}/VARNA-site.zip" />
- <property name="mig.zip" value="${libjsDir}/MiGLayout-site.zip" />
- <property name="json.zip" value="${libjsDir}/jsonsimple-site.zip" />
- <!-- property name="log4j.zip" value="${libjsDir}/log4j-site.zip" / -->
+ <!-- SwingjS_site zip file (could be varied if versioning is needed) -->
+ <property name="swingjs.zip" value="swingjs/SwingJS-site.zip" />
+ <!-- location of third-party jar contents as precompiled zipped .js files to copy to site/ -->
+ <property name="libjs.dir" value="libjs" />
+
+ <!-- non-Java resources to copy to site/ -->
+ <property name="resource.dir" value="resources" />
+
<!-- output directories -->
- <property name="site" value="site"/>
- <property name="j2sDir" value="${site}/swingjs/j2s"/>
- <!-- SwingJS -->
+ <property name="site" value="site" />
+ <property name="j2s.dir" value="${site}/swingjs/j2s" />
+
+ <!-- <for ...> construct needs ant-contrib.jar -->
+ <taskdef resource="net/sf/antcontrib/antlib.xml">
+ <classpath>
+ <pathelement location="${tools.dir}/ant-contrib.jar" />
+ </classpath>
+ </taskdef>
- <echo> Unzipping ${swingjs.zip} into ${site} </echo>
- <unzip src="${swingjs.zip}" dest="${site}/" overwrite="true"/>
-
- <!-- resources -->
-
- <echo> Copying ${resourceDir} files into ${j2sDir} </echo>
- <copy todir="${j2sDir}">
- <fileset dir="${resourceDir}">
- <include name="**"/>
- </fileset>
- </copy>
+ <!-- unzip all libjs zip files into site
+
+ all zip files placed in libjs will be processed
+
+ -->
-
- <!-- VARNA -->
+ <for param="file.zip">
+ <path>
+ <fileset dir="${libjs.dir}" includes="*.zip"/>
+ </path>
+ <sequential>
+ <unzip src="@{file.zip}" dest="${site}" overwrite="true"/>
+ </sequential>
+ </for>
- <echo> Unzipping ${varna.zip} into ${site} </echo>
- <unzip src="${varna.zip}" dest="${site}" overwrite="true"/>
+ <!-- unzip SwingJS-site.zip
- <!-- MiGLayout -->
-
- <echo> Unzipping ${mig.zip} into ${site} </echo>
- <unzip src="${mig.zip}" dest="${site}" overwrite="true"/>
+ we do this separately, as we want it done last
- <!--
+ -->
- <echo> Unzipping ${log4j.zip} into ${site} </echo>
- <unzip src="${log4j.zip}" dest="${site}" overwrite="true"/>
- log4j -->
-
- <!-- json -->
+ <unzip src="${swingjs.zip}" dest="${site}/" overwrite="true"/>
- <echo> Unzipping ${json.zip} into ${site} </echo>
- <unzip src="${json.zip}" dest="${site}" overwrite="true"/>
+ <!-- transfer resources -->
-
+ <echo> Copying ${resource.dir} files into ${j2s.dir} </echo>
+ <copy todir="${j2s.dir}">
+ <fileset dir="${resource.dir}">
+ <include name="**"/>
+ </fileset>
+ </copy>
+
</target>
+
+
</project>