-
Notifications
You must be signed in to change notification settings - Fork 104
/
build.xml
329 lines (303 loc) · 17 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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
<!-- for some information on what you could do (e.g. targets to override). -->
<!-- If you delete this file and reopen the project it will be recreated. -->
<project name="jme-gde" basedir=".">
<description>Builds the module suite jme-gde.</description>
<import file="nbproject/build-impl.xml"/>
<!--Load ant extensions-->
<path id="ant-import.classpath">
<fileset dir="ant-lib/" includes="*.jar"/>
</path>
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="ant-import.classpath"/>
<taskdef resource="com/jme/ant/ant-jme.properties" classpathref="ant-import.classpath"/>
<taskdef name="deb" classname="com.googlecode.ant_deb_task.Deb" classpathref="ant-import.classpath"/>
<taskdef name="desktopentry" classname="com.googlecode.ant_deb_task.DesktopEntry" classpathref="ant-import.classpath"/>
<!--override branding target to include netbeans config file creation, using this target makes sure init was called-->
<target name="branding" depends="-create-netbeans-config, -set-base-version, -zip-templates, suite.branding"/>
<!--updates the help sets-->
<target name="update-help-sets" description="Loads the wiki pages from the web and converts them to JavaHelp html for manual.">
<ant antfile="build.xml" target="update-help-sets" inheritall="false" inheritrefs="false" dir="jme3-documentation/"/>
</target>
<target name="update-nb-dependencies" description="Updates the dependencies of all projects to the currently used platform module versions">
<property file="nbproject/project.properties"/>
<foreach target="-update-nb-dep" list="${modules}" delimiter=":" param="module_dir" inheritall="true"/>
</target>
<target name="-update-nb-dep">
<updatenbdeps projectFile="${module_dir}/nbproject/project.xml" platformFolder="../netbeans"/>
</target>
<target name="-create-netbeans-config">
<!--replaces default values in jmonkeyplatform.conf file with run.args.extra from project.properties-->
<mkdir dir="build/launcher/etc"/>
<property name="jdkhome.string" value='#jdkhome="/path/to/jdk"'/>
<copy file="${harness.dir}/etc/app.conf" tofile="build/launcher/etc/${app.name}.conf" overwrite="true">
<filterchain>
<replacestring from="$${branding.token}" to="${branding.token} ${run.args.extra}"/>
<replacestring from='#jdkhome="/path/to/jdk"' to ='${jdkhome.string}'/>
</filterchain>
</copy>
</target>
<!--zips up the templates and adds them to the template project-->
<target name="-zip-templates" description="Updates the template zip files">
<zip basedir="BasicGameTemplate/" destfile="jme3-templates/src/com/jme3/gde/templates/BasicGameProject.zip">
<exclude name="**/build/"/>
<exclude name="**/dist/"/>
<exclude name="**/nbproject/private/"/>
<exclude name="**/*.keep"/>
</zip>
<zip basedir="JME3TestsTemplate/" destfile="jme3-tests-template/src/com/jme3/gde/templates/tests/JmeTestsProject.zip">
<exclude name="**/build/"/>
<exclude name="**/dist/"/>
<exclude name="**/nbproject/private/"/>
</zip>
<zip basedir="JME3TestsTemplateAndroid/" destfile="jme3-tests-template/src/com/jme3/gde/templates/tests/JME3TestsAndroidProject.zip">
<exclude name="**/build/"/>
<exclude name="**/dist/"/>
<exclude name="**/mobile/assets/"/>
<exclude name="**/mobile/bin/"/>
<exclude name="**/mobile/gen/"/>
<exclude name="**/mobile/libs/"/>
<exclude name="**/mobile/local.properties"/>
<exclude name="**/mobile/private/"/>
<exclude name="**/nbproject/private/"/>
</zip>
</target>
<target name="-set-base-version" description ="sets/unsets base version to major version for all plugins, updates branding version">
<!--sets/unsets base version to major version (e.g. 3.0.1) for all plugins-->
<foreach target="-do-base-version" list="${modules}" delimiter=":" param="module_dir" inheritall="true"/>
<!--sets version to application branding files-->
<replaceregexp file="${basedir}/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties"
match="currentVersion=(.*)"
replace="currentVersion=${app.title} ${app.version}"
byline="true"/>
<replaceregexp file="${basedir}/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties"
match="CTL_MainWindow_Title=(.*)"
replace="CTL_MainWindow_Title=${app.title} ${app.version}"
byline="true"/>
<replaceregexp file="${basedir}/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties"
match="CTL_MainWindow_Title_No_Project=(.*)"
replace="CTL_MainWindow_Title_No_Project=${app.title} ${app.version}"
byline="true"/>
<!--propertyfile
file="${basedir}/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties"
comment="Updated by build script">
<entry key="currentVersion" value="${app.title} ${app.version}" />
</propertyfile-->
<!--propertyfile
file="${basedir}/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties"
comment="Updated by build script">
<entry key="CTL_MainWindow_Title" value="${app.title} ${app.version}" />
<entry key="CTL_MainWindow_Title_No_Project" value="${app.title} ${app.version}" />
</propertyfile-->
</target>
<target name="-do-base-version">
<!--propertyfile
file="${module_dir}/nbproject/project.properties"
comment="Updated by build script">
<entry key="spec.version.base" value="${plugins.version}" />
</propertyfile-->
<updatesdkdeps projectfile="${module_dir}/nbproject/project.xml" version="${plugins.version}" basepackage="com.jme3.gde"/>
<replace file="${module_dir}/nbproject/project.xml" token=' standalone="no"?>' value="?>${line.separator}"/>
<replaceregexp file="${module_dir}/nbproject/project.properties"
match="spec.version.base=(.*)"
replace="spec.version.base=${plugins.version}"
byline="true"/>
</target>
<!--
****************************************************************
Only Relevant for building nightly on Hudson server from here on
****************************************************************
-->
<!--creates update center version via hudson build server (update-help-sets, )-->
<target name="hudson-nightly" depends="suite.clean, set-impl-version, suite.nbms, unset-impl-version">
</target>
<!--to be used after release, sets version number sans svn revision-->
<target name="hudson-stable" depends="suite.clean, set-spec-version, suite.nbms, unset-spec-version">
</target>
<!--builds release installers-->
<target name="hudson-release" depends="suite.clean, set-spec-version, build-installers, unset-spec-version">
</target>
<target name="set-spec-version">
<property file="nbproject/project.properties"/>
<foreach target="-do-spec-version" list="${modules}" delimiter=":" param="module_dir" inheritall="true">
<param name="set_spec_version" value="true"/>
</foreach>
</target>
<target name="unset-spec-version">
<property file="nbproject/project.properties"/>
<foreach target="-do-spec-version" list="${modules}" delimiter=":" param="module_dir" inheritall="true">
<param name="set_spec_version" value="false"/>
</foreach>
</target>
<!--sets/unsets specification version to major version (e.g. 3.0.1) for all plugins-->
<target name="-do-spec-version">
<if>
<equals arg1="${set_spec_version}" arg2="true"/>
<then>
<replaceregexp file="${module_dir}/manifest.mf"
match="OpenIDE-Module-Implementation-Version:(.*)"
replace="OpenIDE-Module-Specification-Version: ${plugins.version}"
byline="true"/>
<replaceregexp file="${module_dir}/nbproject/project.properties"
match="#*spec\.version\.base"
replace="#spec.version.base"
byline="true"/>
</then>
<else>
<replaceregexp file="${module_dir}/manifest.mf"
match="OpenIDE-Module-Specification-Version:(.*)"
replace="OpenIDE-Module-Implementation-Version: 0"
byline="true"/>
<replaceregexp file="${module_dir}/nbproject/project.properties"
match="#*spec\.version\.base"
replace="spec.version.base"
byline="true"/>
</else>
</if>
</target>
<target name="set-impl-version">
<property file="nbproject/project.properties"/>
<foreach target="-do-impl-version" list="${modules}" delimiter=":" param="module_dir" inheritall="true">
<param name="set_impl_version" value="true"/>
</foreach>
</target>
<target name="unset-impl-version">
<property file="nbproject/project.properties"/>
<foreach target="-do-impl-version" list="${modules}" delimiter=":" param="module_dir" inheritall="true">
<param name="set_impl_version" value="false"/>
</foreach>
</target>
<!--sets/unsets implementation version to GIT revision for plugins-->
<target name="-do-impl-version">
<if>
<equals arg1="${set_impl_version}" arg2="true"/>
<then>
<echo>Setting implementation version for ${module_dir} to revision: ${nbm.revision}</echo>
<replace file="${module_dir}/manifest.mf" token="OpenIDE-Module-Implementation-Version: 0" value="OpenIDE-Module-Implementation-Version: ${nbm.revision}"/>
</then>
<else>
<echo>Removing implementation version for ${module_dir} from revision: ${nbm.revision}</echo>
<replace file="${module_dir}/manifest.mf" token="OpenIDE-Module-Implementation-Version: ${nbm.revision}" value="OpenIDE-Module-Implementation-Version: 0"/>
</else>
</if>
</target>
<target name="build-installers">
<property environment="env" />
<property file="nbproject/project.properties"/>
<!-- handle different environment variables to split the long build-installers process -->
<if>
<and>
<not>
<isset property="env.BUILD_X64"/>
</not>
<not>
<isset property="env.BUILD_X86"/>
</not>
<not>
<isset property="env.BUILD_OTHER"/>
</not>
</and>
<then>
<echo message="No platform specified, building all platforms"/>
<property name="generate.installer.for.platforms" value="windows-x64 linux-x64 macosx"/>
</then>
<else>
<if>
<equals arg1="${env.BUILD_X64}" arg2="true"/>
<then>
<property name="temp.platform1" value="windows-x64 linux-x64 "/>
<echo message="Building for the X64 architecture"/>
</then>
<else>
<property name="temp.platform1" value="" /> <!-- So it isn't undefined -->
</else>
</if>
<if>
<equals arg1="${env.BUILD_X86}" arg2="true"/>
<then>
<property name="temp.platform2" value="windows-x86 " />
<echo message="Building for the X86 architecture "/>
</then>
<else>
<property name="temp.platform2" value="" /> <!-- So it isn't undefined -->
</else>
</if>
<if>
<equals arg1="${env.BUILD_OTHER}" arg2="true"/>
<then>
<property name="temp.platform3" value="macosx"/>
<echo message="Building for Mac OS X"/>
</then>
<else>
<property name="temp.platform3" value="" /> <!-- So it isn't undefined -->
</else>
</if>
<!-- Since properties are immutable we needed temporary values -->
<property name="generate.installer.for.platforms" value="${temp.platform1}${temp.platform2}${temp.platform3}"/>
</else>
</if>
<ant antfile="template.xml" dir="nbi/stub">
<property name="suite.location" value="${basedir}"/>
<property name="suite.nbi.product.uid" value="${app.name}"/>
<!--TODO: this is .0.2 because of the pre-release static 3.0.0, else the RCs could not be installed next to a beta-->
<property name="suite.nbi.product.version" value="${plugins.version}.0.${nbm.revision}"/>
<property name="nbi.stub.location" value="${basedir}/nbi/stub"/>
<property name="nbi.stub.common.location" value="${basedir}/nbi/.common"/>
<property name="nbi.ant.tasks.jar" value="${basedir}/nbi/antlib/nbi-ant-tasks.jar"/>
<property name="nbi.registries.management.jar" value="${basedir}/nbi/antlib/nbi-registries-management.jar"/>
<property name="nbi.engine.jar" value="${basedir}/nbi/antlib/nbi-engine.jar"/>
<property name="nbi.license.file" value="${basedir}/licenses-sdk.txt"/>
<!-- <property name="generate.installer.for.platforms" value="windows-x86 windows-x64 linux-x86 linux-x64 macosx"/> -->
<property name="generator-jdk-location-forward-slashes" value="${java.home}"/>
<property name="generated-installers-location-forward-slashes" value="${basedir}/build/installer"/>
<property name="pack200.enabled" value="false"/>
<property name="nbi.icon.file" value="${basedir}/jmonkeyplatform.png"/>
<property name="nbi.dock.icon.file" value="${basedir}/jmonkeyplatform.icns"/>
<property name="product.description" value="${app.description}"/>
<property name="product.categories" value="${app.categories}"/>
</ant>
</target>
<target name="build-zip-for-installer" depends="-set-bundled-jdkhome, suite.build-zip"/>
<target name="-set-bundled-jdkhome">
<property name="jdkhome.string" value='jdkhome="jdk"'/>
</target>
<!--creates a debian package from the installer-->
<target name="create-deb-package" depends="suite.build-zip">
<unzip src="${dist.dir}/${app.name}.zip" dest="${dist.dir}/${app.name}">
<globmapper from="${app.name}/*" to="*"/>
</unzip>
<desktopentry
toFile="build/${app.name}.desktop"
name="${app.title}"
comment="${app.title}"
exec="/opt/${app.name}/bin/${app.name}"
icon="/opt/${app.name}/${app.name}.png"
categories="Development;Java"
/>
<deb toDir="dist"
package="jme3-sdk"
version="${app.version}"
section="devel"
depends="sun-java6-jdk"
maintainer="jMonkeyEngine"
homepage="http://www.jmonkeyengine.org"
postrm="debscripts/postrm"
>
<tarfileset dir="dist/${app.name}/" prefix="opt/${app.name}">
<exclude name="bin/**"/>
</tarfileset>
<tarfileset dir="dist/${app.name}/bin" prefix="opt/${app.name}/bin" filemode="755">
<exclude name="*.exe"/>
</tarfileset>
<tarfileset file="build/${app.name}.desktop" prefix="usr/share/applications"/>
<tarfileset file="${app.name}.png" prefix="opt/${app.name}"/>
<description synopsis="jMonkeyEngine3 SDK is a complete solution for Java OpenGL game development.">
jMonkeyEngine 3 was rebuilt from the ground up to be a modern 3D game engine,
compatible with OpenGL 2.0 and above.
Its architecture is shader-based, making it fully capable of current and
next generation graphics standards. The jMonkeyEngine SDK gives you a complete IDE
for coding and for managing and creating game assets.
</description>
</deb>
</target>
</project>