-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathbuild-jspecview.xml
221 lines (199 loc) · 8.46 KB
/
build-jspecview.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<?xml version="1.0" encoding="UTF-8"?>
<project name="jspecview" basedir="." default="make-application-jar">
<description>
A JAVA based JCAMP-DX and XML Spectroscopy Viewer
</description>
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="tools/ant-contrib.jar" />
</classpath>
</taskdef>
<input message="private property file:" addproperty="Private.propertyFile" defaultValue="none" />
<if><available file="${Private.propertyFile}" /><then>
<property file="${Private.propertyFile}" />
<echo>using ${Private.keystore} ${Private.storetype}</echo>
</then></if>
<property name="debug" value="off" />
<property file="jsv/TODO.txt" prefix="TODO.txt" />
<property file="jsv/build_info.properties"/>
<property name="build.number" value="${build.major.number}.${build.minor.number}.${build.revision.number}"/>
<property name="manifest.dir" value="jsv/manifests"/>
<property name="src.dir" value="src"/>
<property name="lib.dir" value="jars"/>
<property name="bin.dir" value="bin"/>
<property name="build.dir" value="build"/>
<property name="extras.dir" value="jsv/extras" />
<property name="dist.dir" value="dist" />
<property name="dist.zip" value="${dist.dir}/jspecview.zip" />
<property name="selfsign.store" value="jsv/certificate/JSVcertificate.store" />
<property name="selfsign.storetype" value="jks" />
<property name="selfsign.storepass" value="JSV2013" />
<property name="selfsign.alias" value="JSVcertificate" />
<property name="tsa.url" value="http://timestamp.globalsign.com/scripts/timestamp.dll" />
<path id="jspecview.classpath">
<pathelement location="bin"/>
<!-- pathelement location="${lib.dir}/netscape.jar"/ -->
<!-- pathelement location="${lib.dir}/${itext.jar}"/ -->
</path>
<fileset id="jmolfiles" dir="${bin.dir}">
<include name="javajs/**/*"/>
<include name="org/jmol/api/Generic*"/>
<include name="org/jmol/api/EventManager*"/>
<include name="org/jmol/api/FontManager*"/>
<include name="org/jmol/api/JmolSync*"/>
<include name="org/jmol/api/*JSV*"/>
<include name="org/jmol/api/*JDX*"/>
<include name="org/jmol/api/PlatformViewer*"/>
<include name="org/jmol/api/SC.class"/>
<include name="org/jmol/awt/AwtPopup*.class"/>
<include name="org/jmol/awt/AwtPopupHelper*.class"/>
<include name="org/jmol/awt/AwtSwingComponent*.class"/>
<include name="org/jmol/jsv/JDXMOLParser.class"/>
<include name="org/jmol/popup/GenericPopup*.class"/>
<include name="org/jmol/popup/PopupHelper*.class"/>
<include name="org/jmol/popup/PopupResource*.class"/>
<include name="org/jmol/viewer/Jmol.properties"/>
<include name="org/jmol/util/Font*.class"/>
<include name="org/jmol/util/*Logger*.class"/>
</fileset>
<target name="current-number">
<echo>Current build number:${build.number}</echo>
</target>
<target name="revision">
<propertyfile file="jsv/build_info.properties">
<entry key="build.revision.number" type="int" operation="+" value="1" pattern="0"/>
</propertyfile>
</target>
<target name="build">
<echo message="getting application icons and resources"/>
<copy todir="${bin.dir}/jspecview/java/icons">
<fileset dir="${src.dir}/jspecview/java/icons"/>
</copy>
<copy todir="${bin.dir}/jspecview/application/icons">
<fileset dir="${src.dir}/jspecview/application/icons"/>
</copy>
<mkdir dir="${bin.dir}/jspecview/application/resources"/>
<copy todir="${bin.dir}/jspecview/application/resources">
<fileset dir="${src.dir}/jspecview/application/resources"/>
</copy>
</target>
<target name="make-application-jar" description="Make JSpecView application jar" depends="build">
<antcall target="revision" />
<mkdir dir="${build.dir}"/>
<copy todir="${bin.dir}/jspecview/common" >
<fileset dir="jsv">
<include name="TODO.txt" />
</fileset>
<filterchain>
<striplinecomments>
<comment value="#" />
</striplinecomments>
<linecontains>
<contains value="___" />
</linecontains>
</filterchain>
</copy>
<!--
<unjar dest="${bin.dir}" src="${lib.dir}/netscape.jar"/>
-->
<jar destfile="${build.dir}/JSpecView.app.${build.number}_unsigned.jar" manifest="${manifest.dir}/application.txt">
<fileset dir="${bin.dir}">
<include name="jspecview/**/*"/>
<exclude name="jspecview/*js*/*"/>
</fileset>
<fileset refid="jmolfiles" />
</jar>
<copy overwrite="true" file="${build.dir}/JSpecView.app.${build.number}_unsigned.jar"
tofile="${build.dir}/JSpecView.jar">
</copy>
<delete quiet="true">
<fileset dir="${build.dir}" includes = "*_unsigned.jar" />
</delete>
<!--
<antcall target="sign-jar-file">
<param name="sign-jar-file-dir" value="${build.dir}" />
<param name="sign-jar-file-name" value="JSpecView.jar" />
</antcall>
-->
</target>
<!--
<target name="make-applet-jar" description="Make sandbox JSpecView applet jar" depends="build">
<antcall target="revision" />
<mkdir dir="${build.dir}"/>
<copy todir="${bin.dir}/jspecview/common" >
<fileset dir="jsv">
<include name="TODO.txt" />
</fileset>
<filterchain>
<striplinecomments>
<comment value="#" />
</striplinecomments>
<linecontains>
<contains value="___" />
</linecontains>
</filterchain>
</copy>
<unjar dest="${bin.dir}" src="${lib.dir}/netscape.jar"/>
<jar destfile="${build.dir}/JSpecView.applet.${build.number}_unsigned.jar" manifest="${manifest.dir}/applet.txt">
<fileset dir="${bin.dir}">
<include name="jspecview/**/*"/>
<exclude name="jspecview/application/**/*"/>
<exclude name="jspecview/*js*/*"/>
</fileset>
<fileset refid="jmolfiles" />
</jar>
<copy overwrite="true" file="${build.dir}/JSpecView.applet.${build.number}_unsigned.jar"
tofile="build/JSpecViewApplet.jar">
</copy>
<antcall target="sign-jar-file">
<param name="sign-jar-file-dir" value="${build.dir}" />
<param name="sign-jar-file-name" value="JSpecViewApplet.jar" />
</antcall>
</target>
<target name="make-signed-applet-jar" depends="make-applet-jar" description="Make all-permission JSpecView applet jar">
<antcall target="revision" />
<mkdir dir="${build.dir}"/>
<unjar dest="${bin.dir}" src="${lib.dir}/netscape.jar"/>
<jar destfile="${build.dir}/JSpecViewAppletSigned.jar" manifest="${manifest.dir}/appletSigned.txt">
<fileset dir="${bin.dir}">
<include name="jspecview/**/*"/>
<exclude name="jspecview/application/**/*"/>
<exclude name="jspecview/*js*/*"/>
</fileset>
<fileset refid="jmolfiles" />
</jar>
<antcall target="sign-jar-file">
<param name="sign-jar-file-dir" value="${build.dir}" />
<param name="sign-jar-file-name" value="JSpecViewAppletSigned.jar" />
</antcall>
<delete quiet="true">
<fileset dir="${build.dir}" includes = "*_unsigned.jar" />
</delete>
</target>
<target name="sign-jar-file" >
<if><available file="${Private.propertyFile}" /><then>
<echo>using keystore="${Private.keystore}" alias="${Private.alias}"</echo>
<signjar keystore="${Private.keystore}"
storetype="${Private.storetype}"
storepass="${Private.storepass}"
keypass="${Private.keypass}"
alias="${Private.alias}"
tsaurl="${tsa.url}">
<fileset dir="${sign-jar-file-dir}" >
<include name="${sign-jar-file-name}" />
</fileset>
</signjar>
</then><else>
<signjar keystore="${selfsign.store}"
storetype="${selfsign.storetype}"
storepass="${selfsign.storepass}"
alias="${selfsign.alias}">
<fileset dir="${sign-jar-file-dir}" >
<include name="${sign-jar-file-name}" />
</fileset>
</signjar>
</else></if>
< ! - - to verify that a .jar file is signed: jarsigner -verify foo.jar - - >
</target>
-->
</project>