|
| 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 | + |
| 29 | + <!-- location of third-party jar contents as precompiled zipped .js files to copy to site/ --> |
| 30 | + <property name="libjs.dir" value="libjs" /> |
| 31 | + |
| 32 | + <!-- non-Java resources to copy to site/swingjs/j2s --> |
| 33 | + <property name="resource.dir" value="resources" /> |
| 34 | + |
| 35 | + <!-- non-Java resources to copy to site/ --> |
| 36 | + <property name="site-resource.dir" value="site-resources" /> |
| 37 | + |
| 38 | + <!-- output directories --> |
| 39 | + |
| 40 | + <property name="site.dir" value="site" /> |
| 41 | + <property name="j2s.dir" value="${site.dir}/swingjs/j2s" /> |
| 42 | + |
| 43 | + <!-- <for ...> construct needs ant-contrib.jar --> |
| 44 | + <taskdef resource="net/sf/antcontrib/antlib.xml"> |
| 45 | + <classpath> |
| 46 | + <pathelement location="${tools.dir}/ant-contrib.jar" /> |
| 47 | + </classpath> |
| 48 | + </taskdef> |
| 49 | + |
| 50 | + <!-- unzip all libjs zip files into site |
| 51 | + |
| 52 | + all zip files placed in libjs will be processed |
| 53 | + |
| 54 | + --> |
| 55 | + |
| 56 | + <for param="file.zip"> |
| 57 | + <path> |
| 58 | + <fileset dir="${libjs.dir}" erroronmissingdir="false" includes="*.zip"/> |
| 59 | + </path> |
| 60 | + <sequential> |
| 61 | + <unzip src="@{file.zip}" dest="${site.dir}" overwrite="true"/> |
| 62 | + </sequential> |
| 63 | + </for> |
| 64 | + |
| 65 | + <!-- unzip SwingJS-site.zip |
| 66 | + |
| 67 | + not in net.sf.j2s |
| 68 | + |
| 69 | + <unzip src="${swingjs.zip}" dest="${site.dir}/" overwrite="true"/> |
| 70 | + --> |
| 71 | + |
| 72 | + |
| 73 | + <!-- transfer resources --> |
| 74 | + |
| 75 | + <echo> Copying ${resource.dir} files into ${j2s.dir} </echo> |
| 76 | + <copy todir="${j2s.dir}"> |
| 77 | + <fileset dir="${resource.dir}" erroronmissingdir="false" > |
| 78 | + <include name="**"/> |
| 79 | + </fileset> |
| 80 | + </copy> |
| 81 | + |
| 82 | + <echo> Copying ${site-resource.dir} files into ${site.dir} </echo> |
| 83 | + <copy todir="${site.dir}"> |
| 84 | + <fileset dir="${site-resource.dir}" erroronmissingdir="false" > |
| 85 | + <include name="**"/> |
| 86 | + </fileset> |
| 87 | + </copy> |
| 88 | + |
| 89 | + |
| 90 | +</target> |
| 91 | + |
| 92 | + |
| 93 | +</project> |
0 commit comments