forked from anti43/openyabs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
641 lines (590 loc) · 32.8 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
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
<?xml version="1.0" encoding="UTF-8"?>
<!-- For automated build task using asl
<project name="yabs" default="dist">
<property name="java-build.src-dir" location="src"/>
<import file="asl/asl-java-build.xml"/>
<property name="java-build.src-dir" location="src/main/java"/>
<property name="java-build.lib-dir" location="lib"/>
<property name="java-build.classes-dir" location="${common.target-dir}/classes"/>
<property name="java-build.dist-ext" value=".jar"/>
<property name="java-build.dist-filename" value="${ant.project.name}${java-build.dist-ext}"/>
<property name="java-build.dist-file" location="${common.dist-dir}/${java-build.dist-filename}"/>
<property name="java-build.jar-dir" location="${common.dist-dir}"/>
<property name="java-build.jar-file" location="${java-build.dist-file}"/>
<property name="java-build.source-ver" value="1.5"/>
<property name="java-build.target-ver" value="1.5"/>
<property name="java-build.debug" value="on"/>
<property name="java-build.jar-main-class" value="mpv5.Main"/>
<target name="copy-resources"
description="Copies resources in preparation to be packaged in jar">
<copy todir="${java-build.classes-dir}">
<fileset dir="${java-build.src-dir}">
<exclude name="**/*.java"/>
</fileset>
</copy>
<copy todir="${common.dist-dir}/lib" flatten="true" includeEmptyDirs="false">
<fileset dir="${java-build.lib-dir}">
<include name="**/*.jar"/>
<include name="**/*.so"/>
<include name="**/*.dll"/>
</fileset>
</copy>
</target>
</project>
-->
<project name="yabs" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
<description>Builds, tests, and runs the project yabs.</description>
<import file="nbproject/build-impl.xml"/>
<target name="-post-compile">
<copy todir="${dist.dir}/lib">
<fileset dir="lib/jni/" />
</copy>
</target>
<!-- Uncomment this section to build the rpm
<rpm
specFile="yabs1.spec"
topDir="install/rpm"
cleanBuildDir="true"
failOnError="true"/>
-->
<!-- Uncomment this section to sign the jars
<target name="-post-jar">
<exec dir="${dist.dir}/../security" executable="./generate_key.sh" os="Linux" failonerror="false"/>
<exec dir="${dist.dir}/../security" executable="./signjars.sh" os="Linux" failonerror="false" />
</target>
Build a .deb:
apt-get install alien
alien paketname.rpm
dpkg -i paketname.deb
-->
<target name="package-for-store" depends="jar">
<!-- Change the value of this property to be the name of your JAR,
minus the .jar extension. It should not have spaces.
<property name="store.jar.name" value="MyJarName"/>
-->
<property name="store.jar.name" value="yabs"/>
<!-- don't edit below this line -->
<property name="store.dir" value="store"/>
<property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/>
<echo message="Packaging ${application.title} into a single JAR at ${store.jar}"/>
<delete dir="${store.dir}"/>
<mkdir dir="${store.dir}"/>
<jar destfile="${store.dir}/temp_final.jar" filesetmanifest="skip">
<zipgroupfileset dir="dist" includes="*.jar"/>
<zipgroupfileset dir="dist/lib" includes="*.jar"/>
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
</manifest>
</jar>
<zip destfile="${store.jar}">
<zipfileset src="${store.dir}/temp_final.jar"
excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA"/>
</zip>
<delete file="${store.dir}/temp_final.jar"/>
</target>
<target name="build-native" depends="-set-do-build-native-package, -check-ant-jre-supports-native-packaging, -check-native-packager-external-tools, -fx-jar-impl, -build-native-own, -build-native-own2, -post-build-native-cleanup, -copy-to-install"/>
<target name="-copy-to-install">
<delete dir="${deployment.dir}/../install/mac" includeEmptyDirs="true" quiet="true"/>
<copy todir="${deployment.dir}/../install/mac" preservelastmodified="true" overwrite="true">
<fileset dir="${deployment.dir}/bundles/"/>
</copy>
</target>
<target name="-build-native-own" depends="-check-ant-jre-supports-native-packaging, -check-native-packager-external-tools, -fx-jar-impl">
<echo message="javafx.ant.classpath = ${javafx.ant.classpath}" level="verbose"/>
<typedef name="fx_deploy" classname="com.sun.javafx.tools.ant.DeployFXTask" classpath="${javafx.ant.classpath}"/>
<echo message="Launching <fx:deploy> task from ${ant-javafx.jar.location}" level="info"/>
<property name="deployment.dir" location="${dist.dir}"/>
<property name="pp_deploy_fs2" value="lib${file.separator}*.jar"/>
<basename property="deployment.jar" file="${dist.jar}"/>
<basename property="deployment.base" file="${deployment.jar}" suffix=".jar"/>
<echo message="deploy_deploy: pp_deploy_fs2 = ${pp_deploy_fs2}" level="verbose"/>
<echo message="deploy_deploy: deployment.dir = ${deployment.dir}" level="verbose"/>
<echo message="deploy_deploy: deployment.jar = ${deployment.jar}" level="verbose"/>
<echo message="deploy_deploy: deployment.base = ${deployment.base}" level="verbose"/>
<echo message="JavaScript: deploy-deploy" level="verbose"/>
<script language="javascript">
<![CDATA[
function isTrue(prop) {
return prop != null &&
(prop.toLowerCase()=="true" || prop.toLowerCase()=="yes" || prop.toLowerCase()=="on");
}
function prefix(s, len) {
if(s == null || len <= 0 || s.length == 0) {
return new String("");
}
return new String(s.substr(0, len));
}
function replaceSuffix(s, os, ns) {
return prefix(s, s.indexOf(os)).concat(ns);
}
function startsWith(s, prefix) {
return (s != null) && (s.indexOf(prefix) == 0);
}
function endsWith(s, suffix) {
var i = s.lastIndexOf(suffix);
return (i != -1) && (i == (s.length - suffix.length));
}
function defined(s) {
return (s != null) && (s != "null") && (s.length > 0);
}
function contains(array, prop) {
for (var i = 0; i < array.length; i++) {
var s1 = new String(array[i]);
var s2 = new String(prop);
if( s1.toLowerCase() == s2.toLowerCase() ) {
return true;
}
}
return false;
}
var S = java.io.File.separator;
var JFXLAZY = "download.mode.lazy.jar";
var fx_ant_api_1_1 = new String(project.getProperty("have-fx-ant-api-1.1"));
var fx_ant_api_1_2 = new String(project.getProperty("have-fx-ant-api-1.2"));
var have_jdk_pre7u14 = new String(project.getProperty("have-jdk-pre7u14"));
// get jars with lazy download mode property set
function getLazyJars() {
var jars = new Array();
var keys = project.getProperties().keys();
while(keys.hasMoreElements()) {
var pn = new String(keys.nextElement());
if(startsWith(pn, JFXLAZY)) {
var fname = pn.substring(JFXLAZY.length+1);
jars.push(fname);
}
}
return jars.length > 0 ? jars : null;
}
// set download mode of dependent libraries
function setDownloadMode(fsEager, fsLazy, jars) {
for(var i = 0; i < jars.length; i++) {
fsEager.setExcludes("lib" + S + jars[i]);
fsLazy.setIncludes("lib" + S + jars[i]);
}
}
// convert path to absolute if relative
function derelativizePath(path) {
var f = new java.io.File(path);
if(!f.exists()) {
f = new java.io.File(new String(project.getBaseDir()) + S + path);
}
if(f.exists()) {
try {
return f.getCanonicalPath();
} catch(err) {
return path;
}
}
return path;
}
// fx:deploy
var deploy = project.createTask("fx_deploy");
deploy.setProject(project);
var width = new String(project.getProperty("javafx.width"));
var height = new String(project.getProperty("javafx.height"));
var outdir = new String(project.getProperty("deployment.dir"));
var outfile = new String(project.getProperty("application.title"));
if(!defined(width)) width=new String("0");
if(!defined(height)) height=new String("0");
deploy.setWidth(width);
deploy.setHeight(height);
deploy.setOutdir(outdir);
deploy.setOutfile(outfile);
deploy.setVerbose(true);
// native packaging (time consuming, thus applied in explicit build only)
var nativeEnabled = new String(project.getProperty("do.build.native.package"));
var nativeType = new String(project.getProperty("native.bundling.type"));
var projStateRun = new String(project.getProperty("project.state.running"));
var projStateDbg = new String(project.getProperty("project.state.debugging"));
var projStatePrf = new String(project.getProperty("project.state.profiling"));
if(isTrue(nativeEnabled) && defined(nativeType) && nativeType != "none") {
if(!isTrue(projStateRun) && !isTrue(projStateDbg) && !isTrue(projStatePrf)) {
if(isTrue(fx_ant_api_1_2)) {
deploy.setNativeBundles(nativeType);
print("Note: To create native bundles the <fx:deploy> task may require external tools. See JavaFX 2.2+ documentation for details.");
print("");
print("Launching <fx:deploy> in native packager mode ..." + nativeType);
} else {
print("Warning: Native packaging is not supported by this version of JavaFX SDK deployment Ant task. Please upgrade to JDK 7u6 or higher.");
}
}
}
// fx:application
var app = deploy.createApplication();
app.setProject(project);
var title = new String(project.getProperty("application.title"));
var mainclass;
mainclass = new String(project.getProperty("main.class"));
if(isTrue(fx_ant_api_1_2)) {
app.setToolkit("swing");
}
var appversion = new String(project.getProperty("application.implementation.version"));
if(defined(appversion)) {
app.setVersion(appversion);
} else {
app.setVersion("1.0");
}
var appname = new String(project.getProperty("application.implementation.name"));
app.setName(title + " - " + appname + " (incl. JRE)");
app.setMainClass(mainclass);
// fx:resources
var res = deploy.createResources();
res.setProject(project);
var deploydir = new String(project.getProperty("deployment.dir"));
var fn = res.createFileSet();
fn.setProject(project);
fn.setDir(new java.io.File(deploydir));
var ia = new String(project.getProperty("deployment.jar"));
var ib = new String(project.getProperty("pp_deploy_fs2"));
fn.setIncludes(ia);
fn.setIncludes(ib);
fn.setRequiredFor("startup");
var lazyjars = getLazyJars();
if(lazyjars != null) {
var fn2 = res.createFileSet();
fn2.setProject(project);
fn2.setDir(new java.io.File(deploydir));
fn2.setRequiredFor("runtime");
setDownloadMode(fn,fn2,lazyjars);
}
// fx:info
var info = deploy.createInfo();
info.setProject(project);
var vendor = new String(project.getProperty("application.vendor"));
var description = new String(project.getProperty("application.desc"));
info.setTitle(title); // title known from before
info.setVendor(vendor);
info.setDescription(description);
var splash = new String(project.getProperty("deploy.splash.image"));
if(defined(splash)) {
if(isTrue(fx_ant_api_1_1)) {
var sicon = info.createSplash();
sicon.setHref(splash);
sicon.setMode("any");
print("Adding splash image reference: " + splash);
} else {
print("Warning: Splash Image not supported by this version of JavaFX SDK deployment Ant task. Please upgrade JavaFX to 2.0.2 or higher.");
}
}
if(isTrue(nativeEnabled) && defined(nativeType) && nativeType != "none") {
var icon = new String(project.getProperty("deploy.icon.native"));
if(defined(icon)) {
if(isTrue(fx_ant_api_1_2) && !isTrue(have_jdk_pre7u14)) {
var dicon = derelativizePath(icon);
// create temporary icon copy renamed to application name (required by native packager)
var baseDir = new String(project.getProperty("basedir"));
var buildDir = new String(project.getProperty("build.dir"));
var deployBase = new String(project.getProperty("deployment.base"));
var copyTask = project.createTask("copy");
var source = new java.io.File(dicon);
var sourceName = new String(source.getName());
var lastDot = sourceName.lastIndexOf(".");
var sourceExt;
if(lastDot >=0) {
sourceExt = sourceName.substr(lastDot);
} else {
sourceExt = new String("");
}
var target = new java.io.File(baseDir.concat(S).concat(buildDir).concat(S).concat("icon").concat(S).concat(deployBase).concat(sourceExt));
copyTask.setFile(source);
copyTask.setTofile(target);
copyTask.setFlatten(true);
copyTask.setFailOnError(false);
copyTask.perform();
var tempicon;
if(target.exists()) {
try {
tempicon = target.getCanonicalPath();
} catch(err) {
tempicon = dicon;
}
} else {
tempicon = dicon;
}
var nicon = info.createIcon();
nicon.setHref(tempicon);
print("Source native icon reference: " + dicon);
print("Processed native icon reference: " + tempicon);
} else {
print("Warning: Native Package icon not supported by this version of JavaFX SDK deployment Ant task. Please upgrade to JDK7u14.");
}
}
} else {
var icon = new String(project.getProperty("deploy.icon.webstart"));
if(defined(icon)) {
if(isTrue(fx_ant_api_1_1)) {
var iicon = info.createIcon();
iicon.setHref(icon);
print("Adding WebStart icon reference: " + icon);
} else {
print("Warning: WebStart Icon not supported by this version of JavaFX SDK deployment Ant task. Please upgrade JavaFX to 2.0.2 or higher.");
}
}
}
deploy.perform();
app.setName(title + " - " + appname);
//fx:platform
var plf = deploy.createPlatform();
plf.setBasedir("");
//fx:bundleArgument (to fix W/O JRE BUG)
//<fx:bundleArgument arg="launcher-cfg-format" value="prop"/>
var bdlArg = deploy.createBundleArgument();
bdlArg.setArg("launcher-cfg-format");
bdlArg.setValue("prop");
//fx:bundleArgument (to fix DMG Mac BUG)
var bdlArg = deploy.createBundleArgument();
bdlArg.setArg("mac.dmg.simple");
bdlArg.setValue("true");
//deploy.perform();
]]>
</script>
</target>
<target name="-build-native-own2" depends="-check-ant-jre-supports-native-packaging, -check-native-packager-external-tools, -fx-jar-impl">
<echo message="javafx.ant.classpath = ${javafx.ant.classpath}" level="verbose"/>
<typedef name="fx_deploy" classname="com.sun.javafx.tools.ant.DeployFXTask" classpath="${javafx.ant.classpath}"/>
<echo message="Launching <fx:deploy> task from ${ant-javafx.jar.location}" level="info"/>
<property name="deployment.dir" location="${dist.dir}"/>
<property name="pp_deploy_fs2" value="lib${file.separator}*.jar"/>
<basename property="deployment.jar" file="${dist.jar}"/>
<basename property="deployment.base" file="${deployment.jar}" suffix=".jar"/>
<echo message="deploy_deploy: pp_deploy_fs2 = ${pp_deploy_fs2}" level="verbose"/>
<echo message="deploy_deploy: deployment.dir = ${deployment.dir}" level="verbose"/>
<echo message="deploy_deploy: deployment.jar = ${deployment.jar}" level="verbose"/>
<echo message="deploy_deploy: deployment.base = ${deployment.base}" level="verbose"/>
<echo message="JavaScript: deploy-deploy" level="verbose"/>
<script language="javascript">
<![CDATA[
function isTrue(prop) {
return prop != null &&
(prop.toLowerCase()=="true" || prop.toLowerCase()=="yes" || prop.toLowerCase()=="on");
}
function prefix(s, len) {
if(s == null || len <= 0 || s.length == 0) {
return new String("");
}
return new String(s.substr(0, len));
}
function replaceSuffix(s, os, ns) {
return prefix(s, s.indexOf(os)).concat(ns);
}
function startsWith(s, prefix) {
return (s != null) && (s.indexOf(prefix) == 0);
}
function endsWith(s, suffix) {
var i = s.lastIndexOf(suffix);
return (i != -1) && (i == (s.length - suffix.length));
}
function defined(s) {
return (s != null) && (s != "null") && (s.length > 0);
}
function contains(array, prop) {
for (var i = 0; i < array.length; i++) {
var s1 = new String(array[i]);
var s2 = new String(prop);
if( s1.toLowerCase() == s2.toLowerCase() ) {
return true;
}
}
return false;
}
var S = java.io.File.separator;
var JFXLAZY = "download.mode.lazy.jar";
var fx_ant_api_1_1 = new String(project.getProperty("have-fx-ant-api-1.1"));
var fx_ant_api_1_2 = new String(project.getProperty("have-fx-ant-api-1.2"));
var have_jdk_pre7u14 = new String(project.getProperty("have-jdk-pre7u14"));
// get jars with lazy download mode property set
function getLazyJars() {
var jars = new Array();
var keys = project.getProperties().keys();
while(keys.hasMoreElements()) {
var pn = new String(keys.nextElement());
if(startsWith(pn, JFXLAZY)) {
var fname = pn.substring(JFXLAZY.length+1);
jars.push(fname);
}
}
return jars.length > 0 ? jars : null;
}
// set download mode of dependent libraries
function setDownloadMode(fsEager, fsLazy, jars) {
for(var i = 0; i < jars.length; i++) {
fsEager.setExcludes("lib" + S + jars[i]);
fsLazy.setIncludes("lib" + S + jars[i]);
}
}
// convert path to absolute if relative
function derelativizePath(path) {
var f = new java.io.File(path);
if(!f.exists()) {
f = new java.io.File(new String(project.getBaseDir()) + S + path);
}
if(f.exists()) {
try {
return f.getCanonicalPath();
} catch(err) {
return path;
}
}
return path;
}
// fx:deploy
var deploy = project.createTask("fx_deploy");
deploy.setProject(project);
var width = new String(project.getProperty("javafx.width"));
var height = new String(project.getProperty("javafx.height"));
var outdir = new String(project.getProperty("deployment.dir"));
var outfile = new String(project.getProperty("application.title"));
if(!defined(width)) width=new String("0");
if(!defined(height)) height=new String("0");
deploy.setWidth(width);
deploy.setHeight(height);
deploy.setOutdir(outdir);
deploy.setOutfile(outfile);
deploy.setVerbose(true);
// native packaging (time consuming, thus applied in explicit build only)
var nativeEnabled = new String(project.getProperty("do.build.native.package"));
var nativeType = new String(project.getProperty("native.bundling.type"));
var projStateRun = new String(project.getProperty("project.state.running"));
var projStateDbg = new String(project.getProperty("project.state.debugging"));
var projStatePrf = new String(project.getProperty("project.state.profiling"));
if(isTrue(nativeEnabled) && defined(nativeType) && nativeType != "none") {
if(!isTrue(projStateRun) && !isTrue(projStateDbg) && !isTrue(projStatePrf)) {
if(isTrue(fx_ant_api_1_2)) {
deploy.setNativeBundles(nativeType);
print("Note: To create native bundles the <fx:deploy> task may require external tools. See JavaFX 2.2+ documentation for details.");
print("");
print("Launching <fx:deploy> in native packager mode ..." + nativeType);
} else {
print("Warning: Native packaging is not supported by this version of JavaFX SDK deployment Ant task. Please upgrade to JDK 7u6 or higher.");
}
}
}
// fx:application
var app = deploy.createApplication();
app.setProject(project);
var title = new String(project.getProperty("application.title"));
var mainclass;
mainclass = new String(project.getProperty("main.class"));
if(isTrue(fx_ant_api_1_2)) {
app.setToolkit("swing");
}
var appversion = new String(project.getProperty("application.implementation.version"));
if(defined(appversion)) {
app.setVersion(appversion);
} else {
app.setVersion("1.0");
}
var appname = new String(project.getProperty("application.implementation.name"));
app.setName(title + " - " + appname);
app.setMainClass(mainclass);
// fx:resources
var res = deploy.createResources();
res.setProject(project);
var deploydir = new String(project.getProperty("deployment.dir"));
var fn = res.createFileSet();
fn.setProject(project);
fn.setDir(new java.io.File(deploydir));
var ia = new String(project.getProperty("deployment.jar"));
var ib = new String(project.getProperty("pp_deploy_fs2"));
fn.setIncludes(ia);
fn.setIncludes(ib);
fn.setRequiredFor("startup");
var lazyjars = getLazyJars();
if(lazyjars != null) {
var fn2 = res.createFileSet();
fn2.setProject(project);
fn2.setDir(new java.io.File(deploydir));
fn2.setRequiredFor("runtime");
setDownloadMode(fn,fn2,lazyjars);
}
// fx:info
var info = deploy.createInfo();
info.setProject(project);
var vendor = new String(project.getProperty("application.vendor"));
var description = new String(project.getProperty("application.desc"));
info.setTitle(title); // title known from before
info.setVendor(vendor);
info.setDescription(description);
var splash = new String(project.getProperty("deploy.splash.image"));
if(defined(splash)) {
if(isTrue(fx_ant_api_1_1)) {
var sicon = info.createSplash();
sicon.setHref(splash);
sicon.setMode("any");
print("Adding splash image reference: " + splash);
} else {
print("Warning: Splash Image not supported by this version of JavaFX SDK deployment Ant task. Please upgrade JavaFX to 2.0.2 or higher.");
}
}
if(isTrue(nativeEnabled) && defined(nativeType) && nativeType != "none") {
var icon = new String(project.getProperty("deploy.icon.native"));
if(defined(icon)) {
if(isTrue(fx_ant_api_1_2) && !isTrue(have_jdk_pre7u14)) {
var dicon = derelativizePath(icon);
// create temporary icon copy renamed to application name (required by native packager)
var baseDir = new String(project.getProperty("basedir"));
var buildDir = new String(project.getProperty("build.dir"));
var deployBase = new String(project.getProperty("deployment.base"));
var copyTask = project.createTask("copy");
var source = new java.io.File(dicon);
var sourceName = new String(source.getName());
var lastDot = sourceName.lastIndexOf(".");
var sourceExt;
if(lastDot >=0) {
sourceExt = sourceName.substr(lastDot);
} else {
sourceExt = new String("");
}
var target = new java.io.File(baseDir.concat(S).concat(buildDir).concat(S).concat("icon").concat(S).concat(deployBase).concat(sourceExt));
copyTask.setFile(source);
copyTask.setTofile(target);
copyTask.setFlatten(true);
copyTask.setFailOnError(false);
copyTask.perform();
var tempicon;
if(target.exists()) {
try {
tempicon = target.getCanonicalPath();
} catch(err) {
tempicon = dicon;
}
} else {
tempicon = dicon;
}
var nicon = info.createIcon();
nicon.setHref(tempicon);
print("Source native icon reference: " + dicon);
print("Processed native icon reference: " + tempicon);
} else {
print("Warning: Native Package icon not supported by this version of JavaFX SDK deployment Ant task. Please upgrade to JDK7u14.");
}
}
} else {
var icon = new String(project.getProperty("deploy.icon.webstart"));
if(defined(icon)) {
if(isTrue(fx_ant_api_1_1)) {
var iicon = info.createIcon();
iicon.setHref(icon);
print("Adding WebStart icon reference: " + icon);
} else {
print("Warning: WebStart Icon not supported by this version of JavaFX SDK deployment Ant task. Please upgrade JavaFX to 2.0.2 or higher.");
}
}
}
//fx:platform
var plf = deploy.createPlatform();
plf.setBasedir("");
//fx:bundleArgument (to fix W/O JRE BUG)
//<fx:bundleArgument arg="launcher-cfg-format" value="prop"/>
var bdlArg = deploy.createBundleArgument();
bdlArg.setArg("launcher-cfg-format");
bdlArg.setValue("prop");
//fx:bundleArgument (to fix DMG Mac BUG)
var bdlArg = deploy.createBundleArgument();
bdlArg.setArg("mac.dmg.simple");
bdlArg.setValue("true");
deploy.perform();
]]>
</script>
</target>
</project>