forked from cthiemann/SPaTo_Visual_Explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
230 lines (179 loc) · 8.9 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
<?xml version="1.0" ?>
<project name="SPaTo Visual Explorer" default="help">
<target name="help" description="Show this help text">
<java classname="org.apache.tools.ant.Main"><arg value="-projecthelp" /></java>
</target>
<target name="clean" description="Clear build directory">
<delete dir="build" />
</target>
<!-- Raw Java stuff (compile & run) -->
<target name="compile" description="Compile all sources (application & prelude)">
<mkdir dir="build/classes" />
<javac srcdir="src" destdir="build/classes"
target="1.5" source="1.5" debug="true" encoding="UTF-8" includeantruntime="false">
<classpath><fileset dir="lib"><include name="**/*.jar" /></fileset></classpath>
<compilerarg value="-Xlint" />
</javac>
</target>
<target name="run" depends="compile" description="Run the application (without prelude)">
<java classname="net.spato.sve.app.SPaTo_Visual_Explorer" fork="true">
<classpath>
<pathelement location="build/classes" />
<fileset dir="lib"><include name="**/*.jar" /></fileset>
</classpath>
</java>
</target>
<target name="javadoc" depends="compile"><!-- description="Create javadoc documentation"> -->
<javadoc sourcepath="src" destdir="docs/javadoc">
<classpath>
<pathelement location="build/classes" />
<fileset dir="lib"><include name="**/*.jar" /></fileset>
</classpath>
<link href="http://download.oracle.com/javase/1.5.0/docs/api/" />
<link href="http://processing.googlecode.com/svn/trunk/processing/build/javadoc/core/" />
</javadoc>
</target>
<target name="compile-deploy" depends="compile">
<javac srcdir="deploy" includes="*.java" destdir="build/classes"
target="1.5" source="1.5" debug="true" encoding="UTF-8" includeantruntime="false">
<classpath>
<pathelement location="build/classes" />
<pathelement location="lib/core.jar" />
</classpath>
<compilerarg value="-Xlint" />
</javac>
</target>
<target name="version" depends="compile-deploy">
<java classname="SPaTo_Version" classpath="build/classes" fork="true" />
</target>
<!-- Application package assembly -->
<target name="build" depends="build-linux, build-macosx, build-windows"
description="Create stand-alone applications (Linux, MacOS & Windows)" />
<target name="jars" depends="compile">
<jar destfile="build/SPaTo_Visual_Explorer.jar" basedir="build/classes" includes="net/spato/sve/app/**" />
<jar destfile="build/SPaTo_Prelude.jar" basedir="build/classes" includes="net/spato/sve/prelude/**, UpdateInstaller*.class" />
</target>
<fileset dir="." id="bin.common">
<include name="build/classes/SPaTo_Prelude.class" />
<include name="build/SPaTo_*.jar" />
<include name="lib/*.jar" />
<exclude name="lib/WinRun4J.jar" />
</fileset>
<target name="build-linux" depends="jars">
<mkdir dir="build/linux" />
<copy todir="build/linux">
<fileset dir="deploy/linux"><include name="SPaTo Visual Explorer/**" /></fileset>
</copy>
<chmod dir="build/linux/SPaTo Visual Explorer" includes="SPaTo_Visual_Explorer" perm="a+x" />
<copy todir="build/linux/SPaTo Visual Explorer/lib" flatten="true">
<fileset refid="bin.common" />
</copy>
</target>
<target name="build-macosx" depends="jars, version">
<mkdir dir="build/macosx" />
<copy todir="build/macosx">
<fileset dir="deploy/macosx"><include name="SPaTo Visual Explorer.app/**" /></fileset>
</copy>
<chmod dir="build/macosx/SPaTo Visual Explorer.app/Contents/MacOS" includes="**" perm="a+x" />
<chmod dir="build/macosx/SPaTo Visual Explorer.app/Contents/Resources" includes="restart.sh" perm="a+x" />
<copy todir="build/macosx/SPaTo Visual Explorer.app/Contents/Resources/Java" flatten="true">
<fileset refid="bin.common" />
</copy>
<property file="build/version.properties" />
<concat destfile="build/macosx/SPaTo Visual Explorer.app/Contents/Info.plist">
<filelist dir="deploy/macosx/SPaTo Visual Explorer.app/Contents" files="Info.plist" />
<filterchain><expandproperties /></filterchain>
</concat>
</target>
<target name="build-windows" depends="jars">
<mkdir dir="build/windows" />
<copy todir="build/windows">
<fileset dir="deploy/windows"><include name="SPaTo Visual Explorer/**" /></fileset>
</copy>
<copy todir="build/windows/SPaTo Visual Explorer/lib" flatten="true">
<fileset refid="bin.common" />
<fileset dir="lib" includes="WinRun4J.jar" />
</copy>
</target>
<!-- Deployment (dmg/tar.gz/zip packages) -->
<target name="dist" depends="dist-linux, dist-macosx, dist-windows"
description="Create distributable application archives (dmg, tar.gz & zip)">
</target>
<target name="dist-linux" depends="build-linux">
<tar destfile="build/linux/SPaTo_Visual_Explorer.tar.gz" basedir="build/linux" compression="gzip">
<include name="SPaTo Visual Explorer/**" />
</tar>
</target>
<target name="dist-macosx" depends="build-macosx">
<dependset>
<srcfileset dir="build/macosx/SPaTo Visual Explorer.app" />
<targetfileset dir="build/macosx" includes="SPaTo_Visual_Explorer.dmg" />
</dependset>
<exec executable="deploy/macosx/create_dmg.sh" />
</target>
<target name="dist-windows" depends="build-windows">
<zip destfile="build/windows/SPaTo_Visual_Explorer.zip" basedir="build/windows" level="9">
<include name="SPaTo Visual Explorer/**" />
</zip>
</target>
<!-- Deployment (auto-update) -->
<target name="dist-update" depends="compile-deploy, build"
description="Create directory containing auto-update files">
<mkdir dir="build/update" />
<exec executable="deploy/private-key-password.sh" outputproperty="private.key.password" />
<copy file="build/windows/SPaTo Visual Explorer/SPaTo Visual Explorer.exe"
tofile="build/windows/SPaTo Visual Explorer/lib/_SPaTo_Visual_Explorer.exe" />
<copy file="build/windows/SPaTo Visual Explorer/lib/WinRun4J.jar"
tofile="build/windows/SPaTo Visual Explorer/lib/_WinRun4J.jar" />
<java classname="SPaTo_Update_Builder" fork="true">
<arg value="${private.key.password}" />
<classpath>
<pathelement location="build/classes" />
<pathelement location="lib/core.jar" />
</classpath>
</java>
<delete dir="build/windows/SPaTo Visual Explorer/lib" includes="_SPaTo_Visual_Explorer.exe, _WinRun4J.jar" />
</target>
<!-- Deployment (upload to webserver) -->
<target name="upload" depends="version, dist, dist-update"
description="Upload binary packages and auto-update files to webserver">
<property file="build/version.properties" />
<mkdir dir="build/download" />
<copy todir="build/download">
<fileset dir="build/linux" includes="SPaTo_Visual_Explorer.tar.gz" />
<fileset dir="build/macosx" includes="SPaTo_Visual_Explorer.dmg" />
<fileset dir="build/windows" includes="SPaTo_Visual_Explorer.zip" />
<globmapper from="SPaTo_Visual_Explorer*" to="SPaTo_Visual_Explorer_${version.download}*" />
</copy>
<property name="ftp.host" value="wp255.webpack.hosteurope.de" />
<property name="ftp.user" value="ftp1032083-spato" />
<exec executable="deploy/ftp-password.sh" outputproperty="ftp.password" />
<echo message="This will upload version ${version.update} to spato.net." />
<echo message="Version ${version.update} will go live immediately!" />
<input message="Press Enter to continue, Ctrl-C to cancel..." />
<property name="ftp.dir.download" value="/www/download" />
<ftp server="${ftp.host}" userid="${ftp.user}" password="${ftp.password}"
remotedir="${ftp.dir.download}" action="mkdir" />
<ftp server="${ftp.host}" userid="${ftp.user}" password="${ftp.password}"
remotedir="${ftp.dir.download}" verbose="yes">
<fileset dir="build/download" />
</ftp>
<property name="ftp.dir.update" value="/update/${version.update}" />
<ftp server="${ftp.host}" userid="${ftp.user}" password="${ftp.password}"
remotedir="${ftp.dir.update}" action="mkdir" />
<ftp server="${ftp.host}" userid="${ftp.user}" password="${ftp.password}"
remotedir="${ftp.dir.update}" verbose="yes">
<fileset dir="build/update" />
</ftp>
<property name="ftp.dir.release-notes" value="/update/release-notes" />
<ftp server="${ftp.host}" userid="${ftp.user}" password="${ftp.password}"
remotedir="${ftp.dir.release-notes}" action="mkdir" />
<ftp server="${ftp.host}" userid="${ftp.user}" password="${ftp.password}"
remotedir="${ftp.dir.release-notes}" verbose="yes">
<fileset dir="docs/release-notes" />
</ftp>
<get src="http://update.spato.net/symlink.php?latest=${version.update}&magic=${ftp.password}"
dest="build/update-symlink.txt" />
<concat><filelist dir="build" files="update-symlink.txt" /></concat>
</target>
</project>