-
Notifications
You must be signed in to change notification settings - Fork 21
/
build-site.xml
117 lines (87 loc) · 3.08 KB
/
build-site.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?xml version="1.0"?>
<!--
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/SwingJS-site.zip into site/
- copies non-java resources from resources/ into site/swingjs/j2s
-->
<project name="swingjs-project" default="tosite" basedir="."
xmlns:if="ant:if"
xmlns:unless="ant:unless">
<target name="tosite">
<!-- input directories -->
<!-- location of ant-contrib.jar -->
<property name="tools.dir" value = "tools" />
<!-- 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" />
<!-- program assets to copy to site/ -->
<property name="site.swingjs.dir" value="assets" />
<!-- output directories -->
<property name="site.dir" value="site" />
<property name="swingjs.dir" value="${site.dir}/swingjs" />
<property name="j2s.dir" value="${swingjs.dir}/j2s" />
<!-- <for ...> construct needs ant-contrib.jar -->
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="${tools.dir}/ant-contrib.jar" />
</classpath>
</taskdef>
<!-- unzip all libjs zip files into site
all zip files placed in libjs will be processed
-->
<for param="file.zip">
<path>
<fileset dir="${libjs.dir}" includes="*.zip"/>
</path>
<sequential>
<unzip src="@{file.zip}" dest="${site.dir}" overwrite="true"/>
</sequential>
</for>
<!-- unzip SwingJS-site.zip
we do this separately, as we want it done last
-->
<unzip src="${swingjs.zip}" dest="${site.dir}/" 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>
<echo> Copying ${site.swingjs.dir} files into ${swingjs.dir} </echo>
<copy todir="${swingjs.dir}">
<fileset dir="${site.swingjs.dir}">
<include name="**"/>
</fileset>
</copy>
<copy todir="${j2s.dir}/core" >
<fileset dir="src/org/jmol/viewer/">
<include name="Jmol.properties" />
</fileset>
<filterchain>
<striplinecomments>
<comment value="#" />
</striplinecomments>
<linecontains>
<contains value="Jmol.___JmolVersion" />
</linecontains>
</filterchain>
</copy>
<property file="Jmol.properties" prefix="Jmol.properties" />
<property name="version" value="${Jmol.properties.Jmol.___JmolVersion}" />
<propertyregex property="version"
override = "true"
input="${version}"
regexp='(")([^"]+)(")'
select="\2"
global="true"
/>
<echo message="version=${version}" />
</target>
</project>