-
Notifications
You must be signed in to change notification settings - Fork 24
/
base.xml
executable file
·238 lines (206 loc) · 8.95 KB
/
base.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
<project xmlns:if="ant:if" xmlns:unless="ant:unless">
<!--these should be set before importing this file to override default behavior-->
<property name="apptype" value="window"/>
<property name="ico" value="${app}.ico"/>
<property name="cfg" value="${app}.cfg"/>
<property name="jarpath" value="."/>
<property name="lib" value="${home}/lib"/>
<property name="maven-app-version" value="${maven}/${app}/${version}"/>
<property name="debian.depends" value="javaforce"/>
<property name="fedora.depends" value="javaforce"/>
<property name="arch.depends" value="javaforce"/>
<import file="versions.xml"/>
<target name="javadoc" description="generate java documentation archive">
<delete dir="javadoc"/>
<mkdir dir="javadoc"/>
<javadoc sourcepath="src" destdir="javadoc">
<classpath>
<fileset refid="classpath"/>
</classpath>
<arg value="-Xdoclint:none"/>
<arg value="-quiet"/>
</javadoc>
<zip destfile="${app}-javadoc.jar">
<fileset dir="javadoc" includes="**/*"/>
</zip>
</target>
<target name="src" description="generate src archive">
<zip destfile="${app}-sources.jar">
<fileset dir="src" includes="**/*"/>
</zip>
</target>
<property environment="environment"/>
<target name="maven" depends="src,javadoc,jar" description="generate deployment artifacts for maven">
<copy file="${app}.jar" tofile="${app}-${version}.jar"/>
<copy file="${app}-javadoc.jar" tofile="${app}-${version}-javadoc.jar"/>
<copy file="${app}-sources.jar" tofile="${app}-${version}-sources.jar"/>
<copy file="pom.xml" tofile="${app}-${version}.pom"/>
</target>
<target name="sign" depends="maven" description="sign maven deployment artifacts (generates asc,md5,sha1 files)">
<delete>
<fileset dir="." includes="${app}-${version}*.asc"/>
<fileset dir="." includes="${app}-${version}*.md5"/>
<fileset dir="." includes="${app}-${version}*.sha1"/>
</delete>
<!-- generate .asc files -->
<exec command="gpg --no-tty --batch --passphrase ${environment.GPG_PASSPHRASE} -ab ${app}-${version}.jar"/>
<exec command="gpg --no-tty --batch --passphrase ${environment.GPG_PASSPHRASE} -ab ${app}-${version}-sources.jar"/>
<exec command="gpg --no-tty --batch --passphrase ${environment.GPG_PASSPHRASE} -ab ${app}-${version}-javadoc.jar"/>
<exec command="gpg --no-tty --batch --passphrase ${environment.GPG_PASSPHRASE} -ab ${app}-${version}.pom"/>
<!-- generate .md5 files -->
<checksum file="${app}-${version}.jar" algorithm="md5"/>
<checksum file="${app}-${version}-sources.jar" algorithm="md5"/>
<checksum file="${app}-${version}-javadoc.jar" algorithm="md5"/>
<checksum file="${app}-${version}.pom" algorithm="md5"/>
<!-- generate .sha1 files -->
<checksum file="${app}-${version}.jar" algorithm="sha1"/>
<checksum file="${app}-${version}-sources.jar" algorithm="sha1"/>
<checksum file="${app}-${version}-javadoc.jar" algorithm="sha1"/>
<checksum file="${app}-${version}.pom" algorithm="sha1"/>
</target>
<target name="deploy" depends="sign" description="generate deployment artifacts archive and upload to maven">
<sequential>
<mkdir dir="${maven-app-version}"/>
<copy todir="${maven-app-version}">
<fileset dir=".">
<include name="${app}-${version}*.jar"/>
<include name="${app}-${version}*.pom"/>
<include name="${app}-${version}*.asc"/>
<include name="${app}-${version}*.md5"/>
<include name="${app}-${version}*.sha1"/>
</fileset>
</copy>
<delete file="central-bundle.zip"/>
<zip destfile="central-bundle.zip">
<fileset dir=".">
<include name="${maven-app-version}/**/*"/>
</fileset>
</zip>
<delete dir="${maven-app-version}"/>
<java classpath="${home}/javaforce.jar" classname="javaforce.utils.Publish" fork="true" jvm="${home}/bin/jfexec">
<arg value="central-bundle.zip"/>
<arg value="USER_MANAGED"/>
</java>
</sequential>
</target>
<target name="depnatives">
<!-- legacy task when javaforce native code was in shared libraries -->
</target>
<target name="ffmpeg">
<copy todir=".">
<fileset dir="${home}/ffmpeg-bin/${ffmpeg-version}" includes="*.dll"/>
<fileset dir="${home}/ffmpeg-bin/${ffmpeg-version}" includes="*.so"/>
<fileset dir="${home}/ffmpeg-bin/${ffmpeg-version}" includes="*.dylib"/>
</copy>
</target>
<macrodef name="download">
<attribute name="url"/>
<attribute name="dest"/>
<sequential>
<!-- exists property is not working -->
<local name="exists"/>
<available property="exists" file="@{dest}"/>
<get unless:true="exists" src="@{url}" dest="@{dest}" usetimestamp="true"/>
</sequential>
</macrodef>
<macrodef name="maven">
<attribute name="path"/> <!-- groupId -->
<attribute name="name"/> <!-- artifactId -->
<attribute name="version"/> <!-- version -->
<attribute name="repo" default="https://repo1.maven.org/maven2"/>
<attribute name="dest" default="@{name}"/>
<sequential>
<download url="@{repo}/@{path}/@{name}/@{version}/@{name}-@{version}.jar" dest="${lib}/@{dest}-@{version}.jar"/>
</sequential>
</macrodef>
<macrodef name="copyjar">
<attribute name="name"/>
<attribute name="path"/>
<attribute name="version"/>
<attribute name="suffix" default=""/>
<sequential>
<copy file="${lib}/@{name}-@{version}@{suffix}.jar" tofile="@{path}/@{name}.jar"/>
</sequential>
</macrodef>
<import file="install-jars.xml"/>
<target name="executable" depends="jar,depjars,depnatives" description="create executable launcher">
<sequential>
<java classpath="${home}/javaforce.jar" classname="javaforce.utils.GenExecutable" fork="true" jvm="${home}/bin/jfexec">
<arg value="${ant.file}"/>
</java>
</sequential>
</target>
<target name="graalmeta" depends="" description="build meta jar file">
<jar destfile="meta.jar" includes="META-INF/**/*" basedir=".">
</jar>
</target>
<target name="graal" depends="jar,depjars,graalmeta" description="generate aot library">
<java classpath="${home}/javaforce.jar" classname="javaforce.utils.ExecGraal" fork="true" jvm="${home}/bin/jfexec">
<arg value="${ant.file}"/>
</java>
</target>
<target name="graalagent">
<java classpath="${home}/javaforce.jar" classname="javaforce.utils.ExecGraalAgent" fork="true" jvm="${home}/bin/jfexec">
<arg value="${ant.file}"/>
</java>
</target>
<target name="run">
<sequential>
<java classpath="${home}/javaforce.jar" classname="javaforce.utils.ExecProject" fork="true" jvm="${home}/bin/jfexec">
<arg value="${ant.file}"/>
</java>
</sequential>
</target>
<!-- Windows targets -->
<target name="msi" depends="executable" description="create msi package">
<java classpath="${home}/javaforce.jar" classname="javaforce.utils.GenMSI" fork="true" jvm="${home}/bin/jfexec">
<arg value="${ant.file}"/>
</java>
</target>
<!-- Linux targets -->
<target name="installapp" depends="executable">
<sequential>
<exec command="sudo ant -f ${ant.file} installapproot"/>
</sequential>
</target>
<target name="installapproot">
<!-- this will run "install" target in project as root including sub-projects -->
<java classpath="${home}/javaforce.jar" classname="javaforce.utils.InstallProject" fork="true" jvm="${home}/bin/jfexec">
<arg value="${ant.file}"/>
</java>
</target>
<target name="uninstallapp" depends="">
<sequential>
<exec command="sudo ant -f ${ant.file} uninstallapproot"/>
</sequential>
</target>
<target name="uninstallapproot">
<java classpath="${home}/javaforce.jar" classname="javaforce.utils.UninstallProject" fork="true" jvm="${home}/bin/jfexec">
<arg value="${ant.file}"/>
</java>
</target>
<target name="deb" depends="installapp" description="create deb package">
<java classpath="${home}/javaforce.jar" classname="javaforce.utils.GenDEB" fork="true" jvm="${home}/bin/jfexec">
<arg value="${ant.file}"/>
<arg value="${debian.depends}"/>
</java>
</target>
<target name="rpm" depends="installapp" description="create rpm package">
<java classpath="${home}/javaforce.jar" classname="javaforce.utils.GenRPM" fork="true" jvm="${home}/bin/jfexec">
<arg value="${ant.file}"/>
<arg value="${fedora.depends}"/>
</java>
</target>
<target name="pac" depends="installapp" description="create pac package">
<java classpath="${home}/javaforce.jar" classname="javaforce.utils.GenPAC" fork="true" jvm="${home}/bin/jfexec">
<arg value="${ant.file}"/>
<arg value="${arch.depends}"/>
</java>
</target>
<!-- MacOSX targets -->
<target name="dmg" depends="executable" description="create dmg package">
<java classpath="${home}/javaforce.jar" classname="javaforce.utils.GenDMG" fork="true" jvm="${home}/bin/jfexec">
<arg value="${ant.file}"/>
</java>
</target>
</project>