-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.xml
267 lines (238 loc) · 10.1 KB
/
build.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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<?xml version="1.0"?>
<project name="PathVisio" default="all" basedir=".">
<property name="src.dir" value="modules" />
<property name="debug.mode" value="true" />
<property name="apidoc.dir" value="apidoc" />
<property name="webstart.dir" value="webstart" />
<property name="release.dir" value="release" />
<property name="svn.exec.svnversion" value="svnversion" />
<property name="checkstyle.output.file" value="warnings.txt" />
<property name="webstart.base.url" value="http://www.pathvisio.org/webstart" />
<!-- needed to build zip files correctly -->
<property name="pathvisio.version" value="4.0.0" />
<macrodef name="iterate">
<attribute name="target" />
<sequential>
<subant target="@{target}">
<filelist dir=".">
<file name="modules/org.pathvisio.core/build.xml" />
<file name="modules/org.pathvisio.gui/build.xml" />
<file name="modules/org.pathvisio.desktop/build.xml" />
<file name="modules/org.pathvisio.pluginmanager/build.xml" />
<file name="modules/org.pathvisio.launcher/build.xml" />
</filelist>
</subant>
</sequential>
</macrodef>
<target name="prepare">
<mkdir dir="${apidoc.dir}" />
<mkdir dir="${release.dir}" />
</target>
<target name="clean" description="Remove all intermediate files.">
<delete dir="${apidoc.dir}" />
<delete dir="${webstart.dir}/www" />
<delete dir="build" />
<iterate target="clean" />
</target>
<target name="dist-clean" depends="clean" description="Cleaner than clean: remove all generated files">
<delete file="${src.dir}/org.pathvisio.core/src/org/pathvisio/core/Revision.java" />
<delete file="pathvisio.jar" />
<delete dir="${release.dir}" />
<iterate target="dist-clean" />
</target>
<target name="core.jar" depends="prepare">
<subant target="jar" buildpath="modules/org.pathvisio.core/build.xml" />
</target>
<target name="gui.jar" depends="core.jar">
<subant target="jar" buildpath="modules/org.pathvisio.gui/build.xml" />
</target>
<target name="desktop.jar" depends="gui.jar">
<subant target="jar" buildpath="modules/org.pathvisio.desktop/build.xml" />
</target>
<target name="pluginmanager.jar" depends="desktop.jar">
<subant target="jar" buildpath="modules/org.pathvisio.pluginmanager/build.xml" />
</target>
<target name="launcher.jar" depends="core.jar">
<subant target="jar" buildpath="modules/org.pathvisio.launcher/build.xml" />
</target>
<target name="plugin-dev" depends="plugins.jar">
<mkdir dir="plugin-dev" />
<copy toDir="plugin-dev">
<fileset dir="lib">
<include name="*.jar" />
</fileset>
<fileset dir="modules">
<include name="*.jar" />
</fileset>
</copy>
</target>
<target name="plugins.jar" depends="pluginmanager.jar">
</target>
<target name="exe" depends="launcher.jar,plugins.jar">
<mkdir dir="build/exe" />
<copy toDir="build/exe">
<fileset dir="modules">
<include name="org.pathvisio.core.jar" />
<include name="org.pathvisio.pluginmanager.jar" />
<include name="org.pathvisio.gui.jar" />
<include name="org.pathvisio.desktop.jar" />
</fileset>
<fileset dir="lib">
<include name="org.pathvisio.libgpml*.jar" />
<include name="org.apache*.jar" />
<include name="derby*.jar" />
<!--<include name="org.w3c*.jar"/>-->
<include name="org.bridgedb*.jar" />
<include name="org.pathvisio.*.jar" />
<!--<include name="javax.*.jar"/>-->
<include name="com.sun.*.jar" />
<include name="jakarta*.jar" />
<include name="org.jdom.*.jar" />
<!--<include name="commons-math*.jar"/>-->
<include name="com.springsource*.jar" />
<include name="org.apache.felix.bundlerepository-1.6.6.jar" />
<include name="commons*.jar" />
<include name="osgi*.jar" />
<include name="jaxb*.jar" />
<include name="json*.jar" />
</fileset>
</copy>
<unjar src="modules/org.pathvisio.launcher.jar" dest="build/exe" />
<unjar src="lib/felix.jar" dest="build/exe" />
<jar file="pathvisio.jar" basedir="build/exe">
<manifest>
<attribute name="Main-Class" value="org.pathvisio.launcher.PathVisioMain" />
<attribute name="Permissions" value="all-permissions" />
<attribute name="Codebase" value="www.pathvisio.org" />
<attribute name="Application-Name" value="PathVisio" />
</manifest>
</jar>
</target>
<target name="all" depends="exe" description="Compile all versions of this project" />
<target name="prepare-webstart" depends="exe" description="prepares webstart">
<fail message="You must specify a keystore password for opening visioKeyStore: ant -Dkeystore.password=***** [ant target]">
<condition>
<not>
<isset property="keystore.password" />
</not>
</condition>
</fail>
<mkdir dir="${webstart.dir}/www" />
<!-- Update latest version file -->
<echo file="${webstart.dir}/www/latestversion">PV${pathvisio.version}</echo>
<!-- Copy files needed for webstart !-->
<!--tsaurl="http://timestamp.comodoca.com/authenticode"-->
<signjar jar="pathvisio.jar" alias="b9490170-b550-11e5-ad7d-000c29471649" storetype="pkcs12" storepass="${keystore.password}" keystore="../Signing_Key.pfx" tsaurl="http://timestamp.comodoca.com" />
<copy file="pathvisio.jar" toDir="${webstart.dir}/www" />
<copy file="${webstart.dir}/pathvisio.jnlp" toDir="${webstart.dir}/www" />
<!-- modify the base url in the jnlp-->
<replace file="webstart/www/pathvisio.jnlp" token="#BASEURL#" value="${webstart.base.url}" />
</target>
<target name="docs" depends="prepare" description="generate api-docs">
<tstamp />
<!-- set ${TODAY} -->
<javadoc destdir="${apidoc.dir}" doctitle="PathVisio" header="Version ${pathvisio.version}" footer="Generated ${TODAY}">
<classpath>
<fileset dir="lib">
<include name="*.jar" />
</fileset>
</classpath>
<packageset dir="${src.dir}/org.pathvisio.core/src" />
<packageset dir="${src.dir}/org.pathvisio.pluginmanager/src" />
<packageset dir="${src.dir}/org.pathvisio.gui/src" />
<packageset dir="${src.dir}/org.pathvisio.desktop/src" />
<sourcepath>
<pathelement location="${src.dir}/org.pathvisio.core/src" />
<pathelement location="${src.dir}/org.pathvisio.pluginmanager/src" />
<pathelement location="${src.dir}/org.pathvisio.gui/src" />
<pathelement location="${src.dir}/org.pathvisio.desktop/src" />
</sourcepath>
</javadoc>
</target>
<target name="zip.src" description="create source tarball and zip">
<property name="srcbase" value="pathvisio_src-${pathvisio.version}" />
<zip destfile="${release.dir}/${srcbase}.zip">
<zipfileset dir="." prefix="pathvisio-${pathvisio.version}">
<include name="modules/**/*" />
<exclude name="modules/**/*.class" />
<include name="lib/**/*" />
<include name="lib-build/*.jar" />
<include name="resources/**/*" />
<include name="GPML.xsd" />
<include name="LICENSE-2.0.txt" />
<include name="NOTICE.txt" />
<include name="readme.txt" />
<include name="example-data/**/*" />
<include name="testData/**/*" />
<include name="build.xml" />
<include name="build-common.xml" />
<include name="pathvisio.sh" />
<include name="pathvisio.bat" />
</zipfileset>
</zip>
<tar destfile="${release.dir}/${srcbase}.tar.gz" compression="gzip">
<zipfileset src="${release.dir}/${srcbase}.zip" />
</tar>
</target>
<target name="zip.bin" depends="exe" description="create binary tarball and zip">
<property name="binbase" value="pathvisio_bin-${pathvisio.version}" />
<zip destfile="${release.dir}/${binbase}.zip">
<zipfileset dir="." prefix="pathvisio-${pathvisio.version}">
<include name="pathvisio.jar" />
<include name="LICENSE-2.0.txt" />
<include name="NOTICE.txt" />
<include name="readme.txt" />
<include name="pathvisio.sh" />
<include name="pathvisio.bat" />
</zipfileset>
</zip>
<tar destfile="${release.dir}/${binbase}.tar.gz" compression="gzip">
<zipfileset src="${release.dir}/${binbase}.zip" />
</tar>
</target>
<target name="zip" depends="zip.src,zip.bin" description="create both source and binary tarballs and zips" />
<target name="test" depends="desktop.jar">
<subant target="test" buildpath="modules/org.pathvisio.core/build.xml" />
<subant target="test" buildpath="modules/org.pathvisio.gui/build.xml" />
<subant target="test" buildpath="modules/org.pathvisio.desktop/build.xml" />
</target>
<taskdef resource="checkstyletask.properties" classpath="lib-build/checkstyle-all-5.0.jar" />
<target name="checkstyle">
<checkstyle config="pv_checks.xml">
<fileset dir="modules">
<include name="**/*.java" />
</fileset>
<formatter toFile="${checkstyle.output.file}" />
</checkstyle>
</target>
<target name="appbundler" depends="exe" description="Generate OS X Bundle">
<property name="app.name" value="PathVisio" />
<property name="app.icon" value="bigcateye.icns" />
<property name="app.dir" value="${release.dir}/${app.name}.app" />
<property name="app.executableName" value="JavaApplicationStub" />
<tstamp>
<format property="year" pattern="yyyy" />
</tstamp>
<mkdir dir="${app.dir}/Contents/Java" />
<mkdir dir="${app.dir}/Contents/MacOS" />
<mkdir dir="${app.dir}/Contents/Resources/en.lproj" />
<copy todir="${app.dir}/Contents/Java" file="pathvisio.jar" />
<copy todir="${app.dir}/Contents/MacOS" file="${app.executableName}" />
<copy todir="${app.dir}/Contents/Resources" file="lib-build/${app.icon}" />
<echo message="AAPL????" file="${app.dir}/Contents/PkgInfo" />
<copy todir="${app.dir}/Contents/" file="Info.plist" overwrite="true">
<filterset>
<filter token="PV_APP_NAME" value="${app.name}" />
<filter token="PV_APP_VERSION" value="${pathvisio.version}" />
<filter token="PV_APP_SHORT_VERSION" value="${pathvisio.version}" />
<filter token="PV_APP_ICON" value="${app.icon}" />
<filter token="PV_APP_COPYRIGHT" value="2022-${year} BiGCaT Bioinformatics" />
</filterset>
</copy>
<zip destfile="${release.dir}/${app.name}.app.zip">
<zipfileset prefix="${app.name}.app" dir="${app.dir}" excludes="${app.dir}/Contents/MacOS/${app.executableName}" />
<zipfileset prefix="${app.name}.app/Contents/MacOS" file="${app.dir}/Contents/MacOS/${app.executableName}" filemode="755" />
</zip>
<delete dir="${app.dir}" />
</target>
</project>