comparison KinaMine-Galaxy-7-7/nbproject/jfx-impl_backup_1.xml @ 0:67635b462045 draft

Uploaded
author jfb
date Tue, 20 Feb 2018 14:31:15 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:67635b462045
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 *** GENERATED FROM TEMPLATE - DO NOT EDIT ***
4 *** EDIT ../build.xml INSTEAD ***
5 -->
6
7 <project name="jfx-impl" default="jfx-deployment" basedir=".." xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1"
8 xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:fx="javafx:com.sun.javafx.tools.ant">
9 <description>JavaFX-specific Ant calls</description>
10
11
12 <!-- Empty placeholders for easier customization in ../build.xml -->
13
14 <target name="-pre-jfx-jar">
15 <!-- Called right before <fx:jar> task. You can override this target in the ../build.xml file. -->
16 </target>
17
18 <target name="-post-jfx-jar">
19 <!-- Called right after <fx:jar> task. You can override this target in the ../build.xml file. -->
20 </target>
21
22 <target name="-pre-jfx-deploy">
23 <!-- Called right before <fx:deploy> task. You can override this target in the ../build.xml file. -->
24 </target>
25
26 <target name="-post-jfx-deploy">
27 <!-- Called right after <fx:deploy> task. You can override this target in the ../build.xml file. -->
28 </target>
29
30 <target name="-pre-jfx-native">
31 <!-- Called right before the call to native packager (just after -pre-jfx-deploy). You can override this target in the ../build.xml file. -->
32 </target>
33
34 <target name="-post-jfx-native">
35 <!-- Called right after the call to native packager (just after -post-jfx-deploy). You can override this target in the ../build.xml file. -->
36 </target>
37
38
39 <!-- Check system and JDK version -->
40
41 <target name="-check-operating-system">
42 <condition property="running.on.mac">
43 <os family="mac"/>
44 </condition>
45 <condition property="running.on.unix">
46 <os family="unix"/>
47 </condition>
48 <condition property="running.on.windows">
49 <os family="windows"/>
50 </condition>
51 <echo message="running.on.mac = ${running.on.mac}" level="verbose"/>
52 <echo message="running.on.unix = ${running.on.unix}" level="verbose"/>
53 <echo message="running.on.windows = ${running.on.windows}" level="verbose"/>
54 </target>
55
56 <target name="-check-platform-home-fxsdk-java" depends="-check-property-javafx.sdk" if="javafx.sdk.defined">
57 <condition property="do.set.platform.home.fxsdk.java">
58 <and>
59 <not><isset property="active.platform.home.java.executable"/></not>
60 <or>
61 <available file="${javafx.sdk}${file.separator}bin${file.separator}java"/>
62 <available file="${javafx.sdk}${file.separator}bin${file.separator}java.exe"/>
63 </or>
64 </and>
65 </condition>
66 </target>
67 <target name="-set-platform-home-fxsdk-java" depends="-check-platform-home-fxsdk-java" if="do.set.platform.home.fxsdk.java">
68 <property name="active.platform.home.java.executable" value="${javafx.sdk}${file.separator}bin${file.separator}java"/>
69 </target>
70 <target name="-check-platform-home-java" if="platform.home">
71 <condition property="do.set.platform.home.java">
72 <and>
73 <not><isset property="active.platform.home.java.executable"/></not>
74 <or>
75 <available file="${platform.home}${file.separator}bin${file.separator}java"/>
76 <available file="${platform.home}${file.separator}bin${file.separator}java.exe"/>
77 </or>
78 </and>
79 </condition>
80 </target>
81 <target name="-set-platform-home-java" depends="-set-platform-home-fxsdk-java,-check-platform-home-java" if="do.set.platform.home.java">
82 <property name="active.platform.home.java.executable" value="${platform.home}${file.separator}bin${file.separator}java"/>
83 </target>
84 <target name="-check-platform-home-probjdk-java" unless="active.platform.home.java.executable">
85 <condition property="do.set.platform.home.probjdk.java">
86 <and>
87 <not><isset property="active.platform.home.java.executable"/></not>
88 <or>
89 <available file="${java.home}${file.separator}..${file.separator}bin${file.separator}java"/>
90 <available file="${java.home}${file.separator}..${file.separator}bin${file.separator}java.exe"/>
91 </or>
92 </and>
93 </condition>
94 </target>
95 <target name="-set-platform-home-probjdk-java" depends="-set-platform-home-java,-check-platform-home-probjdk-java" if="do.set.platform.home.probjdk.java">
96 <property name="active.platform.home.java.executable" value="${java.home}${file.separator}..${file.separator}bin${file.separator}java"/>
97 </target>
98 <target name="-check-platform-home-envjdk-java" unless="active.platform.home.java.executable">
99 <property environment="env"/>
100 <condition property="do.set.platform.home.envjdk.java">
101 <and>
102 <not><isset property="active.platform.home.java.executable"/></not>
103 <or>
104 <available file="${env.JAVA_HOME}${file.separator}bin${file.separator}java"/>
105 <available file="${env.JAVA_HOME}${file.separator}bin${file.separator}java.exe"/>
106 </or>
107 </and>
108 </condition>
109 </target>
110 <target name="-set-platform-home-envjdk-java" depends="-set-platform-home-probjdk-java,-check-platform-home-envjdk-java" if="do.set.platform.home.envjdk.java">
111 <property environment="env"/>
112 <property name="active.platform.home.java.executable" value="${env.JAVA_HOME}${file.separator}bin${file.separator}java"/>
113 </target>
114 <target name="-check-platform-home-fxrt-java" depends="-check-property-javafx.runtime" if="javafx.runtime.defined">
115 <condition property="do.set.platform.home.fxrt.java">
116 <and>
117 <not><isset property="active.platform.home.java.executable"/></not>
118 <or>
119 <available file="${javafx.runtime}${file.separator}bin${file.separator}java"/>
120 <available file="${javafx.runtime}${file.separator}bin${file.separator}java.exe"/>
121 </or>
122 </and>
123 </condition>
124 </target>
125 <target name="-set-platform-home-fxrt-java" depends="-set-platform-home-envjdk-java,-check-platform-home-fxrt-java" if="do.set.platform.home.fxrt.java">
126 <property name="active.platform.home.java.executable" value="${javafx.runtime}${file.separator}bin${file.separator}java"/>
127 <echo message="Warning: java executable not found in JDK, evaluating java executable in RT instead." level="info"/>
128 </target>
129 <target name="-check-platform-home-jre-java" unless="active.platform.home.java.executable">
130 <condition property="do.set.platform.home.jre.java">
131 <and>
132 <not><isset property="active.platform.home.java.executable"/></not>
133 <or>
134 <available file="${java.home}${file.separator}bin${file.separator}java"/>
135 <available file="${java.home}${file.separator}bin${file.separator}java.exe"/>
136 </or>
137 </and>
138 </condition>
139 </target>
140 <target name="-set-platform-home-jre-java" depends="-set-platform-home-fxrt-java,-check-platform-home-jre-java" if="do.set.platform.home.jre.java">
141 <property name="active.platform.home.java.executable" value="${java.home}${file.separator}bin${file.separator}java"/>
142 <echo message="Warning: java executable not found in JDK, evaluating java executable in RT instead." level="info"/>
143 </target>
144 <target name="-check-platform-home" depends="-set-platform-home-jre-java">
145 <echo message="active.platform.home.java.executable = ${active.platform.home.java.executable}" level="verbose"/>
146 <fail message="Error:${line.separator}java executable not found !" unless="active.platform.home.java.executable"/>
147 </target>
148
149 <target name="-check-jdk-version" depends="-do-init,-check-platform-home" unless="jdk-version-checked-in-jfximpl">
150 <local name="version-output"/>
151 <exec executable="${active.platform.home.java.executable}" outputproperty="version-output">
152 <arg value="-version"/>
153 </exec>
154 <echo message="version-output:${line.separator}${version-output}" level="verbose"/>
155 <condition property="have-jdk-older-than-1.6">
156 <or>
157 <contains string="${version-output}" substring="java version &quot;1.0"/>
158 <contains string="${version-output}" substring="java version &quot;1.1"/>
159 <contains string="${version-output}" substring="java version &quot;1.2"/>
160 <contains string="${version-output}" substring="java version &quot;1.3"/>
161 <contains string="${version-output}" substring="java version &quot;1.4"/>
162 <contains string="${version-output}" substring="java version &quot;1.5"/>
163 </or>
164 </condition>
165 <fail message="Error:${line.separator}JavaFX 2.0+ projects require JDK version 1.6+ !" if="have-jdk-older-than-1.6"/>
166 <condition property="have-jdk-7u4or5-mac">
167 <and>
168 <or>
169 <contains string="${version-output}" substring="java version &quot;1.7.0_04"/>
170 <contains string="${version-output}" substring="java version &quot;1.7.0_05"/>
171 </or>
172 <os family="mac"/>
173 </and>
174 </condition>
175 <condition property="have-jdk-pre7u6">
176 <or>
177 <isset property="have-jdk-older-than-1.6"/>
178 <contains string="${version-output}" substring="java version &quot;1.6"/>
179 <contains string="${version-output}" substring="java version &quot;1.7.0&quot;"/>
180 <contains string="${version-output}" substring="java version &quot;1.7.0_01"/>
181 <contains string="${version-output}" substring="java version &quot;1.7.0_02"/>
182 <contains string="${version-output}" substring="java version &quot;1.7.0_03"/>
183 <contains string="${version-output}" substring="java version &quot;1.7.0_04"/>
184 <contains string="${version-output}" substring="java version &quot;1.7.0_05"/>
185 </or>
186 </condition>
187 <condition property="have-jdk-pre7u14">
188 <or>
189 <isset property="have-jdk-pre7u6"/>
190 <contains string="${version-output}" substring="java version &quot;1.7.0_06"/>
191 <contains string="${version-output}" substring="java version &quot;1.7.0_07"/>
192 <contains string="${version-output}" substring="java version &quot;1.7.0_08"/>
193 <contains string="${version-output}" substring="java version &quot;1.7.0_09"/>
194 <contains string="${version-output}" substring="java version &quot;1.7.0_10"/>
195 <contains string="${version-output}" substring="java version &quot;1.7.0_11"/>
196 <contains string="${version-output}" substring="java version &quot;1.7.0_12"/>
197 <contains string="${version-output}" substring="java version &quot;1.7.0_13"/>
198 </or>
199 </condition>
200 <property name="jdk-version-checked-in-jfximpl" value="true"/>
201 <echo message="have-jdk-7u4or5-mac = ${have-jdk-7u4or5-mac}" level="verbose"/>
202 <echo message="have-jdk-pre7u6 = ${have-jdk-pre7u6}" level="verbose"/>
203 <echo message="have-jdk-pre7u14 = ${have-jdk-pre7u14}" level="verbose"/>
204 </target>
205
206 <target name="-check-ant-jre-version" unless="ant-jre-version-checked-in-jfximpl">
207 <local name="version-output"/>
208 <exec executable="${java.home}${file.separator}bin${file.separator}java" outputproperty="version-output">
209 <arg value="-version"/>
210 </exec>
211 <echo message="version-output:${line.separator}${version-output}" level="verbose"/>
212 <condition property="have-ant-jre-pre7u6">
213 <or>
214 <contains string="${version-output}" substring="java version &quot;1.0"/>
215 <contains string="${version-output}" substring="java version &quot;1.1"/>
216 <contains string="${version-output}" substring="java version &quot;1.2"/>
217 <contains string="${version-output}" substring="java version &quot;1.3"/>
218 <contains string="${version-output}" substring="java version &quot;1.4"/>
219 <contains string="${version-output}" substring="java version &quot;1.5"/>
220 <contains string="${version-output}" substring="java version &quot;1.6"/>
221 <contains string="${version-output}" substring="java version &quot;1.7.0&quot;"/>
222 <contains string="${version-output}" substring="java version &quot;1.7.0_01"/>
223 <contains string="${version-output}" substring="java version &quot;1.7.0_02"/>
224 <contains string="${version-output}" substring="java version &quot;1.7.0_03"/>
225 <contains string="${version-output}" substring="java version &quot;1.7.0_04"/>
226 <contains string="${version-output}" substring="java version &quot;1.7.0_05"/>
227 </or>
228 </condition>
229 <condition property="have-jdk7-css2bin-bug">
230 <!-- as of NB7.4 release date the external css-to-bss converter is unreliable in all JDK7 versions before 7u40 (with exception of 7u14)-->
231 <and>
232 <contains string="${version-output}" substring="java version &quot;1.7"/>
233 <not><matches string="${version-output}" pattern="\bjava version &quot;1\.7\.0_(14|[4-9].)"/></not>
234 </and>
235 </condition>
236 <property name="ant-jre-version-checked-in-jfximpl" value="true"/>
237 <echo message="have-ant-jre-pre7u6 = ${have-ant-jre-pre7u6}" level="verbose"/>
238 <echo message="have-jdk7-css2bin-bug = ${have-jdk7-css2bin-bug}" level="verbose"/>
239 </target>
240
241 <target name="-check-jdk-7u4or5-mac" depends="-check-jdk-version" if="have-jdk-7u4or5-mac">
242 <fail message="Error:${line.separator}JDK 7u4 Mac and 7u5 Mac do not support WebStart and JavaFX 2.0+ browser plugin technologies.${line.separator}Please upgrade to JDK 7u6 or later."/>
243 </target>
244
245
246 <!-- Check availability of JavaFX SDK deployment support (ant-javafx.jar) -->
247
248 <target name="-check-endorsed-javafx-ant-classpath">
249 <condition property="endorsed-javafx-ant-classpath-available">
250 <and>
251 <isset property="endorsed.javafx.ant.classpath"/>
252 <not>
253 <equals arg1="${endorsed.javafx.ant.classpath}" arg2=""/>
254 </not>
255 </and>
256 </condition>
257 <echo message="endorsed-javafx-ant-classpath-available = ${endorsed-javafx-ant-classpath-available}" level="verbose"/>
258 </target>
259
260 <target name="-check-property-javafx.sdk">
261 <echo message="javafx.sdk = ${javafx.sdk}" level="verbose"/>
262 <condition property="javafx.sdk.defined">
263 <and>
264 <isset property="javafx.sdk"/>
265 <not><contains string="${javafx.sdk}" substring="$${platform" casesensitive="false"/></not>
266 </and>
267 </condition>
268 <condition property="javafx.sdk.missing+default">
269 <and>
270 <equals arg1="${platform.active}" arg2="Default_JavaFX_Platform" trim="true"/>
271 <not><isset property="javafx.sdk.defined"/></not>
272 </and>
273 </condition>
274 <condition property="javafx.sdk.missing-default">
275 <and>
276 <not><equals arg1="${platform.active}" arg2="Default_JavaFX_Platform" trim="true"/></not>
277 <not><isset property="javafx.sdk.defined"/></not>
278 </and>
279 </condition>
280 <echo message="javafx.sdk.defined = ${javafx.sdk.defined}" level="verbose"/>
281 <echo message="javafx.sdk.missing+default = ${javafx.sdk.missing+default}" level="verbose"/>
282 <echo message="javafx.sdk.missing-default = ${javafx.sdk.missing-default}" level="verbose"/>
283 </target>
284
285 <target name="-check-ant-javafx-in-fxsdk-lib" depends="-check-property-javafx.sdk" if="javafx.sdk.defined">
286 <condition property="do.set.ant-javafx.in.fxsdk.lib">
287 <and>
288 <not><isset property="ant-javafx.jar.location"/></not>
289 <available file="${javafx.sdk}${file.separator}lib${file.separator}ant-javafx.jar"/>
290 </and>
291 </condition>
292 </target>
293 <target name="-set-ant-javafx-in-fxsdk-lib" depends="-check-ant-javafx-in-fxsdk-lib" if="do.set.ant-javafx.in.fxsdk.lib">
294 <property name="ant-javafx.jar.location" value="${javafx.sdk}${file.separator}lib${file.separator}ant-javafx.jar"/>
295 </target>
296 <target name="-check-ant-javafx-in-fxsdk-tools" depends="-check-property-javafx.sdk" if="javafx.sdk.defined">
297 <condition property="do.set.ant-javafx.in.fxsdk.tools">
298 <and>
299 <not><isset property="ant-javafx.jar.location"/></not>
300 <available file="${javafx.sdk}${file.separator}tools${file.separator}ant-javafx.jar"/>
301 </and>
302 </condition>
303 </target>
304 <target name="-set-ant-javafx-in-fxsdk-tools" depends="-set-ant-javafx-in-fxsdk-lib,-check-ant-javafx-in-fxsdk-tools" if="do.set.ant-javafx.in.fxsdk.tools">
305 <property name="ant-javafx.jar.location" value="${javafx.sdk}${file.separator}tools${file.separator}ant-javafx.jar"/>
306 </target>
307 <target name="-check-ant-javafx-in-platform-home-lib" if="platform.home">
308 <condition property="do.set.ant-javafx.in.platform.home.lib">
309 <and>
310 <not><isset property="ant-javafx.jar.location"/></not>
311 <available file="${platform.home}${file.separator}lib${file.separator}ant-javafx.jar"/>
312 </and>
313 </condition>
314 </target>
315 <target name="-set-ant-javafx-in-platform-home-lib" depends="-set-ant-javafx-in-fxsdk-tools,-check-ant-javafx-in-platform-home-lib" if="do.set.ant-javafx.in.platform.home.lib">
316 <property name="ant-javafx.jar.location" value="${platform.home}${file.separator}lib${file.separator}ant-javafx.jar"/>
317 </target>
318 <target name="-check-ant-javafx-in-platform-home-tools" if="platform.home">
319 <condition property="do.set.ant-javafx.in.platform.home.tools">
320 <and>
321 <not><isset property="ant-javafx.jar.location"/></not>
322 <available file="${platform.home}${file.separator}tools${file.separator}ant-javafx.jar"/>
323 </and>
324 </condition>
325 </target>
326 <target name="-set-ant-javafx-in-platform-home-tools" depends="-set-ant-javafx-in-platform-home-lib,-check-ant-javafx-in-platform-home-tools" if="do.set.ant-javafx.in.platform.home.tools">
327 <property name="ant-javafx.jar.location" value="${platform.home}${file.separator}tools${file.separator}ant-javafx.jar"/>
328 </target>
329 <target name="-check-ant-javafx-in-probjdk-lib" unless="ant-javafx.jar.location">
330 <condition property="do.set.ant-javafx.in.probjdk.lib">
331 <and>
332 <not><isset property="ant-javafx.jar.location"/></not>
333 <available file="${java.home}${file.separator}..${file.separator}lib${file.separator}ant-javafx.jar"/>
334 </and>
335 </condition>
336 </target>
337 <target name="-set-ant-javafx-in-probjdk-lib" depends="-set-ant-javafx-in-platform-home-tools,-check-ant-javafx-in-probjdk-lib" if="do.set.ant-javafx.in.probjdk.lib">
338 <property name="ant-javafx.jar.location" value="${java.home}${file.separator}..${file.separator}lib${file.separator}ant-javafx.jar"/>
339 </target>
340 <target name="-check-ant-javafx-in-probjdk-tools" unless="ant-javafx.jar.location">
341 <condition property="do.set.ant-javafx.in.probjdk.tools">
342 <and>
343 <not><isset property="ant-javafx.jar.location"/></not>
344 <available file="${java.home}${file.separator}..${file.separator}tools${file.separator}ant-javafx.jar"/>
345 </and>
346 </condition>
347 </target>
348 <target name="-set-ant-javafx-in-probjdk-tools" depends="-set-ant-javafx-in-probjdk-lib,-check-ant-javafx-in-probjdk-tools" if="do.set.ant-javafx.in.probjdk.tools">
349 <property name="ant-javafx.jar.location" value="${java.home}${file.separator}..${file.separator}tools${file.separator}ant-javafx.jar"/>
350 </target>
351 <target name="-check-ant-javafx-in-macjdk-lib" unless="ant-javafx.jar.location">
352 <condition property="do.set.ant-javafx.in.macjdk.lib">
353 <and>
354 <not><isset property="ant-javafx.jar.location"/></not>
355 <available file="${java.home}${file.separator}lib${file.separator}ant-javafx.jar"/>
356 </and>
357 </condition>
358 </target>
359 <target name="-set-ant-javafx-in-macjdk-lib" depends="-set-ant-javafx-in-probjdk-tools,-check-ant-javafx-in-macjdk-lib" if="do.set.ant-javafx.in.macjdk.lib">
360 <property name="ant-javafx.jar.location" value="${java.home}${file.separator}lib${file.separator}ant-javafx.jar"/>
361 </target>
362 <target name="-check-ant-javafx-in-envjdk-lib" unless="ant-javafx.jar.location">
363 <property environment="env"/>
364 <condition property="do.set.ant-javafx.in.envjdk.lib">
365 <and>
366 <not><isset property="ant-javafx.jar.location"/></not>
367 <available file="${env.JAVA_HOME}${file.separator}lib${file.separator}ant-javafx.jar"/>
368 </and>
369 </condition>
370 </target>
371 <target name="-set-ant-javafx-in-envjdk-lib" depends="-set-ant-javafx-in-macjdk-lib,-check-ant-javafx-in-envjdk-lib" if="do.set.ant-javafx.in.envjdk.lib">
372 <property name="ant-javafx.jar.location" value="${env.JAVA_HOME}${file.separator}lib${file.separator}ant-javafx.jar"/>
373 </target>
374 <target name="-check-ant-javafx-in-envjdk-tools" unless="ant-javafx.jar.location">
375 <property environment="env"/>
376 <condition property="do.set.ant-javafx.in.envjdk.tools">
377 <and>
378 <not><isset property="ant-javafx.jar.location"/></not>
379 <available file="${env.JAVA_HOME}${file.separator}tools${file.separator}ant-javafx.jar"/>
380 </and>
381 </condition>
382 </target>
383 <target name="-set-ant-javafx-in-envjdk-tools" depends="-set-ant-javafx-in-envjdk-lib,-check-ant-javafx-in-envjdk-tools" if="do.set.ant-javafx.in.envjdk.tools">
384 <property name="ant-javafx.jar.location" value="${env.JAVA_HOME}${file.separator}tools${file.separator}ant-javafx.jar"/>
385 </target>
386 <target name="-pre-check-ant-javafx-version" depends="-set-ant-javafx-in-envjdk-tools" unless="ant-javafx-version-already-checked-in-jfximpl">
387 <condition property="do.check.ant-javafx.version">
388 <and>
389 <isset property="ant-javafx.jar.location"/>
390 <not><isset property="ant-javafx-version-already-checked-in-jfximpl"/></not>
391 </and>
392 </condition>
393 </target>
394 <target name="-set-endorsed-javafx-ant-classpath" depends="-check-endorsed-javafx-ant-classpath,-pre-check-ant-javafx-version" if="endorsed-javafx-ant-classpath-available">
395 <property name="javafx.ant.classpath" value="${endorsed.javafx.ant.classpath}:${ant-javafx.jar.location}"/>
396 </target>
397 <target name="-set-javafx-ant-classpath" depends="-check-endorsed-javafx-ant-classpath,-pre-check-ant-javafx-version" unless="endorsed-javafx-ant-classpath-available">
398 <property name="javafx.ant.classpath" value="${ant-javafx.jar.location}"/>
399 </target>
400 <target name="-check-ant-javafx-version" depends="-pre-check-ant-javafx-version,
401 -set-endorsed-javafx-ant-classpath,-set-javafx-ant-classpath" if="do.check.ant-javafx.version">
402 <echo message="ant-javafx.jar.location = ${ant-javafx.jar.location}" level="verbose"/>
403 <echo message="javafx.ant.classpath = ${javafx.ant.classpath}" level="verbose"/>
404 <taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
405 uri="javafx:com.sun.javafx.tools.ant"
406 classpath="${javafx.ant.classpath}"/>
407 <condition property="have-fx-ant-init">
408 <typefound name="javafx:com.sun.javafx.tools.ant:init-ant"/>
409 </condition>
410 <property name="ant-javafx-version-already-checked-in-jfximpl" value="true"/>
411 <echo message="have-fx-ant-init = ${have-fx-ant-init}" level="verbose"/>
412 </target>
413 <target name="-check-jfx-sdk-version-old" depends="-check-ant-javafx-version" unless="have-fx-ant-init">
414 <property name="javafx.ant.version" value="1.0"/>
415 </target>
416 <target name="-check-jfx-sdk-version-new" depends="-check-ant-javafx-version" if="have-fx-ant-init">
417 <fx:init-ant/>
418 <condition property="have-fx-ant-api-1.1">
419 <!-- new features from JavaFX 2.0.2 are available in API version 1.1 or later -->
420 <matches pattern="1.[1-9]" string="${javafx.ant.version}"/>
421 </condition>
422 <condition property="have-fx-ant-api-1.2">
423 <!-- new features from JavaFX 2.2 are available in API version 1.2 or later -->
424 <matches pattern="1.[2-9]" string="${javafx.ant.version}"/>
425 </condition>
426 </target>
427 <target name="-check-jfx-sdk-version" depends="-check-jfx-sdk-version-old, -check-jfx-sdk-version-new" unless="jfx.sdk.version.checked">
428 <echo message="Detected JavaFX Ant API version ${javafx.ant.version}" level="info"/>
429 <echo message="have-fx-ant-api-1.1 = ${have-fx-ant-api-1.1}" level="verbose"/>
430 <echo message="have-fx-ant-api-1.2 = ${have-fx-ant-api-1.2}" level="verbose"/>
431 <echo message="javafx.ant.classpath = ${javafx.ant.classpath}" level="verbose"/>
432 <property name="jfx.sdk.version.checked" value="true"/>
433 </target>
434
435 <target name="-check-jfx-deployment" depends="-check-jdk-version,-check-jfx-sdk-version">
436 <condition property="jfx-deployment-available">
437 <and>
438 <or>
439 <isset property="do.set.ant-javafx.in.fxsdk.lib"/>
440 <isset property="do.set.ant-javafx.in.fxsdk.tools"/>
441 <isset property="do.set.ant-javafx.in.platform.home.lib"/>
442 <isset property="do.set.ant-javafx.in.platform.home.tools"/>
443 <isset property="do.set.ant-javafx.in.probjdk.lib"/>
444 <isset property="do.set.ant-javafx.in.probjdk.tools"/>
445 <isset property="do.set.ant-javafx.in.envjdk.lib"/>
446 <isset property="do.set.ant-javafx.in.envjdk.tools"/>
447 </or>
448 <isset property="ant-javafx.jar.location"/>
449 </and>
450 </condition>
451 <condition property="jfx-deployment-missing+jdk7u6">
452 <and>
453 <not><isset property="jfx-deployment-available"/></not>
454 <not><isset property="have-jdk-pre7u6"/></not>
455 </and>
456 </condition>
457 <condition property="jfx-deployment-missing+javafx.sdk.missing+default">
458 <and>
459 <not><isset property="jfx-deployment-available"/></not>
460 <isset property="have-jdk-pre7u6"/>
461 <isset property="javafx.sdk.missing+default"/>
462 </and>
463 </condition>
464 <condition property="jfx-deployment-missing+javafx.sdk.missing-default">
465 <and>
466 <not><isset property="jfx-deployment-available"/></not>
467 <isset property="have-jdk-pre7u6"/>
468 <isset property="javafx.sdk.missing-default"/>
469 </and>
470 </condition>
471 <fail message="Error:${line.separator}JavaFX deployment library not found in active JDK.${line.separator}Please check that the JDK is correctly installed and its version is at least 7u4 on Mac or 7u6 on other systems." if="jfx-deployment-missing+jdk7u6"/>
472 <fail message="Error:${line.separator}JavaFX deployment library not found.${line.separator}JavaFX SDK path undefined. Check the definition of ${platform.active} in Java Platform Manager${line.separator}(or directly the properties platform.active and javafx.sdk in project.properties file).${line.separator}Note: If missing, the default JavaFX-enabled platform gets created automatically when creating a new JavaFX Project." if="jfx-deployment-missing+javafx.sdk.missing+default"/>
473 <fail message="Error:${line.separator}JavaFX deployment library not found.${line.separator}JavaFX SDK path undefined. Check the definition of ${platform.active} in Java Platform Manager${line.separator}(or directly the properties platform.active and javafx.sdk in project.properties file)." if="jfx-deployment-missing+javafx.sdk.missing-default"/>
474 <fail message="Error:${line.separator}JavaFX deployment library not found." unless="jfx-deployment-available"/>
475 <echo message="jfx-deployment-available = ${jfx-deployment-available}" level="verbose"/>
476 </target>
477
478
479 <!-- Check availability of main JavaFX runtime jar (jfxrt.jar) -->
480
481 <target name="-check-property-javafx.runtime">
482 <echo message="javafx.runtime = ${javafx.runtime}" level="verbose"/>
483 <condition property="javafx.runtime.defined">
484 <and>
485 <isset property="javafx.runtime"/>
486 <not><contains string="${javafx.runtime}" substring="$${platform" casesensitive="false"/></not>
487 </and>
488 </condition>
489 <condition property="javafx.runtime.missing+default">
490 <and>
491 <equals arg1="${platform.active}" arg2="Default_JavaFX_Platform" trim="true"/>
492 <not><isset property="javafx.runtime.defined"/></not>
493 </and>
494 </condition>
495 <condition property="javafx.runtime.missing-default">
496 <and>
497 <not><equals arg1="${platform.active}" arg2="Default_JavaFX_Platform" trim="true"/></not>
498 <not><isset property="javafx.runtime.defined"/></not>
499 </and>
500 </condition>
501 <echo message="javafx.runtime.defined = ${javafx.runtime.defined}" level="verbose"/>
502 <echo message="javafx.runtime.missing+default = ${javafx.runtime.missing+default}" level="verbose"/>
503 <echo message="javafx.runtime.missing-default = ${javafx.runtime.missing-default}" level="verbose"/>
504 </target>
505
506 <target name="-check-jfxrt-in-fxrt" depends="-check-property-javafx.runtime" if="javafx.runtime.defined">
507 <condition property="do.set.jfxrt.in.fxrt.old">
508 <and>
509 <not><isset property="jfxrt.jar.location"/></not>
510 <available file="${javafx.runtime}${file.separator}lib${file.separator}jfxrt.jar"/>
511 </and>
512 </condition>
513 <condition property="do.set.jfxrt.in.fxrt.new">
514 <and>
515 <not><isset property="do.set.jfxrt.in.fxrt.old"/></not>
516 <not><isset property="jfxrt.jar.location"/></not>
517 <available file="${javafx.runtime}${file.separator}lib${file.separator}ext${file.separator}jfxrt.jar"/>
518 </and>
519 </condition>
520 </target>
521 <target name="-set-jfxrt-in-fxrt-old" depends="-check-jfxrt-in-fxrt" if="do.set.jfxrt.in.fxrt.old">
522 <property name="jfxrt.jar.location" value="${javafx.runtime}${file.separator}lib${file.separator}jfxrt.jar"/>
523 </target>
524 <target name="-set-jfxrt-in-fxrt-new" depends="-set-jfxrt-in-fxrt-old,-check-jfxrt-in-fxrt" if="do.set.jfxrt.in.fxrt.new">
525 <property name="jfxrt.jar.location" value="${javafx.runtime}${file.separator}lib${file.separator}ext${file.separator}jfxrt.jar"/>
526 </target>
527 <target name="-check-jfxrt-in-fxsdk-jre" depends="-check-property-javafx.sdk" if="javafx.sdk.defined">
528 <condition property="do.set.jfxrt.in.fxsdk.jre.old">
529 <and>
530 <not><isset property="jfxrt.jar.location"/></not>
531 <available file="${javafx.sdk}${file.separator}jre${file.separator}lib${file.separator}jfxrt.jar"/>
532 </and>
533 </condition>
534 <condition property="do.set.jfxrt.in.fxsdk.jre.new">
535 <and>
536 <not><isset property="do.set.jfxrt.in.fxsdk.jre.old"/></not>
537 <not><isset property="jfxrt.jar.location"/></not>
538 <available file="${javafx.sdk}${file.separator}jre${file.separator}lib${file.separator}ext${file.separator}jfxrt.jar"/>
539 </and>
540 </condition>
541 </target>
542 <target name="-set-jfxrt-in-fxsdk-jre-old" depends="-set-jfxrt-in-fxrt-new,-check-jfxrt-in-fxsdk-jre" if="do.set.jfxrt.in.fxsdk.jre.old">
543 <property name="jfxrt.jar.location" value="${javafx.sdk}${file.separator}jre${file.separator}lib${file.separator}jfxrt.jar"/>
544 </target>
545 <target name="-set-jfxrt-in-fxsdk-jre-new" depends="-set-jfxrt-in-fxsdk-jre-old,-check-jfxrt-in-fxsdk-jre" if="do.set.jfxrt.in.fxsdk.jre.new">
546 <property name="jfxrt.jar.location" value="${javafx.sdk}${file.separator}jre${file.separator}lib${file.separator}ext${file.separator}jfxrt.jar"/>
547 </target>
548 <target name="-check-jfxrt-in-fxsdk-rt" depends="-check-property-javafx.sdk" if="javafx.sdk.defined">
549 <condition property="do.set.jfxrt.in.fxsdk.rt.old">
550 <and>
551 <not><isset property="jfxrt.jar.location"/></not>
552 <available file="${javafx.sdk}${file.separator}rt${file.separator}lib${file.separator}jfxrt.jar"/>
553 </and>
554 </condition>
555 <condition property="do.set.jfxrt.in.fxsdk.rt.new">
556 <and>
557 <not><isset property="do.set.jfxrt.in.fxsdk.rt.old"/></not>
558 <not><isset property="jfxrt.jar.location"/></not>
559 <available file="${javafx.sdk}${file.separator}rt${file.separator}lib${file.separator}ext${file.separator}jfxrt.jar"/>
560 </and>
561 </condition>
562 </target>
563 <target name="-set-jfxrt-in-fxsdk-rt-old" depends="-set-jfxrt-in-fxsdk-jre-new,-check-jfxrt-in-fxsdk-rt" if="do.set.jfxrt.in.fxsdk.rt.old">
564 <property name="jfxrt.jar.location" value="${javafx.sdk}${file.separator}rt${file.separator}lib${file.separator}jfxrt.jar"/>
565 </target>
566 <target name="-set-jfxrt-in-fxsdk-rt-new" depends="-set-jfxrt-in-fxsdk-rt-old,-check-jfxrt-in-fxsdk-rt" if="do.set.jfxrt.in.fxsdk.rt.new">
567 <property name="jfxrt.jar.location" value="${javafx.sdk}${file.separator}rt${file.separator}lib${file.separator}ext${file.separator}jfxrt.jar"/>
568 </target>
569 <target name="-check-jfxrt-in-platform-home-jre" if="platform.home">
570 <condition property="do.set.jfxrt.in.platform.home.jre.old">
571 <and>
572 <not><isset property="jfxrt.jar.location"/></not>
573 <available file="${platform.home}${file.separator}jre${file.separator}lib${file.separator}jfxrt.jar"/>
574 </and>
575 </condition>
576 <condition property="do.set.jfxrt.in.platform.home.jre.new">
577 <and>
578 <not><isset property="do.set.jfxrt.in.platform.home.jre.old"/></not>
579 <not><isset property="jfxrt.jar.location"/></not>
580 <available file="${platform.home}${file.separator}jre${file.separator}lib${file.separator}ext${file.separator}jfxrt.jar"/>
581 </and>
582 </condition>
583 </target>
584 <target name="-set-jfxrt-in-platform-home-jre-old" depends="-set-jfxrt-in-fxsdk-rt-new,-check-jfxrt-in-platform-home-jre" if="do.set.jfxrt.in.platform.home.jre.old">
585 <property name="jfxrt.jar.location" value="${platform.home}${file.separator}jre${file.separator}lib${file.separator}jfxrt.jar"/>
586 </target>
587 <target name="-set-jfxrt-in-platform-home-jre-new" depends="-set-jfxrt-in-platform-home-jre-old,-check-jfxrt-in-platform-home-jre" if="do.set.jfxrt.in.platform.home.jre.new">
588 <property name="jfxrt.jar.location" value="${platform.home}${file.separator}jre${file.separator}lib${file.separator}ext${file.separator}jfxrt.jar"/>
589 </target>
590 <target name="-check-jfxrt-in-platform-home-rt" if="platform.home">
591 <condition property="do.set.jfxrt.in.platform.home.rt.old">
592 <and>
593 <not><isset property="jfxrt.jar.location"/></not>
594 <available file="${platform.home}${file.separator}rt${file.separator}lib${file.separator}jfxrt.jar"/>
595 </and>
596 </condition>
597 <condition property="do.set.jfxrt.in.platform.home.rt.new">
598 <and>
599 <not><isset property="do.set.jfxrt.in.platform.home.rt.old"/></not>
600 <not><isset property="jfxrt.jar.location"/></not>
601 <available file="${platform.home}${file.separator}rt${file.separator}lib${file.separator}ext${file.separator}jfxrt.jar"/>
602 </and>
603 </condition>
604 </target>
605 <target name="-set-jfxrt-in-platform-home-rt-old" depends="-set-jfxrt-in-platform-home-jre-new,-check-jfxrt-in-platform-home-rt" if="do.set.jfxrt.in.platform.home.rt.old">
606 <property name="jfxrt.jar.location" value="${platform.home}${file.separator}rt${file.separator}lib${file.separator}jfxrt.jar"/>
607 </target>
608 <target name="-set-jfxrt-in-platform-home-rt-new" depends="-set-jfxrt-in-platform-home-rt-old,-check-jfxrt-in-platform-home-rt" if="do.set.jfxrt.in.platform.home.rt.new">
609 <property name="jfxrt.jar.location" value="${platform.home}${file.separator}rt${file.separator}lib${file.separator}ext${file.separator}jfxrt.jar"/>
610 </target>
611 <target name="-check-jfxrt-in-jre" unless="jfxrt.jar.location">
612 <condition property="do.set.jfxrt.in.jre.old">
613 <and>
614 <not><isset property="jfxrt.jar.location"/></not>
615 <available file="${java.home}${file.separator}lib${file.separator}jfxrt.jar"/>
616 </and>
617 </condition>
618 <condition property="do.set.jfxrt.in.jre.new">
619 <and>
620 <not><isset property="do.set.jfxrt.in.jre.old"/></not>
621 <not><isset property="jfxrt.jar.location"/></not>
622 <available file="${java.home}${file.separator}lib${file.separator}ext${file.separator}jfxrt.jar"/>
623 </and>
624 </condition>
625 </target>
626 <target name="-set-jfxrt-in-jre-old" depends="-set-jfxrt-in-platform-home-rt-new,-check-jfxrt-in-jre" if="do.set.jfxrt.in.jre.old">
627 <property name="jfxrt.jar.location" value="${java.home}${file.separator}lib${file.separator}jfxrt.jar"/>
628 </target>
629 <target name="-set-jfxrt-in-jre-new" depends="-set-jfxrt-in-jre-old,-check-jfxrt-in-jre" if="do.set.jfxrt.in.jre.new">
630 <property name="jfxrt.jar.location" value="${java.home}${file.separator}lib${file.separator}ext${file.separator}jfxrt.jar"/>
631 </target>
632 <target name="-check-jfxrt-in-envjdk-jre" unless="jfxrt.jar.location">
633 <property environment="env"/>
634 <condition property="do.set.jfxrt.in.envjdk.jre.old">
635 <and>
636 <not><isset property="jfxrt.jar.location"/></not>
637 <available file="${env.JAVA_HOME}${file.separator}jre${file.separator}lib${file.separator}jfxrt.jar"/>
638 </and>
639 </condition>
640 <condition property="do.set.jfxrt.in.envjdk.jre.new">
641 <and>
642 <not><isset property="do.set.jfxrt.in.envjdk.jre.old"/></not>
643 <not><isset property="jfxrt.jar.location"/></not>
644 <available file="${env.JAVA_HOME}${file.separator}jre${file.separator}lib${file.separator}ext${file.separator}jfxrt.jar"/>
645 </and>
646 </condition>
647 </target>
648 <target name="-set-jfxrt-in-envjdk-jre-old" depends="-set-jfxrt-in-jre-new,-check-jfxrt-in-envjdk-jre" if="do.set.jfxrt.in.envjdk.jre.old">
649 <property name="jfxrt.jar.location" value="${env.JAVA_HOME}${file.separator}jre${file.separator}lib${file.separator}jfxrt.jar"/>
650 </target>
651 <target name="-set-jfxrt-in-envjdk-jre-new" depends="-set-jfxrt-in-envjdk-jre-old,-check-jfxrt-in-envjdk-jre" if="do.set.jfxrt.in.envjdk.jre.new">
652 <property name="jfxrt.jar.location" value="${env.JAVA_HOME}${file.separator}jre${file.separator}lib${file.separator}ext${file.separator}jfxrt.jar"/>
653 </target>
654 <target name="-pre-check-jfx-runtime" depends="-set-jfxrt-in-envjdk-jre-new">
655 <echo message="jfxrt.jar.location = ${jfxrt.jar.location}" level="verbose"/>
656 </target>
657
658 <target name="-check-jfx-runtime" depends="-check-jdk-version, -pre-check-jfx-runtime">
659 <condition property="jfx-runtime-available">
660 <and>
661 <or>
662 <isset property="do.set.jfxrt.in.fxrt.old"/>
663 <isset property="do.set.jfxrt.in.fxrt.new"/>
664 <isset property="do.set.jfxrt.in.fxsdk.jre.old"/>
665 <isset property="do.set.jfxrt.in.fxsdk.jre.new"/>
666 <isset property="do.set.jfxrt.in.fxsdk.rt.old"/>
667 <isset property="do.set.jfxrt.in.fxsdk.rt.new"/>
668 <isset property="do.set.jfxrt.in.platform.home.jre.old"/>
669 <isset property="do.set.jfxrt.in.platform.home.jre.new"/>
670 <isset property="do.set.jfxrt.in.platform.home.rt.old"/>
671 <isset property="do.set.jfxrt.in.platform.home.rt.new"/>
672 <isset property="do.set.jfxrt.in.jre.old"/>
673 <isset property="do.set.jfxrt.in.jre.new"/>
674 <isset property="do.set.jfxrt.in.envjdk.jre.old"/>
675 <isset property="do.set.jfxrt.in.envjdk.jre.new"/>
676 </or>
677 <isset property="jfxrt.jar.location"/>
678 </and>
679 </condition>
680 <fail message="Error:${line.separator}JavaFX runtime JAR not found." unless="jfx-runtime-available"/>
681 <echo message="jfx-runtime-available = ${jfx-runtime-available}" level="verbose"/>
682 </target>
683
684
685 <!-- Check availability of WebStart executable -->
686
687 <target name="-check-webstart-in-fxrt" depends="-check-property-javafx.runtime" if="javafx.runtime.defined">
688 <condition property="do.set.webstart.in.fxrt">
689 <and>
690 <not><isset property="active.webstart.executable"/></not>
691 <isset property="javafx.runtime.defined"/>
692 <or>
693 <available file="${javafx.runtime}${file.separator}bin${file.separator}javaws.exe"/>
694 <available file="${javafx.runtime}${file.separator}bin${file.separator}javaws"/>
695 </or>
696 </and>
697 </condition>
698 </target>
699 <target name="-set-webstart-in-fxrt" depends="-check-webstart-in-fxrt" if="do.set.webstart.in.fxrt">
700 <property name="active.webstart.executable" value="${javafx.runtime}${file.separator}bin${file.separator}javaws"/>
701 </target>
702 <target name="-check-webstart-in-fxsdk-jre" depends="-check-property-javafx.sdk" if="javafx.sdk.defined">
703 <condition property="do.set.webstart.in.fxsdk.jre">
704 <and>
705 <not><isset property="active.webstart.executable"/></not>
706 <isset property="javafx.sdk.defined"/>
707 <or>
708 <available file="${javafx.sdk}${file.separator}jre${file.separator}bin${file.separator}javaws.exe"/>
709 <available file="${javafx.sdk}${file.separator}jre${file.separator}bin${file.separator}javaws"/>
710 </or>
711 </and>
712 </condition>
713 </target>
714 <target name="-set-webstart-in-fxsdk-jre" depends="-set-webstart-in-fxrt,-check-webstart-in-fxsdk-jre" if="do.set.webstart.in.fxsdk.jre">
715 <property name="active.webstart.executable" value="${javafx.sdk}${file.separator}jre${file.separator}bin${file.separator}javaws"/>
716 </target>
717 <target name="-check-webstart-in-fxsdk" depends="-check-property-javafx.sdk" if="javafx.sdk.defined">
718 <condition property="do.set.webstart.in.fxsdk">
719 <and>
720 <not><isset property="active.webstart.executable"/></not>
721 <isset property="javafx.sdk.defined"/>
722 <or>
723 <available file="${javafx.sdk}${file.separator}bin${file.separator}javaws.exe"/>
724 <available file="${javafx.sdk}${file.separator}bin${file.separator}javaws"/>
725 </or>
726 </and>
727 </condition>
728 </target>
729 <target name="-set-webstart-in-fxsdk" depends="-set-webstart-in-fxsdk-jre,-check-webstart-in-fxsdk" if="do.set.webstart.in.fxsdk">
730 <property name="active.webstart.executable" value="${javafx.sdk}${file.separator}bin${file.separator}javaws"/>
731 </target>
732 <target name="-check-webstart-in-platform-home-jre" if="platform.home">
733 <condition property="do.set.webstart.in.platform.home.jre">
734 <and>
735 <not><isset property="active.webstart.executable"/></not>
736 <or>
737 <available file="${platform.home}${file.separator}jre${file.separator}bin${file.separator}javaws.exe"/>
738 <available file="${platform.home}${file.separator}jre${file.separator}bin${file.separator}javaws"/>
739 </or>
740 </and>
741 </condition>
742 </target>
743 <target name="-set-webstart-in-platform-home-jre" depends="-set-webstart-in-fxsdk,-check-webstart-in-platform-home-jre" if="do.set.webstart.in.platform.home.jre">
744 <property name="active.webstart.executable" value="${platform.home}${file.separator}jre${file.separator}bin${file.separator}javaws"/>
745 </target>
746 <target name="-check-webstart-in-platform-home" if="platform.home">
747 <condition property="do.set.webstart.in.platform.home">
748 <and>
749 <not><isset property="active.webstart.executable"/></not>
750 <or>
751 <available file="${platform.home}${file.separator}bin${file.separator}javaws.exe"/>
752 <available file="${platform.home}${file.separator}bin${file.separator}javaws"/>
753 </or>
754 </and>
755 </condition>
756 </target>
757 <target name="-set-webstart-in-platform-home" depends="-set-webstart-in-platform-home-jre,-check-webstart-in-platform-home" if="do.set.webstart.in.platform.home">
758 <property name="active.webstart.executable" value="${platform.home}${file.separator}bin${file.separator}javaws"/>
759 </target>
760 <target name="-check-webstart-in-jre" unless="active.webstart.executable">
761 <condition property="do.set.webstart.in.jre">
762 <and>
763 <not><isset property="active.webstart.executable"/></not>
764 <or>
765 <available file="${java.home}${file.separator}bin${file.separator}javaws.exe"/>
766 <available file="${java.home}${file.separator}bin${file.separator}javaws"/>
767 </or>
768 </and>
769 </condition>
770 </target>
771 <target name="-set-webstart-in-jre" depends="-set-webstart-in-platform-home,-check-webstart-in-jre" if="do.set.webstart.in.jre">
772 <property name="active.webstart.executable" value="${java.home}${file.separator}bin${file.separator}javaws"/>
773 </target>
774 <target name="-check-webstart-in-probjdk" unless="active.webstart.executable">
775 <condition property="do.set.webstart.in.probjdk">
776 <and>
777 <not><isset property="active.webstart.executable"/></not>
778 <or>
779 <available file="${java.home}${file.separator}..${file.separator}bin${file.separator}javaws.exe"/>
780 <available file="${java.home}${file.separator}..${file.separator}bin${file.separator}javaws"/>
781 </or>
782 </and>
783 </condition>
784 </target>
785 <target name="-set-webstart-in-probjdk" depends="-set-webstart-in-jre,-check-webstart-in-probjdk" if="do.set.webstart.in.probjdk">
786 <property name="active.webstart.executable" value="${java.home}${file.separator}..${file.separator}bin${file.separator}javaws"/>
787 </target>
788 <target name="-check-webstart-in-envjdk" unless="active.webstart.executable">
789 <property environment="env"/>
790 <condition property="do.set.webstart.in.envjdk">
791 <and>
792 <not><isset property="active.webstart.executable"/></not>
793 <or>
794 <available file="${env.JAVA_HOME}${file.separator}bin${file.separator}javaws.exe"/>
795 <available file="${env.JAVA_HOME}${file.separator}bin${file.separator}javaws"/>
796 </or>
797 </and>
798 </condition>
799 </target>
800 <target name="-set-webstart-in-envjdk" depends="-set-webstart-in-probjdk,-check-webstart-in-envjdk" if="do.set.webstart.in.envjdk">
801 <property name="active.webstart.executable" value="${env.JAVA_HOME}${file.separator}bin${file.separator}javaws"/>
802 </target>
803 <target name="-pre-check-webstart-in-unix" depends="-check-operating-system,-set-webstart-in-envjdk" unless="active.webstart.executable">
804 <condition property="running.on.unix-active.webstart.executable">
805 <and>
806 <not><isset property="active.webstart.executable"/></not>
807 <isset property="running.on.unix"/>
808 </and>
809 </condition>
810 </target>
811 <target name="-check-webstart-in-unix" depends="-pre-check-webstart-in-unix" if="running.on.unix-active.webstart.executable">
812 <local name="exec.which.javaws.result"/>
813 <exec executable="command" failifexecutionfails="false" failonerror="false" resultproperty="exec.which.javaws.result" outputproperty="exec.which.javaws.output">
814 <arg line="-v javaws"/>
815 </exec>
816 <condition property="do.set.webstart.in.unix">
817 <and>
818 <not><isset property="active.webstart.executable"/></not>
819 <isset property="exec.which.javaws.result"/>
820 <equals arg1="${exec.which.javaws.result}" arg2="0"/>
821 <isset property="exec.which.javaws.output"/>
822 <not><equals arg1="${exec.which.javaws.output}" arg2=""/></not>
823 </and>
824 </condition>
825 <echo message="do.set.webstart.in.unix = ${do.set.webstart.in.unix}" level="verbose"/>
826 </target>
827 <target name="-set-webstart-in-unix" depends="-set-webstart-in-envjdk,-check-webstart-in-unix" if="do.set.webstart.in.unix">
828 <property name="active.webstart.executable" value="${exec.which.javaws.output}"/>
829 </target>
830 <target name="-pre-check-jfx-webstart" depends="-set-webstart-in-unix">
831 <echo message="active.webstart.executable = ${active.webstart.executable}" level="verbose"/>
832 </target>
833
834 <target name="-check-jfx-webstart" depends="-pre-check-jfx-webstart">
835 <condition property="jfx-webstart-available">
836 <and>
837 <or>
838 <isset property="do.set.webstart.in.fxrt"/>
839 <isset property="do.set.webstart.in.fxsdk.jre"/>
840 <isset property="do.set.webstart.in.fxsdk"/>
841 <isset property="do.set.webstart.in.platform.home.jre"/>
842 <isset property="do.set.webstart.in.platform.home"/>
843 <isset property="do.set.webstart.in.jre"/>
844 <isset property="do.set.webstart.in.probjdk"/>
845 <isset property="do.set.webstart.in.envjdk"/>
846 <isset property="do.set.webstart.in.unix"/>
847 </or>
848 <isset property="active.webstart.executable"/>
849 </and>
850 </condition>
851 <condition property="jfx-webstart-missing+jdk7u6">
852 <and>
853 <not><isset property="jfx-webstart-available"/></not>
854 <not><isset property="have-jdk-pre7u6"/></not>
855 </and>
856 </condition>
857 <condition property="jfx-webstart-missing+javafx.runtime.missing+default">
858 <and>
859 <not><isset property="jfx-webstart-available"/></not>
860 <isset property="have-jdk-pre7u6"/>
861 <isset property="javafx.runtime.missing+default"/>
862 </and>
863 </condition>
864 <condition property="jfx-webstart-missing+javafx.runtime.missing-default">
865 <and>
866 <not><isset property="jfx-webstart-available"/></not>
867 <isset property="have-jdk-pre7u6"/>
868 <isset property="javafx.runtime.missing-default"/>
869 </and>
870 </condition>
871 <fail message="Error:${line.separator}WebStart executable could not be found in active JDK.${line.separator}Please check that the JDK is correctly installed and its version is at least 7u6." if="jfx-webstart-missing+jdk7u6"/>
872 <fail message="Error:${line.separator}WebStart executable could not be found.${line.separator}JavaFX RT path undefined. Check the definition of ${platform.active} in Java Platform Manager${line.separator}(or directly the properties platform.active and javafx.runtime in project.properties file).${line.separator}Note: If missing, the default JavaFX-enabled platform gets created automatically when creating a new JavaFX Project." if="jfx-webstart-missing+javafx.runtime.missing+default"/>
873 <fail message="Error:${line.separator}WebStart executable could not be found.${line.separator}JavaFX RT path undefined. Check the definition of ${platform.active} in Java Platform Manager${line.separator}(or directly the properties platform.active and javafx.runtime in project.properties file)." if="jfx-webstart-missing+javafx.runtime.missing-default"/>
874 <fail message="Error:${line.separator}WebStart executable could not be found." unless="jfx-webstart-available"/>
875 <echo message="jfx-webstart-available = ${jfx-webstart-available}" level="verbose"/>
876 </target>
877
878
879 <!-- Legacy targets kept for compatibility with older build-impl.xml scripts -->
880
881 <!-- Note: target "-check-javafx" is not necessary any more but is referenced from NB 7.1 build-impl.xml -->
882 <target name="-check-javafx"/>
883 <!-- Note: target "-javafx-check-error" is not necessary any more but is referenced from NB 7.1 build-impl.xml -->
884 <target name="-javafx-check-error"/>
885 <!-- Note: target "-init-javafx" is not necessary any more but is referenced from NB 7.1 build-impl.xml -->
886 <target name="-init-javafx"/>
887
888
889 <!-- Check project properties -->
890
891 <target name="-check-default-run-config" unless="config">
892 <property name="config" value="&lt;default config&gt;"/>
893 </target>
894
895 <target name="-check-project">
896 <condition property="main-class-available">
897 <isset property="javafx.main.class"/>
898 </condition>
899 <condition property="vmargs-available">
900 <and>
901 <isset property="run.jvmargs"/>
902 <not><equals arg1="${run.jvmargs}" arg2=""/></not>
903 </and>
904 </condition>
905 <condition property="preloader-available">
906 <and>
907 <isset property="javafx.preloader.enabled"/>
908 <equals arg1="${javafx.preloader.enabled}" arg2="true"/>
909 <isset property="javafx.preloader.class"/>
910 <not><equals arg1="${javafx.preloader.class}" arg2=""/></not>
911 <isset property="javafx.preloader.jar.filename"/>
912 <not><equals arg1="${javafx.preloader.jar.filename}" arg2=""/></not>
913 </and>
914 </condition>
915 <condition property="app-with-preloader">
916 <and>
917 <istrue value="${preloader-available}"/>
918 <istrue value="${main-class-available}"/>
919 </and>
920 </condition>
921 <condition property="app-with-external-preloader-jar">
922 <and>
923 <isset property="app-with-preloader"/>
924 <isset property="javafx.preloader.type"/>
925 <equals arg1="${javafx.preloader.type}" arg2="jar" trim="true"/>
926 </and>
927 </condition>
928 <condition property="app-without-preloader">
929 <and>
930 <not>
931 <istrue value="${preloader-available}"/>
932 </not>
933 <istrue value="${main-class-available}"/>
934 </and>
935 </condition>
936 <condition property="preloader-app">
937 <and>
938 <isset property="javafx.preloader"/>
939 <equals arg1="${javafx.preloader}" arg2="true"/>
940 </and>
941 </condition>
942 <condition property="fx-in-swing-app">
943 <and>
944 <isset property="javafx.swing"/>
945 <equals arg1="${javafx.swing}" arg2="true"/>
946 </and>
947 </condition>
948 <condition property="fx-in-swing-workaround-app">
949 <and>
950 <istrue value="${fx-in-swing-app}"/>
951 <istrue value="${preloader-app}"/>
952 </and>
953 </condition>
954 <condition property="preloader-app-no-workaround">
955 <and>
956 <istrue value="${preloader-app}"/>
957 <not><istrue value="${fx-in-swing-app}"/></not>
958 </and>
959 </condition>
960 <condition property="html-template-available">
961 <and>
962 <isset property="javafx.run.htmltemplate"/>
963 <not>
964 <equals arg1="${javafx.run.htmltemplate}" arg2=""/>
965 </not>
966 </and>
967 </condition>
968 <condition property="icon-available">
969 <and>
970 <isset property="javafx.deploy.icon"/>
971 <not>
972 <equals arg1="${javafx.deploy.icon}" arg2=""/>
973 </not>
974 </and>
975 </condition>
976 <condition property="dimensions-available">
977 <and>
978 <isset property="javafx.run.width"/>
979 <isset property="javafx.run.height"/>
980 <not><equals arg1="${javafx.run.width}" arg2=""/></not>
981 <not><equals arg1="${javafx.run.height}" arg2=""/></not>
982 </and>
983 </condition>
984 <condition property="update-mode-background">
985 <and>
986 <isset property="javafx.deploy.backgroundupdate"/>
987 <equals arg1="${javafx.deploy.backgroundupdate}" arg2="true" trim="true"/>
988 </and>
989 </condition>
990 <condition property="offline-allowed">
991 <and>
992 <isset property="javafx.deploy.allowoffline"/>
993 <equals arg1="${javafx.deploy.allowoffline}" arg2="true" trim="true"/>
994 </and>
995 </condition>
996 <condition property="permissions-elevated">
997 <and>
998 <isset property="javafx.deploy.permissionselevated"/>
999 <equals arg1="${javafx.deploy.permissionselevated}" arg2="true" trim="true"/>
1000 </and>
1001 </condition>
1002 <condition property="binary-encode-css">
1003 <and>
1004 <isset property="javafx.binarycss"/>
1005 <equals arg1="${javafx.binarycss}" arg2="true" trim="true"/>
1006 </and>
1007 </condition>
1008 <condition property="rebase-lib-jars">
1009 <and>
1010 <isset property="javafx.rebase.libs"/>
1011 <equals arg1="${javafx.rebase.libs}" arg2="true" trim="true"/>
1012 </and>
1013 </condition>
1014 <condition property="use-blob-signing">
1015 <and>
1016 <isset property="javafx.signing.blob"/>
1017 <equals arg1="${javafx.signing.blob}" arg2="true" trim="true"/>
1018 </and>
1019 </condition>
1020 <echo message="main-class-available = ${main-class-available}" level="verbose"/>
1021 <echo message="vmargs-available = ${vmargs-available}" level="verbose"/>
1022 <echo message="preloader-available = ${preloader-available}" level="verbose"/>
1023 <echo message="app-with-preloader = ${app-with-preloader}" level="verbose"/>
1024 <echo message="app-with-preloader-without-project = ${app-with-preloader-without-project}" level="verbose"/>
1025 <echo message="app-without-preloader = ${app-without-preloader}" level="verbose"/>
1026 <echo message="preloader-app = ${preloader-app}" level="verbose"/>
1027 <echo message="fx-in-swing-app = ${fx-in-swing-app}" level="verbose"/>
1028 <echo message="fx-in-swing-workaround-app = ${fx-in-swing-workaround-app}" level="verbose"/>
1029 <echo message="preloader-app-no-workaround = ${preloader-app-no-workaround}" level="verbose"/>
1030 <echo message="html-template-available = ${html-template-available}" level="verbose"/>
1031 <echo message="icon-available = ${icon-available}" level="verbose"/>
1032 <echo message="dimensions-available = ${dimensions-available}" level="verbose"/>
1033 <echo message="update-mode-background = ${update-mode-background}" level="verbose"/>
1034 <echo message="offline-allowed = ${offline-allowed}" level="verbose"/>
1035 <echo message="permissions-elevated = ${permissions-elevated}" level="verbose"/>
1036 <echo message="binary-encode-css = ${binary-encode-css}" level="verbose"/>
1037 <echo message="rebase-lib-jars = ${rebase-lib-jars}" level="verbose"/>
1038 <echo message="use-blob-signing = ${use-blob-signing}" level="verbose"/>
1039 </target>
1040
1041 <target name="-swing-api-check" depends="-check-project,-check-jfx-deployment" if="fx-in-swing-app">
1042 <condition property="fx-in-swing-app-workaround">
1043 <and>
1044 <isset property="fx-in-swing-app"/>
1045 <not><isset property="have-fx-ant-api-1.2"/></not>
1046 </and>
1047 </condition>
1048 </target>
1049 <target name="-swing-api-warning" depends="-swing-api-check" if="fx-in-swing-app-workaround">
1050 <echo message="Info: No support for FX-in-Swing deployment detected in current JavaFX SDK. Using workaround instead."/>
1051 </target>
1052
1053 <target name="-icon-deployment-check" depends="-check-project,-check-jfx-deployment" if="icon-available">
1054 <condition property="icon-deployment-may-not-be-supported">
1055 <and>
1056 <isset property="icon-available"/>
1057 <not><isset property="have-fx-ant-api-1.1"/></not>
1058 </and>
1059 </condition>
1060 </target>
1061 <target name="-icon-warning" depends="-icon-deployment-check" if="icon-deployment-may-not-be-supported">
1062 <echo message="Warning: Note that due to a bug in early JavaFX 2.0 SDK distributions the icon may not be properly set in deployment files."/>
1063 </target>
1064
1065 <target name="-set-dimensions" depends="-check-project" if="dimensions-available">
1066 <property name="javafx.width" value="${javafx.run.width}"/>
1067 <property name="javafx.height" value="${javafx.run.height}"/>
1068 </target>
1069 <target name="-reset-dimensions" depends="-check-project" unless="dimensions-available">
1070 <property name="javafx.width" value="800"/>
1071 <property name="javafx.height" value="600"/>
1072 </target>
1073
1074 <target name="-set-update-mode-background" depends="-check-project" if="update-mode-background">
1075 <property name="update-mode" value="background"/>
1076 </target>
1077 <target name="-set-update-mode-eager" depends="-check-project" unless="update-mode-background">
1078 <property name="update-mode" value="eager"/>
1079 </target>
1080
1081 <target name="-set-permissions-elevated" depends="-check-project" if="permissions-elevated">
1082 <property name="permissions.elevated" value="true"/>
1083 </target>
1084 <target name="-reset-permissions-elevated" depends="-check-project" unless="permissions-elevated">
1085 <property name="permissions.elevated" value="false"/>
1086 </target>
1087
1088 <target name="-set-binary-css" depends="-check-project,-init-css-conversion" if="do.copy.binary.css">
1089 <property name="css-include-ext" value="bss"/>
1090 <property name="css-exclude-ext" value="css"/>
1091 </target>
1092 <target name="-unset-binary-css" depends="-check-project,-init-css-conversion" unless="do.copy.binary.css">
1093 <property name="css-include-ext" value="css"/>
1094 <property name="css-exclude-ext" value="bss"/>
1095 </target>
1096 <target name="-copy-binary-css" depends="-init-css-conversion,-set-binary-css,-unset-binary-css,-copy-binary-css-bypass,-copy-binary-css-impl"/>
1097 <target name="-init-css-conversion" depends="-check-project,-check-ant-jre-version">
1098 <fileset id="cssfiles" dir="${basedir}${file.separator}${build.classes.dir}">
1099 <include name="**${file.separator}*.css"/>
1100 </fileset>
1101 <pathconvert refid="cssfiles" property="cssfileset.notempty" setonempty="false"/>
1102 <condition property="do.copy.binary.css">
1103 <and>
1104 <isset property="binary-encode-css"/>
1105 <isset property="cssfileset.notempty"/>
1106 <not><isset property="have-jdk7-css2bin-bug"/></not>
1107 </and>
1108 </condition>
1109 <condition property="do.bypass.binary.css">
1110 <and>
1111 <isset property="binary-encode-css"/>
1112 <isset property="cssfileset.notempty"/>
1113 <isset property="have-jdk7-css2bin-bug"/>
1114 </and>
1115 </condition>
1116 <echo message="do.copy.binary.css = ${do.copy.binary.css}" level="verbose"/>
1117 <echo message="do.bypass.binary.css = ${do.bypass.binary.css}" level="verbose"/>
1118 </target>
1119 <target name="-copy-binary-css-bypass" depends="-init-css-conversion" if="do.bypass.binary.css">
1120 <echo message="Warning: Bypassing FX CSS to BSS conversion due to a bug in &lt;fx:csstobin&gt; task in current JDK platform" level="warning"/>
1121 </target>
1122 <target name="-copy-binary-css-impl" depends="-init-css-conversion" if="do.copy.binary.css">
1123 <property name="cssfileslist" refid="cssfiles"/>
1124 <echo message="css files to binary convert: " level="verbose">${cssfileslist}</echo>
1125 <fx:csstobin outdir="${basedir}${file.separator}${build.classes.dir}">
1126 <fileset refid="cssfiles"/>
1127 </fx:csstobin>
1128 </target>
1129
1130
1131 <!-- Copy dependent libraries -->
1132
1133 <!-- Note: target "-jfx-copylibs" is referenced from NB 7.1 build-impl.xml -->
1134 <target name="-jfx-copylibs" depends="init,compile,-pre-pre-jar,-pre-jar,-jfx-copylibs-warning" unless="fallback.no.javascript">
1135 <jfx-copylibs-js-impl/>
1136 </target>
1137 <target name="-jfx-copylibs-warning" if="fallback.no.javascript">
1138 <echo message="Warning: Dependent Libraries copy (-jfx-copylibs) skipped in fallback build mode due to JDK missing JavaScript support."/>
1139 </target>
1140 <macrodef name="jfx-copylibs-js-impl">
1141 <sequential>
1142 <local name="run.classpath.without.build.classes.and.dist.dir"/>
1143 <pathconvert property="run.classpath.without.build.classes.and.dist.dir">
1144 <path path="${run.classpath}"/>
1145 <map from="${basedir}${file.separator}${build.classes.dir}" to=""/>
1146 <map from="${basedir}${file.separator}${dist.jar}" to=""/>
1147 <scriptmapper language="javascript">
1148 self.addMappedName(
1149 (source.indexOf("jfxrt.jar") >= 0) ||
1150 (source.indexOf("deploy.jar") >= 0) ||
1151 (source.indexOf("javaws.jar") >= 0) ||
1152 (source.indexOf("plugin.jar") >= 0)
1153 ? "" : source
1154 );
1155 </scriptmapper>
1156 </pathconvert>
1157 <!-- add possibly missing dependencies at distance 2 (build system logic thus provides transitive closure) -->
1158 <local name="run.and.lib.classpath"/>
1159 <echo message="JavaScript: -jfx-copylibs" level="verbose"/>
1160 <script language="javascript">
1161 <![CDATA[
1162 function prefix(s, len) {
1163 if(s == null || len <= 0 || s.length == 0) {
1164 return new String("");
1165 }
1166 return new String(s.substr(0, len));
1167 }
1168 function defined(s) {
1169 return (s != null) && (s != "null") && (s.length > 0);
1170 }
1171 var pathConvert = project.createTask("pathconvert");
1172 pathConvert.setProperty("run.and.lib.classpath");
1173 var classPath = new String(project.getProperty("run.classpath.without.build.classes.and.dist.dir"));
1174 var fileSeparator = new String(project.getProperty("file.separator"));
1175 if(defined(classPath)) {
1176 var classPathCopy = pathConvert.createPath();
1177 classPathCopy.setPath(classPath);
1178 var pathArray;
1179 if(classPath.indexOf(";") != -1) {
1180 pathArray = classPath.split(";");
1181 } else {
1182 pathArray = classPath.split(":");
1183 }
1184 var added = new java.lang.StringBuilder();
1185 for (var i = 0; i < pathArray.length; i++) {
1186 var index = pathArray[i].lastIndexOf(fileSeparator);
1187 if (index >= 0) {
1188 var onePath = prefix(pathArray[i], index+1).concat("lib");
1189 var oneDir = new java.io.File(onePath);
1190 if(oneDir.exists()) {
1191 var fs = project.createDataType( "fileset" );
1192 fs.setDir( oneDir );
1193 fs.setIncludes("*.jar");
1194 var ds = fs.getDirectoryScanner(project);
1195 var srcFiles = ds.getIncludedFiles();
1196 for (var j = 0; j < srcFiles.length; j++) {
1197 if(classPath.indexOf( srcFiles[j] ) == -1 && added.indexOf( srcFiles[j] ) == -1) {
1198 var path = pathConvert.createPath();
1199 path.setPath( onePath.concat(fileSeparator).concat(srcFiles[j]) );
1200 added.append( srcFiles[j] );
1201 }
1202 }
1203 }
1204 }
1205 }
1206 }
1207 pathConvert.perform();
1208 ]]>
1209 </script>
1210 <echo message="run.and.lib.classpath = ${run.and.lib.classpath}" level="verbose"/>
1211 <delete dir="${dist.dir}${file.separator}lib" includeEmptyDirs="true" quiet="true"/>
1212 <copy todir="${dist.dir}${file.separator}lib" flatten="true" preservelastmodified="true" overwrite="true">
1213 <path>
1214 <pathelement path="${run.and.lib.classpath}"/>
1215 </path>
1216 </copy>
1217 </sequential>
1218 </macrodef>
1219
1220 <target name="-copy-external-preloader-jar" depends="-check-project" if="app-with-external-preloader-jar">
1221 <copy file="${javafx.preloader.jar.path}" todir="${dist.dir}${file.separator}lib"/>
1222 </target>
1223
1224
1225 <!-- Optional classpath re-base of dependent JAR manifests after copy to lib/, required by GlassFish -->
1226
1227 <!-- Note: target "-rebase-libs" is referenced from NB 7.1 build-impl.xml -->
1228 <target name="-rebase-libs" depends="-check-project, -jfx-copylibs, -check-rebase-libs, -rebase-libs-warning" if="do-rebase-lib-jars">
1229 <rebase-libs-js-impl/>
1230 </target>
1231 <target name="-check-rebase-libs">
1232 <condition property="do-rebase-lib-jars">
1233 <and>
1234 <isset property="rebase-lib-jars"/>
1235 <not><isset property="fallback.no.javascript"/></not>
1236 </and>
1237 </condition>
1238 <condition property="do-skip-rebase-libs">
1239 <and>
1240 <isset property="rebase-lib-jars"/>
1241 <isset property="fallback.no.javascript"/>
1242 </and>
1243 </condition>
1244 </target>
1245 <target name="-rebase-libs-warning" depends="-check-rebase-libs" if="do-skip-rebase-libs">
1246 <echo message="Warning: Dependent Libraries JARs rebase (-rebase-libs) skipped in fallback build mode due to JDK missing JavaScript support."/>
1247 </target>
1248
1249 <macrodef name="rebase-libs-js-impl">
1250 <sequential>
1251 <property name="pp_rebase_dir" value="${basedir}${file.separator}${dist.dir}${file.separator}lib"/>
1252 <property name="pp_rebase_fs" value="*.jar"/>
1253 <echo message="JavaScript: -rebase-libs-js-impl" level="verbose"/>
1254 <script language="javascript">
1255 <![CDATA[
1256 var dir = new String(project.getProperty("pp_rebase_dir"));
1257 var fDir = new java.io.File(dir);
1258 if( fDir.exists() ) {
1259 var callTask = project.createTask("antcall");
1260 callTask.setTarget("-rebase-libs-macro-call");
1261 var param = callTask.createParam();
1262 param.setName("jar.file.to.rebase");
1263 var includes = new String(project.getProperty("pp_rebase_fs"));
1264 var fs = project.createDataType("fileset");
1265 fs.setDir( fDir );
1266 fs.setIncludes(includes);
1267 var ds = fs.getDirectoryScanner(project);
1268 var srcFiles = ds.getIncludedFiles();
1269 for (var i = 0; i < srcFiles.length; i++) {
1270 param.setValue(dir.concat("${file.separator}").concat(srcFiles[i]));
1271 callTask.perform();
1272 }
1273 }
1274 ]]>
1275 </script>
1276 </sequential>
1277 </macrodef>
1278
1279 <macrodef name="rebase-lib">
1280 <attribute name="jarfile"/>
1281 <sequential>
1282 <local name="tmpdir"/>
1283 <property name="tmpdir" value="${java.io.tmpdir}${file.separator}${user.name}_${ant.project.name}_rebase" />
1284 <echo message="tmpdir = ${tmpdir}" level="verbose"/>
1285 <delete dir="${tmpdir}" quiet="true"/>
1286 <mkdir dir="${tmpdir}"/>
1287 <unzip src="@{jarfile}" dest="${tmpdir}">
1288 <patternset>
1289 <include name="META-INF${file.separator}MANIFEST.MF"/>
1290 </patternset>
1291 </unzip>
1292 <local name="manifest.file.temp"/>
1293 <property name="manifest.file.temp" value="${tmpdir}${file.separator}META-INF${file.separator}MANIFEST.MF" />
1294 <echo message="manifest.file.temp = ${manifest.file.temp}" level="verbose"/>
1295 <!-- edited manifest file -->
1296 <local name="manifest.file.temp.new"/>
1297 <property name="manifest.file.temp.new" value="${manifest.file.temp}_new" />
1298 <echo message="manifest.file.temp.new = ${manifest.file.temp.new}" level="verbose"/>
1299 <echo message="JavaScript: rebase-lib" level="verbose"/>
1300 <script language="javascript">
1301 <![CDATA[
1302 var UTF_8 = "UTF-8";
1303 var ATTR_CLASS_PATH = "Class-Path";
1304 var ATTR_CLASS_PATH_FX = "JavaFX-Class-Path";
1305 function endsWith(s, suffix) {
1306 var i = s.lastIndexOf(suffix);
1307 return (i != -1) && (i == (s.length - suffix.length));
1308 }
1309 function isSigned(manifest) {
1310 var sections = manifest.getSectionNames();
1311 while(sections.hasMoreElements()) {
1312 var sectionname = new String(sections.nextElement());
1313 var section = manifest.getSection(sectionname);
1314 if(section != null) {
1315 var sectionKeys = section.getAttributeKeys();
1316 while (sectionKeys.hasMoreElements()) {
1317 var element = new String(sectionKeys.nextElement());
1318 if (endsWith(element, "-Digest") || endsWith(element, "-digest")) {
1319 return true;
1320 }
1321 }
1322 }
1323 }
1324 return false;
1325 }
1326 var src = new String(project.getProperty("manifest.file.temp"));
1327 var srf = new java.io.File(src);
1328 var manifest;
1329 try {
1330 var fis = new java.io.FileInputStream(srf);
1331 try {
1332 var isr = new java.io.InputStreamReader(fis, UTF_8);
1333 try {
1334 manifest = new org.apache.tools.ant.taskdefs.Manifest(isr);
1335 } finally {
1336 isr.close();
1337 }
1338 } finally {
1339 fis.close();
1340 }
1341 } catch(e) {
1342 manifest = null;
1343 }
1344 if(manifest != null) {
1345 if(isSigned(manifest)) {
1346 print("Warning: Signed JAR can not be rebased.");
1347 } else {
1348 var mainSection = manifest.getMainSection();
1349 var classPath = mainSection.getAttributeValue(ATTR_CLASS_PATH);
1350 var classPathAttr = null;
1351 if (classPath != null) {
1352 classPathAttr = ATTR_CLASS_PATH;
1353 } else {
1354 classPath = mainSection.getAttributeValue(ATTR_CLASS_PATH_FX);
1355 if(classPath != null) {
1356 classPathAttr = ATTR_CLASS_PATH_FX;
1357 }
1358 }
1359 if(classPath != null) {
1360 var result = new java.lang.StringBuilder();
1361 var changed = false;
1362 var pathArray = classPath.split(" ");
1363 for (var i = 0; i < pathArray.length; i++) {
1364 if (result.length() > 0) {
1365 result.append(' ');
1366 }
1367 var index = pathArray[i].lastIndexOf('/');
1368 if (index >= 0 && index < pathArray[i].length - 1) {
1369 pathArray[i] = pathArray[i].substring(index+1);
1370 changed = true;
1371 }
1372 result.append(pathArray[i]);
1373 }
1374 mainSection.removeAttribute(classPathAttr);
1375 mainSection.addAttributeAndCheck(new org.apache.tools.ant.taskdefs.Manifest.Attribute(classPathAttr, result.toString()));
1376 var tgt = new String(project.getProperty("manifest.file.temp.new"));
1377 var tgf = new java.io.File(tgt);
1378 try {
1379 var fos = new java.io.FileOutputStream(tgf);
1380 try {
1381 var osw = new java.io.OutputStreamWriter(fos, UTF_8);
1382 try {
1383 var manifestOut = new java.io.PrintWriter(osw);
1384 manifest.write(manifestOut);
1385 manifestOut.close();
1386 } finally {
1387 osw.close();
1388 }
1389 } finally {
1390 fos.close();
1391 }
1392 } catch(e) {
1393 print("Warning: problem storing rebased manifest file.");
1394 }
1395 }
1396 }
1397 }
1398 ]]>
1399 </script>
1400 <antcall target="-move-new-manifest-if-exists">
1401 <param name="move.file.from" value="${manifest.file.temp.new}"/>
1402 <param name="move.file.to" value="${manifest.file.temp}"/>
1403 </antcall>
1404 <zip destfile="@{jarfile}" basedir="${tmpdir}" update="true"/>
1405 <delete dir="${tmpdir}" quiet="true"/>
1406 </sequential>
1407 </macrodef>
1408
1409 <target name="-new-temp-mainfest-existence">
1410 <condition property="new-temp-manifest-exists">
1411 <available file="${move.file.from}"/>
1412 </condition>
1413 <echo message="new-temp-manifest-exists = ${new-temp-manifest-exists}" level="verbose"/>
1414 </target>
1415
1416 <target name="-move-new-manifest-if-exists" depends="-new-temp-mainfest-existence" if="new-temp-manifest-exists">
1417 <move file="${move.file.from}" tofile="${move.file.to}" failonerror="false"/>
1418 </target>
1419
1420 <target name="-rebase-libs-macro-call">
1421 <echo message="Rebase jarfile = ${jar.file.to.rebase}" level="verbose"/>
1422 <rebase-lib jarfile="${jar.file.to.rebase}"/>
1423 </target>
1424
1425
1426 <!-- Main Deployment Target -->
1427
1428 <!-- Note: target "jfx-deployment" is referenced from NB 7.1+ build-impl.xml -->
1429 <target name="jfx-deployment" depends="-check-jfx-deployment-launch,-do-jfx-deployment-script,-do-jfx-deployment-noscript" if="jfx-deployment-available"/>
1430
1431 <target name="-check-dist-lib-exists">
1432 <deploy-defines/>
1433 <available file="${jfx.deployment.dir}${file.separator}lib" type="dir" property="dist.lib.exists"/>
1434 </target>
1435 <target name="-check-jfx-deployment-jar-current-nolib" depends="-check-dist-lib-exists" unless="dist.lib.exists">
1436 <uptodate property="jfx-deployment-jar-current" targetfile="${jfx.deployment.dir}${file.separator}${jfx.deployment.jar}" >
1437 <srcfiles dir="${basedir}${file.separator}${build.classes.dir}" includes="**${file.separator}*"/>
1438 <srcfiles dir="${basedir}${file.separator}nbproject" includes="**${file.separator}*"/>
1439 </uptodate>
1440 </target>
1441 <target name="-check-jfx-deployment-jar-current-lib" depends="-check-dist-lib-exists" if="dist.lib.exists">
1442 <uptodate property="jfx-deployment-jar-current" targetfile="${jfx.deployment.dir}${file.separator}${jfx.deployment.jar}" >
1443 <srcfiles dir="${basedir}${file.separator}${build.classes.dir}" includes="**${file.separator}*"/>
1444 <srcfiles dir="${jfx.deployment.dir}${file.separator}lib" includes="**${file.separator}*"/>
1445 <srcfiles dir="${basedir}${file.separator}nbproject" includes="**${file.separator}*"/>
1446 </uptodate>
1447 </target>
1448 <target name="-check-jfx-deployment-launch" depends="-check-jfx-deployment,-check-jfx-deployment-jar-current-nolib,-check-jfx-deployment-jar-current-lib">
1449 <condition property="do-jfx-deployment-script">
1450 <and>
1451 <isset property="jfx-deployment-available"/>
1452 <not><isset property="fallback.no.javascript"/></not>
1453 <not><isset property="jfx-deployment-jar-current"/></not>
1454 </and>
1455 </condition>
1456 <condition property="do-jfx-deployment-noscript">
1457 <and>
1458 <isset property="jfx-deployment-available"/>
1459 <isset property="fallback.no.javascript"/>
1460 <not><isset property="jfx-deployment-jar-current"/></not>
1461 </and>
1462 </condition>
1463 </target>
1464 <target name="-do-jfx-deployment-script" depends="-check-jfx-deployment-launch" if="do-jfx-deployment-script">
1465 <antcall target="jfx-deployment-script"/>
1466 </target>
1467 <target name="-do-jfx-deployment-noscript" depends="-check-jfx-deployment-launch" if="do-jfx-deployment-noscript">
1468 <antcall target="jfx-deployment-noscript"/>
1469 </target>
1470
1471 <target name="jfx-deployment-script" depends="-check-jfx-deployment,-check-project,
1472 -swing-api-warning,-icon-warning,
1473 -set-dimensions,-reset-dimensions,-set-update-mode-background,-set-update-mode-eager,
1474 -set-permissions-elevated,-reset-permissions-elevated,
1475 -copy-external-preloader-jar,-copy-binary-css,
1476 -deploy-app-sign-nopreloader-notemplate,
1477 -deploy-app-sign-preloader-notemplate,
1478 -deploy-app-sign-nopreloader-template,
1479 -deploy-app-sign-preloader-template,
1480 -deploy-app-sign-nopreloader-notemplate-swing,
1481 -deploy-app-sign-nopreloader-template-swing,
1482 -deploy-app-sign-blob-nopreloader-notemplate,
1483 -deploy-app-sign-blob-preloader-notemplate,
1484 -deploy-app-sign-blob-nopreloader-template,
1485 -deploy-app-sign-blob-preloader-template,
1486 -deploy-app-sign-blob-nopreloader-notemplate-swing,
1487 -deploy-app-sign-blob-nopreloader-template-swing,
1488 -deploy-app-nosign-nopreloader-notemplate,
1489 -deploy-app-nosign-preloader-notemplate,
1490 -deploy-app-nosign-nopreloader-template,
1491 -deploy-app-nosign-preloader-template,
1492 -deploy-app-nosign-nopreloader-notemplate-swing,
1493 -deploy-app-nosign-nopreloader-template-swing"
1494 if="jfx-deployment-available">
1495 </target>
1496
1497 <target name="jfx-deployment-noscript" depends="-check-jfx-deployment,-check-project,
1498 -swing-api-warning,-icon-warning,
1499 -set-dimensions,-reset-dimensions,-set-update-mode-background,-set-update-mode-eager,
1500 -set-permissions-elevated,-reset-permissions-elevated,
1501 -copy-external-preloader-jar,-copy-binary-css,
1502 -fallback-deploy-app-sign-nopreloader-notemplate,
1503 -fallback-deploy-app-sign-preloader-notemplate,
1504 -fallback-deploy-app-sign-nopreloader-template,
1505 -fallback-deploy-app-sign-preloader-template,
1506 -fallback-deploy-app-sign-nopreloader-notemplate-swing,
1507 -fallback-deploy-app-sign-nopreloader-template-swing,
1508 -fallback-deploy-app-sign-blob-nopreloader-notemplate,
1509 -fallback-deploy-app-sign-blob-preloader-notemplate,
1510 -fallback-deploy-app-sign-blob-nopreloader-template,
1511 -fallback-deploy-app-sign-blob-preloader-template,
1512 -fallback-deploy-app-sign-blob-nopreloader-notemplate-swing,
1513 -fallback-deploy-app-sign-blob-nopreloader-template-swing,
1514 -fallback-deploy-app-nosign-nopreloader-notemplate,
1515 -fallback-deploy-app-nosign-preloader-notemplate,
1516 -fallback-deploy-app-nosign-nopreloader-template,
1517 -fallback-deploy-app-nosign-preloader-template,
1518 -fallback-deploy-app-nosign-nopreloader-notemplate-swing,
1519 -fallback-deploy-app-nosign-nopreloader-template-swing"
1520 if="jfx-deployment-available">
1521 </target>
1522
1523
1524 <!-- Security / Signing -->
1525
1526 <target name="-unavailable-signjars-task" depends="-check-jfx-deployment" unless="jfx-deployment-available">
1527 <echo message="Warning: Task required to sign JAR file is missing, check the availability of JavaFX 2.0 deployment tasks. JAR files will not be signed."/>
1528 </target>
1529
1530 <target name="-security-props-check">
1531 <condition property="javafx.signed.true">
1532 <istrue value="${javafx.signing.enabled}"/>
1533 </condition>
1534 </target>
1535
1536 <target name="-check-signing-possible" depends="-security-props-check,-check-jfx-deployment,-unavailable-signjars-task">
1537 <condition property="javafx.signed.true+signjars.task.available">
1538 <and>
1539 <isset property="javafx.signed.true"/>
1540 <isset property="jfx-deployment-available"/>
1541 </and>
1542 </condition>
1543 </target>
1544
1545 <target name="-javafx-init-keystore" depends="-check-signing-possible,-javafx-init-signing,-javafx-init-keystore1,-javafx-init-keystore2,-check-keystore-exists"
1546 if="javafx.signed.true+signjars.task.available" unless="do.not.init.keystore">
1547 <property name="javafx.signjar.vendor" value="CN=${application.vendor}"/>
1548 <echo message="Going to create default keystore in ${javafx.signjar.keystore}"/>
1549 <genkey dname="${javafx.signjar.vendor}" alias="${javafx.signjar.alias}" keystore="${javafx.signjar.keystore}"
1550 storepass="${javafx.signjar.storepass}" keypass="${javafx.signjar.keypass}"/>
1551 </target>
1552
1553 <target name="-check-keystore-exists" depends="-security-props-check">
1554 <available property="javafx.signjar.keystore.exists" file="${javafx.signjar.keystore}"/>
1555 <condition property="do.not.init.keystore">
1556 <or>
1557 <not><isset property="javafx.signed.true"/></not>
1558 <isset property="javafx.signjar.keystore.exists"/>
1559 </or>
1560 </condition>
1561 </target>
1562
1563 <target name="-javafx-init-signing">
1564 <condition property="generated.key.signing">
1565 <equals arg1="${javafx.signing.type}" arg2="self" trim="true"/>
1566 </condition>
1567 </target>
1568
1569 <target name="-javafx-init-keystore1" depends="-javafx-init-signing" if="generated.key.signing">
1570 <property name="javafx.signjar.keystore" value="${basedir}${file.separator}build${file.separator}nb-jfx.jks" />
1571 <property name="javafx.signjar.storepass" value="storepass"/>
1572 <property name="javafx.signjar.keypass" value="keypass"/>
1573 <property name="javafx.signjar.alias" value="nb-jfx"/>
1574 </target>
1575
1576 <target name="-javafx-init-keystore2" depends="-javafx-init-signing" unless="generated.key.signing">
1577 <property name="javafx.signjar.keystore" value="${javafx.signing.keystore}" />
1578 <property name="javafx.signjar.storepass" value="${javafx.signing.keystore.password}"/>
1579 <property name="javafx.signjar.keypass" value="${javafx.signing.keyalias.password}"/>
1580 <property name="javafx.signjar.alias" value="${javafx.signing.keyalias}"/>
1581 </target>
1582
1583 <target name="-check-signing-security" depends="-security-props-check">
1584 <condition property="is.signing.unsafe">
1585 <or>
1586 <not><isset property="javafx.signed.true"/></not>
1587 <not><equals arg1="${javafx.signing.type}" arg2="key" casesensitive="false" trim="true"/></not>
1588 </or>
1589 </condition>
1590 </target>
1591
1592 <target name="-warn-insufficient-signing" depends="-check-signing-security" if="is.signing.unsafe">
1593 <echo message="Warning: Unsigned and self-signed WebStart Applications and Applets are deprecated from JDK7u21 onwards due to security reasons.${line.separator} To ensure future correct functionality please sign WebStart Applications and Applets using trusted certificate."/>
1594 </target>
1595
1596
1597 <!-- Project Deployment Macros -->
1598
1599 <macrodef name="deploy-defines">
1600 <sequential>
1601 <basename property="jfx.deployment.jar" file="${dist.jar}"/>
1602 <property name="jfx.deployment.dir" location="${dist.dir}"/>
1603 </sequential>
1604 </macrodef>
1605
1606 <macrodef name="deploy-preprocess">
1607 <sequential>
1608 <delete includeEmptyDirs="true" quiet="true">
1609 <fileset dir="${jfx.deployment.dir}${file.separator}lib">
1610 <exclude name="**${file.separator}*.jar"/>
1611 </fileset>
1612 </delete>
1613 </sequential>
1614 </macrodef>
1615
1616 <!-- fx:jar scripted call enables passing of arbitrarily long list of params and fx-version dependent behavior -->
1617 <macrodef name="deploy-jar">
1618 <sequential>
1619 <antcall target="-pre-jfx-jar"/>
1620 <echo message="javafx.ant.classpath = ${javafx.ant.classpath}" level="verbose"/>
1621 <typedef name="fx_jar" classname="com.sun.javafx.tools.ant.FXJar" classpath="${javafx.ant.classpath}"/>
1622 <echo message="Launching &lt;fx:jar&gt; task from ${ant-javafx.jar.location}" level="info"/>
1623 <property name="pp_jar_destfile" value="${jfx.deployment.dir}${file.separator}${jfx.deployment.jar}"/>
1624 <property name="pp_jar_buildclasses" value="${basedir}${file.separator}${build.classes.dir}"/>
1625 <property name="pp_jar_cssbss" value="**${file.separator}*.${css-exclude-ext}"/>
1626 <property name="pp_jar_dir" value="${jfx.deployment.dir}"/>
1627 <property name="pp_jar_fs1" value="lib${file.separator}${javafx.preloader.jar.filename}"/>
1628 <property name="pp_jar_fs2" value="lib${file.separator}*.jar"/>
1629 <echo message="deploy_jar: pp_jar_destfile = ${pp_jar_destfile}" level="verbose"/>
1630 <echo message="deploy_jar: pp_jar_buildclasses = ${pp_jar_buildclasses}" level="verbose"/>
1631 <echo message="deploy_jar: pp_jar_cssbss = ${pp_jar_cssbss}" level="verbose"/>
1632 <echo message="deploy_jar: pp_jar_dir = ${pp_jar_dir}" level="verbose"/>
1633 <echo message="deploy_jar: pp_jar_fs1 = ${pp_jar_fs1}" level="verbose"/>
1634 <echo message="deploy_jar: pp_jar_fs2 = ${pp_jar_fs2}" level="verbose"/>
1635 <echo message="JavaScript: deploy-jar" level="verbose"/>
1636 <script language="javascript">
1637 <![CDATA[
1638 function isTrue(prop) {
1639 return prop != null &&
1640 ( prop.toLowerCase() == "true" || prop.toLowerCase() == "yes" || prop.toLowerCase() == "on" );
1641 }
1642 function prefix(s, len) {
1643 if(s == null || len <= 0 || s.length == 0) {
1644 return new String("");
1645 }
1646 return new String(s.substr(0, len));
1647 }
1648 function replaceSuffix(s, os, ns) {
1649 return prefix(s, s.indexOf(os)).concat(ns);
1650 }
1651 function startsWith(s, prefix) {
1652 return (s != null) && (s.indexOf(prefix) == 0);
1653 }
1654 function endsWith(s, suffix) {
1655 var i = s.lastIndexOf(suffix);
1656 return (i != -1) && (i == (s.length - suffix.length));
1657 }
1658 function defined(s) {
1659 return (s != null) && (s != "null") && (s.length > 0);
1660 }
1661 function contains(array, prop) {
1662 for (var i = 0; i < array.length; i++) {
1663 var s1 = new String(array[i]);
1664 var s2 = new String(prop);
1665 if( s1.toLowerCase() == s2.toLowerCase() ) {
1666 return true;
1667 }
1668 }
1669 return false;
1670 }
1671 var S = new String(java.io.File.separator);
1672 var JFXPAR = "javafx.param";
1673 var JFXMAN = "javafx.manifest.entry";
1674 var JFXPARN = "name";
1675 var JFXPARV = "value";
1676 var JFXPARH = "hidden";
1677 var JFXLAZY = "download.mode.lazy.jar";
1678 var withpreloader = new String(project.getProperty("app-with-preloader"));
1679 var fx_ant_api_1_1 = new String(project.getProperty("have-fx-ant-api-1.1"));
1680 var fx_ant_api_1_2 = new String(project.getProperty("have-fx-ant-api-1.2"));
1681 var fx_in_swing_app = new String(project.getProperty("fx-in-swing-app"));
1682
1683 // get jars with lazy download mode property set
1684 function getLazyJars() {
1685 var jars = new Array();
1686 var keys = project.getProperties().keys();
1687 while(keys.hasMoreElements()) {
1688 var pn = new String(keys.nextElement());
1689 if(startsWith(pn, JFXLAZY)) {
1690 var fname = new String(pn.substring(JFXLAZY.length+1));
1691 jars.push(fname);
1692 }
1693 }
1694 return jars.length > 0 ? jars : null;
1695 }
1696 // set download mode of dependent libraries
1697 function setDownloadMode(fsEager, fsLazy, jars) {
1698 for(var i = 0; i < jars.length; i++) {
1699 fsEager.setExcludes("lib" + S + jars[i]);
1700 fsLazy.setIncludes("lib" + S + jars[i]);
1701 }
1702 }
1703
1704 // fx:jar
1705 var jar = project.createTask("fx_jar");
1706 jar.setProject(project);
1707 var destfile = new String(project.getProperty("pp_jar_destfile"));
1708 jar.setDestfile(destfile);
1709
1710 // fx:application
1711 var app = jar.createApplication();
1712 app.setProject(project);
1713 var title = new String(project.getProperty("application.title"));
1714 var mainclass;
1715 if(isTrue(fx_in_swing_app) && isTrue(fx_ant_api_1_2)) {
1716 mainclass = new String(project.getProperty("main.class"));
1717 app.setToolkit("swing");
1718 } else {
1719 mainclass = new String(project.getProperty("javafx.main.class"));
1720 }
1721 var fallback = new String(project.getProperty("javafx.fallback.class"));
1722 app.setName(title);
1723 app.setMainClass(mainclass);
1724 app.setFallbackClass(fallback);
1725 if(isTrue(withpreloader)) {
1726 preloaderclass = new String(project.getProperty("javafx.preloader.class"));
1727 app.setPreloaderClass(preloaderclass);
1728 }
1729 var appversion = new String(project.getProperty("javafx.application.implementation.version"));
1730 if(defined(appversion)) {
1731 app.setVersion(appversion);
1732 } else {
1733 app.setVersion("1.0");
1734 }
1735 // fx:param, fx:argument
1736 var searchHides = project.getProperties().keys();
1737 var hides = new Array();
1738 while(searchHides.hasMoreElements()) {
1739 // collect all hidden property names
1740 var pns = new String(searchHides.nextElement());
1741 if(startsWith(pns, JFXPAR) && endsWith(pns, JFXPARN)) {
1742 var propns = new String(project.getProperty(pns));
1743 var phs = replaceSuffix(pns, JFXPARN, JFXPARH);
1744 var proph = new String(project.getProperty(phs));
1745 if(isTrue(proph)) {
1746 hides.push(propns);
1747 }
1748 }
1749 }
1750 var keys = project.getProperties().keys();
1751 while(keys.hasMoreElements()) {
1752 var pn = new String(keys.nextElement());
1753 if(startsWith(pn, JFXPAR) && endsWith(pn, JFXPARN)) {
1754 var propn = new String(project.getProperty(pn));
1755 if(defined(propn) && !contains(hides, propn)) {
1756 var pv = replaceSuffix(pn, JFXPARN, JFXPARV);
1757 var propv = new String(project.getProperty(pv));
1758 if(defined(propv)) {
1759 var par = app.createParam();
1760 par.setName(propn);
1761 par.setValue(propv);
1762 } else {
1763 if(isTrue(fx_ant_api_1_1)) {
1764 var arg = app.createArgument();
1765 arg.addText(propn);
1766 } else {
1767 print("Warning: Unnamed parameters not supported by this version of JavaFX SDK deployment Ant tasks. Upgrade JavaFX to 2.0.2 or higher.");
1768 }
1769 }
1770 }
1771 }
1772 }
1773
1774 // fx:resources
1775 var res = jar.createResources();
1776 res.setProject(project);
1777 var pdir = new String(project.getProperty("pp_jar_dir"));
1778 if(isTrue(withpreloader)) {
1779 var f1 = res.createFileSet();
1780 f1.setProject(project);
1781 f1.setDir(new java.io.File(pdir));
1782 var i1 = new String(project.getProperty("pp_jar_fs1"));
1783 f1.setIncludes(i1);
1784 f1.setRequiredFor("preloader");
1785 var f2 = res.createFileSet();
1786 f2.setProject(project);
1787 f2.setDir(new java.io.File(pdir));
1788 var i2b = new String(project.getProperty("pp_jar_fs2"));
1789 var e2c = new String(project.getProperty("pp_jar_fs1"));
1790 f2.setIncludes(i2b);
1791 f2.setExcludes(e2c);
1792 f2.setRequiredFor("startup");
1793 var lazyjars = getLazyJars();
1794 if(lazyjars != null) {
1795 var f3 = res.createFileSet();
1796 f3.setProject(project);
1797 f3.setDir(new java.io.File(pdir));
1798 f3.setRequiredFor("runtime");
1799 setDownloadMode(f2,f3,lazyjars);
1800 }
1801 } else {
1802 var fn = res.createFileSet();
1803 fn.setProject(project);
1804 fn.setDir(new java.io.File(pdir));
1805 var ib = new String(project.getProperty("pp_jar_fs2"));
1806 fn.setIncludes(ib);
1807 fn.setRequiredFor("startup");
1808 var lazyjars = getLazyJars();
1809 if(lazyjars != null) {
1810 var fn2 = res.createFileSet();
1811 fn2.setProject(project);
1812 fn2.setDir(new java.io.File(pdir));
1813 fn2.setRequiredFor("runtime");
1814 setDownloadMode(fn,fn2,lazyjars);
1815 }
1816 }
1817
1818 // fileset to exclude *.css or *.bss
1819 var fs = jar.createFileSet();
1820 fs.setProject(project);
1821 var buildcls = new String(project.getProperty("pp_jar_buildclasses"));
1822 var exc = new String(project.getProperty("pp_jar_cssbss"));
1823 fs.setDir(new java.io.File(buildcls));
1824 fs.setExcludes(exc);
1825
1826 // manifest
1827 var man = jar.createManifest();
1828 var a1val = new String(project.getProperty("application.vendor"));
1829 var a1 = new org.apache.tools.ant.taskdefs.Manifest.Attribute();
1830 a1.setName("Implementation-Vendor");
1831 a1.setValue(a1val);
1832 man.addConfiguredAttribute(a1);
1833 var a2val = new String(project.getProperty("application.title"));
1834 var a2 = new org.apache.tools.ant.taskdefs.Manifest.Attribute();
1835 a2.setName("Implementation-Title");
1836 a2.setValue(a2val);
1837 man.addConfiguredAttribute(a2);
1838 if(defined(appversion)) {
1839 var a3 = new org.apache.tools.ant.taskdefs.Manifest.Attribute();
1840 a3.setName("Implementation-Version");
1841 a3.setValue(appversion);
1842 man.addConfiguredAttribute(a3);
1843 }
1844 var a4prop = new String(project.getProperty("javafx.deploy.disable.proxy"));
1845 if(isTrue(a4prop)) {
1846 var a4 = new org.apache.tools.ant.taskdefs.Manifest.Attribute();
1847 a4.setName("JavaFX-Feature-Proxy");
1848 a4.setValue("None");
1849 man.addConfiguredAttribute(a4);
1850 }
1851 // custom manifest entries
1852 var searchManifestHides = project.getProperties().keys();
1853 var manifestHides = new Array();
1854 while(searchManifestHides.hasMoreElements()) {
1855 // collect all hidden property names
1856 var pns = new String(searchManifestHides.nextElement());
1857 if(startsWith(pns, JFXMAN) && endsWith(pns, JFXPARN)) {
1858 var propns = new String(project.getProperty(pns));
1859 var phs = replaceSuffix(pns, JFXPARN, JFXPARH);
1860 var proph = new String(project.getProperty(phs));
1861 if(isTrue(proph)) {
1862 manifestHides.push(propns);
1863 }
1864 }
1865 }
1866 var manifestKeys = project.getProperties().keys();
1867 while(manifestKeys.hasMoreElements()) {
1868 var pn = new String(manifestKeys.nextElement());
1869 if(startsWith(pn, JFXMAN) && endsWith(pn, JFXPARN)) {
1870 var propn = new String(project.getProperty(pn));
1871 if(defined(propn) && !contains(manifestHides, propn)) {
1872 var propnr = propn.replace(/\s/g, "-");
1873 var entry = new org.apache.tools.ant.taskdefs.Manifest.Attribute();
1874 entry.setName(propnr);
1875 var pv = replaceSuffix(pn, JFXPARN, JFXPARV);
1876 var propv = new String(project.getProperty(pv));
1877 if(defined(propv)) {
1878 entry.setValue(propv);
1879 } else {
1880 entry.setValue("");
1881 }
1882 man.addConfiguredAttribute(entry);
1883 }
1884 }
1885 }
1886 var profileAvailable = new String(project.getProperty("profile.available"));
1887 if (defined(profileAvailable)) {
1888 var profileAttribute = new org.apache.tools.ant.taskdefs.Manifest.Attribute();
1889 profileAttribute.setName("Profile");
1890 profileAttribute.setValue(new String(project.getProperty("javac.profile")));
1891 man.addConfiguredAttribute(profileAttribute);
1892 }
1893 var perm_elev = new String(project.getProperty("permissions.elevated"));
1894 var cust_perm = new String(project.getProperty("manifest.custom.permissions"));
1895 var cust_cb = new String(project.getProperty("manifest.custom.codebase"));
1896 var sa1 = new org.apache.tools.ant.taskdefs.Manifest.Attribute();
1897 sa1.setName("Codebase");
1898 if(!defined(cust_cb) || cust_cb == "*") {
1899 sa1.setValue("*");
1900 print("Warning: From JDK7u25 the Codebase manifest attribute should be used to restrict JAR repurposing.");
1901 print(" Please set manifest.custom.codebase property to override the current default non-secure value '*'.");
1902 } else {
1903 sa1.setValue(cust_cb);
1904 }
1905 man.addConfiguredAttribute(sa1);
1906 var sa2 = new org.apache.tools.ant.taskdefs.Manifest.Attribute();
1907 sa2.setName("Permissions");
1908 if(!defined(cust_perm)) {
1909 if(isTrue(perm_elev)) {
1910 sa2.setValue("all-permissions");
1911 } else {
1912 sa2.setValue("sandbox");
1913 }
1914 } else {
1915 if(cust_perm == "all-permissions") {
1916 sa2.setValue("all-permissions");
1917 } else {
1918 sa2.setValue("sandbox");
1919 }
1920 }
1921 man.addConfiguredAttribute(sa2);
1922 // Note: see JavaFX Jira issue #RT-25003 if attribute names are created lowercase in manifest
1923
1924 jar.perform();
1925 ]]>
1926 </script>
1927 <antcall target="-post-jfx-jar"/>
1928 </sequential>
1929 </macrodef>
1930
1931 <macrodef name="deploy-sign">
1932 <sequential>
1933 <echo message="keystore=${javafx.signjar.keystore}" level="verbose"/>
1934 <echo message="storepass=${javafx.signjar.storepass}" level="verbose"/>
1935 <echo message="alias=${javafx.signjar.alias}" level="verbose"/>
1936 <echo message="keypass=${javafx.signjar.keypass}" level="verbose"/>
1937 <signjar keystore="${javafx.signjar.keystore}"
1938 storepass="${javafx.signjar.storepass}"
1939 alias="${javafx.signjar.alias}"
1940 keypass="${javafx.signjar.keypass}">
1941 <fileset dir="${jfx.deployment.dir}">
1942 <include name="${jfx.deployment.jar}"/>
1943 <include name="lib${file.separator}*.jar"/>
1944 </fileset>
1945 </signjar>
1946 </sequential>
1947 </macrodef>
1948
1949 <macrodef name="deploy-sign-blob">
1950 <sequential>
1951 <echo message="keystore=${javafx.signjar.keystore}" level="verbose"/>
1952 <echo message="storepass=${javafx.signjar.storepass}" level="verbose"/>
1953 <echo message="alias=${javafx.signjar.alias}" level="verbose"/>
1954 <echo message="keypass=${javafx.signjar.keypass}" level="verbose"/>
1955 <echo message="Launching &lt;fx:signjar&gt; task from ${ant-javafx.jar.location}" level="info"/>
1956 <fx:signjar keystore="${javafx.signjar.keystore}"
1957 storepass="${javafx.signjar.storepass}"
1958 alias="${javafx.signjar.alias}"
1959 keypass="${javafx.signjar.keypass}">
1960 <fileset dir="${jfx.deployment.dir}">
1961 <include name="${jfx.deployment.jar}"/>
1962 <include name="lib${file.separator}*.jar"/>
1963 </fileset>
1964 </fx:signjar>
1965 </sequential>
1966 </macrodef>
1967
1968 <macrodef name="deploy-sign-preloader">
1969 <sequential>
1970 <echo message="keystore=${javafx.signjar.keystore}" level="verbose"/>
1971 <echo message="storepass=${javafx.signjar.storepass}" level="verbose"/>
1972 <echo message="alias=${javafx.signjar.alias}" level="verbose"/>
1973 <echo message="keypass=${javafx.signjar.keypass}" level="verbose"/>
1974 <signjar keystore="${javafx.signjar.keystore}"
1975 storepass="${javafx.signjar.storepass}"
1976 alias="${javafx.signjar.alias}"
1977 keypass="${javafx.signjar.keypass}">
1978 <fileset dir="${jfx.deployment.dir}">
1979 <include name="lib${file.separator}${javafx.preloader.jar.filename}"/>
1980 </fileset>
1981 </signjar>
1982 <signjar keystore="${javafx.signjar.keystore}"
1983 storepass="${javafx.signjar.storepass}"
1984 alias="${javafx.signjar.alias}"
1985 keypass="${javafx.signjar.keypass}">
1986 <fileset dir="${jfx.deployment.dir}">
1987 <include name="${jfx.deployment.jar}"/>
1988 <include name="lib${file.separator}*.jar"/>
1989 <exclude name="lib${file.separator}${javafx.preloader.jar.filename}"/>
1990 </fileset>
1991 </signjar>
1992 </sequential>
1993 </macrodef>
1994
1995 <macrodef name="deploy-sign-blob-preloader">
1996 <sequential>
1997 <echo message="keystore=${javafx.signjar.keystore}" level="verbose"/>
1998 <echo message="storepass=${javafx.signjar.storepass}" level="verbose"/>
1999 <echo message="alias=${javafx.signjar.alias}" level="verbose"/>
2000 <echo message="keypass=${javafx.signjar.keypass}" level="verbose"/>
2001 <signjar keystore="${javafx.signjar.keystore}"
2002 storepass="${javafx.signjar.storepass}"
2003 alias="${javafx.signjar.alias}"
2004 keypass="${javafx.signjar.keypass}">
2005 <fileset dir="${jfx.deployment.dir}">
2006 <include name="lib${file.separator}${javafx.preloader.jar.filename}"/>
2007 </fileset>
2008 </signjar>
2009 <echo message="Launching &lt;fx:signjar&gt; task from ${ant-javafx.jar.location}" level="info"/>
2010 <fx:signjar keystore="${javafx.signjar.keystore}"
2011 storepass="${javafx.signjar.storepass}"
2012 alias="${javafx.signjar.alias}"
2013 keypass="${javafx.signjar.keypass}">
2014 <fileset dir="${jfx.deployment.dir}">
2015 <include name="${jfx.deployment.jar}"/>
2016 <include name="lib${file.separator}*.jar"/>
2017 <exclude name="lib${file.separator}${javafx.preloader.jar.filename}"/>
2018 </fileset>
2019 </fx:signjar>
2020 </sequential>
2021 </macrodef>
2022
2023 <macrodef name="deploy-process-template">
2024 <sequential>
2025 <echo message="javafx.run.htmltemplate = ${javafx.run.htmltemplate}" level="verbose"/>
2026 <pathconvert property="javafx.run.htmltemplate.processed">
2027 <path path="${javafx.run.htmltemplate}"/>
2028 <mapper>
2029 <chainedmapper>
2030 <flattenmapper/>
2031 <globmapper from="*" to="${jfx.deployment.dir}${file.separator}*" casesensitive="no"/>
2032 </chainedmapper>
2033 </mapper>
2034 </pathconvert>
2035 <echo message="javafx.run.htmltemplate.processed = ${javafx.run.htmltemplate.processed}" level="verbose"/>
2036 </sequential>
2037 </macrodef>
2038
2039 <!-- fx:deploy scripted call enables passing of arbitrarily long lists of params, vmoptions and callbacks and fx-version dependent behavior -->
2040 <macrodef name="deploy-deploy">
2041 <sequential>
2042 <antcall target="-pre-jfx-deploy"/>
2043 <antcall target="-call-pre-jfx-native"/>
2044 <echo message="javafx.ant.classpath = ${javafx.ant.classpath}" level="verbose"/>
2045 <typedef name="fx_deploy" classname="com.sun.javafx.tools.ant.DeployFXTask" classpath="${javafx.ant.classpath}"/>
2046 <echo message="Launching &lt;fx:deploy&gt; task from ${ant-javafx.jar.location}" level="info"/>
2047 <property name="pp_deploy_dir" value="${jfx.deployment.dir}"/>
2048 <property name="pp_deploy_fs1" value="lib${file.separator}${javafx.preloader.jar.filename}"/>
2049 <property name="pp_deploy_fs2" value="lib${file.separator}*.jar"/>
2050 <echo message="deploy_deploy: pp_deploy_dir = ${pp_deploy_dir}" level="verbose"/>
2051 <echo message="deploy_deploy: pp_deploy_fs1 = ${pp_deploy_fs1}" level="verbose"/>
2052 <echo message="deploy_deploy: pp_deploy_fs2 = ${pp_deploy_fs2}" level="verbose"/>
2053 <echo message="JavaScript: deploy-deploy" level="verbose"/>
2054 <basename property="jfx.deployment.base" file="${jfx.deployment.jar}" suffix=".jar"/>
2055 <script language="javascript">
2056 <![CDATA[
2057 function isTrue(prop) {
2058 return prop != null &&
2059 (prop.toLowerCase()=="true" || prop.toLowerCase()=="yes" || prop.toLowerCase()=="on");
2060 }
2061 function prefix(s, len) {
2062 if(s == null || len <= 0 || s.length == 0) {
2063 return new String("");
2064 }
2065 return new String(s.substr(0, len));
2066 }
2067 function replaceSuffix(s, os, ns) {
2068 return prefix(s, s.indexOf(os)).concat(ns);
2069 }
2070 function startsWith(s, prefix) {
2071 return (s != null) && (s.indexOf(prefix) == 0);
2072 }
2073 function endsWith(s, suffix) {
2074 var i = s.lastIndexOf(suffix);
2075 return (i != -1) && (i == (s.length - suffix.length));
2076 }
2077 function defined(s) {
2078 return (s != null) && (s != "null") && (s.length > 0);
2079 }
2080 function contains(array, prop) {
2081 for (var i = 0; i < array.length; i++) {
2082 var s1 = new String(array[i]);
2083 var s2 = new String(prop);
2084 if( s1.toLowerCase() == s2.toLowerCase() ) {
2085 return true;
2086 }
2087 }
2088 return false;
2089 }
2090 var S = java.io.File.separator;
2091 var JFXPAR = "javafx.param";
2092 var JFXPARN = "name";
2093 var JFXPARV = "value";
2094 var JFXPARH = "hidden";
2095 var JFXCALLB = "javafx.jscallback";
2096 var JFXLAZY = "download.mode.lazy.jar";
2097 var withpreloader = new String(project.getProperty("app-with-preloader"));
2098 var fx_ant_api_1_1 = new String(project.getProperty("have-fx-ant-api-1.1"));
2099 var fx_ant_api_1_2 = new String(project.getProperty("have-fx-ant-api-1.2"));
2100 var have_jdk_pre7u14 = new String(project.getProperty("have-jdk-pre7u14"));
2101 var fx_in_swing_app = new String(project.getProperty("fx-in-swing-app"));
2102 var debug_in_browser = new String(project.getProperty("project.state.debugging.in.browser"));
2103
2104 // get jars with lazy download mode property set
2105 function getLazyJars() {
2106 var jars = new Array();
2107 var keys = project.getProperties().keys();
2108 while(keys.hasMoreElements()) {
2109 var pn = new String(keys.nextElement());
2110 if(startsWith(pn, JFXLAZY)) {
2111 var fname = pn.substring(JFXLAZY.length+1);
2112 jars.push(fname);
2113 }
2114 }
2115 return jars.length > 0 ? jars : null;
2116 }
2117 // set download mode of dependent libraries
2118 function setDownloadMode(fsEager, fsLazy, jars) {
2119 for(var i = 0; i < jars.length; i++) {
2120 fsEager.setExcludes("lib" + S + jars[i]);
2121 fsLazy.setIncludes("lib" + S + jars[i]);
2122 }
2123 }
2124 // convert path to absolute if relative
2125 function derelativizePath(path) {
2126 var f = new java.io.File(path);
2127 if(!f.exists()) {
2128 f = new java.io.File(new String(project.getBaseDir()) + S + path);
2129 }
2130 if(f.exists()) {
2131 try {
2132 return f.getCanonicalPath();
2133 } catch(err) {
2134 return path;
2135 }
2136 }
2137 return path;
2138 }
2139
2140 // fx:deploy
2141 var deploy = project.createTask("fx_deploy");
2142 deploy.setProject(project);
2143 var width = new String(project.getProperty("javafx.width"));
2144 var height = new String(project.getProperty("javafx.height"));
2145 var outdir = new String(project.getProperty("jfx.deployment.dir"));
2146 var embedJNLP = new String(project.getProperty("javafx.deploy.embedJNLP"));
2147 var updatemode = new String(project.getProperty("update-mode"));
2148 var outfile = new String(project.getProperty("application.title"));
2149 var includeDT = new String(project.getProperty("javafx.deploy.includeDT"));
2150 var offline = new String(project.getProperty("javafx.deploy.allowoffline"));
2151 if (width.indexOf("%") != -1) {
2152 deploy.setEmbeddedWidth(width);
2153 deploy.setWidth(800);
2154 } else {
2155 deploy.setWidth(width);
2156 }
2157 if (height.indexOf("%") != -1) {
2158 deploy.setEmbeddedHeight(height);
2159 deploy.setHeight(600);
2160 } else {
2161 deploy.setHeight(height);
2162 }
2163 deploy.setOutdir(outdir);
2164 deploy.setEmbedJNLP(isTrue(embedJNLP));
2165 deploy.setUpdateMode(updatemode);
2166 deploy.setOutfile(outfile);
2167 deploy.setIncludeDT(isTrue(includeDT));
2168 if(defined(offline)) {
2169 if(isTrue(fx_ant_api_1_1)) {
2170 deploy.setOfflineAllowed(isTrue(offline));
2171 } else {
2172 print("Warning: offlineAllowed not supported by this version of JavaFX SDK deployment Ant task. Please upgrade JavaFX to 2.0.2 or higher.");
2173 }
2174 }
2175 // native packaging (time consuming, thus applied in explicit build only)
2176 var nativeEnabled = new String(project.getProperty("do.build.native.package"));
2177 var nativeType = new String(project.getProperty("javafx.native.bundling.type"));
2178 var projStateRun = new String(project.getProperty("project.state.running"));
2179 var projStateDbg = new String(project.getProperty("project.state.debugging"));
2180 var projStatePrf = new String(project.getProperty("project.state.profiling"));
2181 if(isTrue(nativeEnabled) && defined(nativeType) && nativeType != "none") {
2182 if(!isTrue(projStateRun) && !isTrue(projStateDbg) && !isTrue(projStatePrf)) {
2183 if(isTrue(fx_ant_api_1_2)) {
2184 deploy.setNativeBundles(nativeType);
2185 print("Note: To create native bundles the <fx:deploy> task may require external tools. See JavaFX 2.2+ documentation for details.");
2186 print("");
2187 print("Launching <fx:deploy> in native packager mode...");
2188 } else {
2189 print("Warning: Native packaging is not supported by this version of JavaFX SDK deployment Ant task. Please upgrade to JDK 7u6 or higher.");
2190 }
2191 }
2192 }
2193
2194 // fx:application
2195 var app = deploy.createApplication();
2196 app.setProject(project);
2197 var title = new String(project.getProperty("application.title"));
2198 var mainclass;
2199 if(isTrue(fx_in_swing_app) && isTrue(fx_ant_api_1_2)) {
2200 mainclass = new String(project.getProperty("main.class"));
2201 app.setToolkit("swing");
2202 } else {
2203 mainclass = new String(project.getProperty("javafx.main.class"));
2204 }
2205 var fallback = new String(project.getProperty("javafx.fallback.class"));
2206 app.setName(title);
2207 app.setMainClass(mainclass);
2208 app.setFallbackClass(fallback);
2209 if(isTrue(withpreloader)) {
2210 preloaderclass = new String(project.getProperty("javafx.preloader.class"));
2211 app.setPreloaderClass(preloaderclass);
2212 }
2213 var appversion = new String(project.getProperty("javafx.application.implementation.version"));
2214 if(defined(appversion)) {
2215 app.setVersion(appversion);
2216 } else {
2217 app.setVersion("1.0");
2218 }
2219 // fx:param, fx:argument
2220 var searchHides = project.getProperties().keys();
2221 var hides = new Array();
2222 while(searchHides.hasMoreElements()) {
2223 // collect all hidden property names
2224 var pns = new String(searchHides.nextElement());
2225 if(startsWith(pns, JFXPAR) && endsWith(pns, JFXPARN)) {
2226 var propns = new String(project.getProperty(pns));
2227 var phs = replaceSuffix(pns, JFXPARN, JFXPARH);
2228 var proph = new String(project.getProperty(phs));
2229 if(isTrue(proph)) {
2230 hides.push(propns);
2231 }
2232 }
2233 }
2234 var keys = project.getProperties().keys();
2235 while(keys.hasMoreElements()) {
2236 var pn = new String(keys.nextElement());
2237 if(startsWith(pn, JFXPAR) && endsWith(pn, JFXPARN)) {
2238 var propn = new String(project.getProperty(pn));
2239 if(defined(propn) && !contains(hides, propn)) {
2240 var pv = replaceSuffix(pn, JFXPARN, JFXPARV);
2241 var propv = new String(project.getProperty(pv));
2242 if(defined(propv)) {
2243 var par = app.createParam();
2244 par.setName(propn);
2245 par.setValue(propv);
2246 } else {
2247 if(isTrue(fx_ant_api_1_1)) {
2248 var arg = app.createArgument();
2249 arg.addText(propn);
2250 } else {
2251 print("Warning: Unnamed parameters not supported by this version of JavaFX SDK deployment Ant tasks. Upgrade JavaFX to 2.0.2 or higher.");
2252 }
2253 }
2254 }
2255 }
2256 }
2257
2258 // fx:resources
2259 var res = deploy.createResources();
2260 res.setProject(project);
2261 var deploydir = new String(project.getProperty("pp_deploy_dir"));
2262 if(isTrue(withpreloader)) {
2263 var f1 = res.createFileSet();
2264 f1.setProject(project);
2265 f1.setDir(new java.io.File(deploydir));
2266 var i1 = new String(project.getProperty("pp_deploy_fs1"));
2267 f1.setIncludes(i1);
2268 f1.setRequiredFor("preloader");
2269 var f2 = res.createFileSet();
2270 f2.setProject(project);
2271 f2.setDir(new java.io.File(deploydir));
2272 var i2a = new String(project.getProperty("jfx.deployment.jar"));
2273 var i2b = new String(project.getProperty("pp_deploy_fs2"));
2274 var e2c = new String(project.getProperty("pp_deploy_fs1"));
2275 f2.setIncludes(i2a);
2276 f2.setIncludes(i2b);
2277 f2.setExcludes(e2c);
2278 f2.setRequiredFor("startup");
2279 var lazyjars = getLazyJars();
2280 if(lazyjars != null) {
2281 var f3 = res.createFileSet();
2282 f3.setProject(project);
2283 f3.setDir(new java.io.File(deploydir));
2284 f3.setRequiredFor("runtime");
2285 setDownloadMode(f2,f3,lazyjars);
2286 }
2287 } else {
2288 var fn = res.createFileSet();
2289 fn.setProject(project);
2290 fn.setDir(new java.io.File(deploydir));
2291 var ia = new String(project.getProperty("jfx.deployment.jar"));
2292 var ib = new String(project.getProperty("pp_deploy_fs2"));
2293 fn.setIncludes(ia);
2294 fn.setIncludes(ib);
2295 fn.setRequiredFor("startup");
2296 var lazyjars = getLazyJars();
2297 if(lazyjars != null) {
2298 var fn2 = res.createFileSet();
2299 fn2.setProject(project);
2300 fn2.setDir(new java.io.File(deploydir));
2301 fn2.setRequiredFor("runtime");
2302 setDownloadMode(fn,fn2,lazyjars);
2303 }
2304 }
2305
2306 // fx:info
2307 var info = deploy.createInfo();
2308 info.setProject(project);
2309 var vendor = new String(project.getProperty("application.vendor"));
2310 var description = new String(project.getProperty("application.desc"));
2311 info.setTitle(title); // title known from before
2312 info.setVendor(vendor);
2313 info.setDescription(description);
2314 var splash = new String(project.getProperty("javafx.deploy.splash"));
2315 if(defined(splash)) {
2316 if(isTrue(fx_ant_api_1_1)) {
2317 var sicon = info.createSplash();
2318 sicon.setHref(splash);
2319 sicon.setMode("any");
2320 print("Adding splash image reference: " + splash);
2321 } else {
2322 print("Warning: Splash Image not supported by this version of JavaFX SDK deployment Ant task. Please upgrade JavaFX to 2.0.2 or higher.");
2323 }
2324 }
2325 if(isTrue(nativeEnabled) && defined(nativeType) && nativeType != "none") {
2326 var icon = new String(project.getProperty("javafx.deploy.icon.native"));
2327 if(defined(icon)) {
2328 if(isTrue(fx_ant_api_1_2) && !isTrue(have_jdk_pre7u14)) {
2329 var dicon = derelativizePath(icon);
2330 // create temporary icon copy renamed to application name (required by native packager)
2331 var baseDir = new String(project.getProperty("basedir"));
2332 var buildDir = new String(project.getProperty("build.dir"));
2333 var deployBase = new String(project.getProperty("jfx.deployment.base"));
2334 var copyTask = project.createTask("copy");
2335 var source = new java.io.File(dicon);
2336 var sourceName = new String(source.getName());
2337 var lastDot = sourceName.lastIndexOf(".");
2338 var sourceExt;
2339 if(lastDot >=0) {
2340 sourceExt = sourceName.substr(lastDot);
2341 } else {
2342 sourceExt = new String("");
2343 }
2344 var target = new java.io.File(baseDir.concat(S).concat(buildDir).concat(S).concat("icon").concat(S).concat(deployBase).concat(sourceExt));
2345 copyTask.setFile(source);
2346 copyTask.setTofile(target);
2347 copyTask.setFlatten(true);
2348 copyTask.setFailOnError(false);
2349 copyTask.perform();
2350 var tempicon;
2351 if(target.exists()) {
2352 try {
2353 tempicon = target.getCanonicalPath();
2354 } catch(err) {
2355 tempicon = dicon;
2356 }
2357 } else {
2358 tempicon = dicon;
2359 }
2360 var nicon = info.createIcon();
2361 nicon.setHref(tempicon);
2362 print("Source native icon reference: " + dicon);
2363 print("Processed native icon reference: " + tempicon);
2364 } else {
2365 print("Warning: Native Package icon not supported by this version of JavaFX SDK deployment Ant task. Please upgrade to JDK7u14.");
2366 }
2367 }
2368 } else {
2369 var icon = new String(project.getProperty("javafx.deploy.icon"));
2370 if(defined(icon)) {
2371 if(isTrue(fx_ant_api_1_1)) {
2372 var iicon = info.createIcon();
2373 iicon.setHref(icon);
2374 print("Adding WebStart icon reference: " + icon);
2375 } else {
2376 print("Warning: WebStart Icon not supported by this version of JavaFX SDK deployment Ant task. Please upgrade JavaFX to 2.0.2 or higher.");
2377 }
2378 }
2379 }
2380
2381 // fx:permissions
2382 var perm = deploy.createPermissions();
2383 perm.setProject(project);
2384 var elev = new String(project.getProperty("permissions.elevated"));
2385 perm.setElevated(isTrue(elev));
2386
2387 // fx:preferences
2388 var pref = deploy.createPreferences();
2389 pref.setProject(project);
2390 var scut = new String(project.getProperty("javafx.deploy.adddesktopshortcut"));
2391 var instp = new String(project.getProperty("javafx.deploy.installpermanently"));
2392 var smenu = new String(project.getProperty("javafx.deploy.addstartmenushortcut"));
2393 pref.setShortcut(isTrue(scut));
2394 pref.setInstall(isTrue(instp));
2395 pref.setMenu(isTrue(smenu));
2396
2397 // fx:template
2398 var templ = new String(project.getProperty("javafx.run.htmltemplate"));
2399 var templp = new String(project.getProperty("javafx.run.htmltemplate.processed"));
2400 if(defined(templ) && defined(templp)) {
2401 var temp = deploy.createTemplate();
2402 temp.setProject(project);
2403 temp.setFile(new java.io.File(templ));
2404 temp.setTofile(new java.io.File(templp));
2405 }
2406
2407 // fx:platform
2408 var plat = deploy.createPlatform();
2409 plat.setProject(project);
2410 var requestRT = new String(project.getProperty("javafx.deploy.request.runtime"));
2411 if(defined(requestRT)) {
2412 plat.setJavafx(requestRT);
2413 }
2414 var jvmargs = new String(project.getProperty("run.jvmargs"));
2415 if(defined(jvmargs)) {
2416 var jvmargss = jvmargs.split(" ");
2417 for(var i = 0; i < jvmargss.length; i++) {
2418 if(defined(jvmargss[i])) {
2419 var vmarg = plat.createJvmarg();
2420 vmarg.setValue(jvmargss[i]);
2421 }
2422 }
2423 }
2424 if(isTrue(debug_in_browser)) {
2425 var vmarg = plat.createJvmarg();
2426 vmarg.setValue(new String("-ea:javafx.browserdebug"));
2427 }
2428 if(isTrue(nativeEnabled) && defined(nativeType) && nativeType != "none") {
2429 if(!isTrue(projStateRun) && !isTrue(projStateDbg) && !isTrue(projStatePrf)) {
2430 if(plat.setBasedir) {
2431 var sdkdir = new String(project.getProperty("javafx.sdk"));
2432 if(defined(sdkdir)) {
2433 plat.setBasedir(sdkdir);
2434 }
2435 } else {
2436 print("Note: the current version of native packager Ant task can bundle the default JRE only.");
2437 }
2438 }
2439 }
2440
2441 // fx:callbacks
2442 var callbs = deploy.createCallbacks();
2443 callbs.setProject(project);
2444 var keys = project.getProperties().keys();
2445 while(keys.hasMoreElements()) {
2446 var pn = new String(keys.nextElement());
2447 if(startsWith(pn, JFXCALLB)) {
2448 var prop = new String(project.getProperty(pn));
2449 if(defined(prop)) {
2450 var cname = pn.substring(JFXCALLB.length+1);
2451 var cb = callbs.createCallback();
2452 cb.setProject(project);
2453 cb.setName(cname);
2454 cb.addText(prop);
2455 }
2456 }
2457 }
2458
2459 deploy.perform();
2460 ]]>
2461 </script>
2462 <antcall target="-post-jfx-deploy"/>
2463 <antcall target="-call-post-jfx-native"/>
2464 </sequential>
2465 </macrodef>
2466
2467 <!-- JavaFX SDK 2.0.x and 2.1.x deploy task can not generate pre-FX jnlp which is needed for FX-in-Swing projects-->
2468 <macrodef name="deploy-deploy-swing">
2469 <sequential>
2470 <antcall target="-pre-jfx-deploy"/>
2471 <local name="permissions-elevated-token"/>
2472 <condition property="permissions-elevated-token" value="${line.separator} &lt;security&gt;${line.separator} &lt;all-permissions/&gt;${line.separator} &lt;/security&gt;" else="">
2473 <isset property="permissions-elevated"/>
2474 </condition>
2475 <local name="offline-allowed-token"/>
2476 <condition property="offline-allowed-token" value="${line.separator} &lt;offline-allowed/&gt;" else="">
2477 <isset property="offline-allowed"/>
2478 </condition>
2479 <local name="update-mode-background-token"/>
2480 <condition property="update-mode-background-token" value="background" else="always">
2481 <isset property="update-mode-background"/>
2482 </condition>
2483 <local name="html-template-processed-available"/>
2484 <condition property="html-template-processed-available">
2485 <and>
2486 <isset property="javafx.run.htmltemplate.processed"/>
2487 <not>
2488 <equals arg1="${javafx.run.htmltemplate.processed}" arg2=""/>
2489 </not>
2490 </and>
2491 </condition>
2492 <local name="javafx.deploy.icon.basename"/>
2493 <basename property="javafx.deploy.icon.basename" file="${javafx.deploy.icon}"/>
2494 <local name="local-icon-filename-available"/>
2495 <condition property="local-icon-filename-available">
2496 <and>
2497 <isset property="icon-available"/>
2498 <isset property="javafx.deploy.icon.basename"/>
2499 <not><equals arg1="${javafx.deploy.icon.basename}" arg2=""/></not>
2500 <not><contains string="${javafx.deploy.icon.basename}" substring="$${javafx" casesensitive="false"/></not>
2501 <not><contains string="${javafx.deploy.icon}" substring="http:" casesensitive="false"/></not>
2502 </and>
2503 </condition>
2504 <local name="icon-token"/>
2505 <condition property="icon-token" value="${line.separator} &lt;icon href=&quot;${javafx.deploy.icon.basename}&quot; kind=&quot;default&quot;/&gt;">
2506 <isset property="local-icon-filename-available"/>
2507 </condition>
2508 <condition property="icon-token" value="${line.separator} &lt;icon href=&quot;${javafx.deploy.icon}&quot; kind=&quot;default&quot;/&gt;" else="">
2509 <isset property="icon-available"/>
2510 </condition>
2511 <basename property="dist.filename" file="${dist.jar}" suffix=".jar"/>
2512 <length file="${dist.jar}" property="dist.jar.size" />
2513 <local name="vmargs-token"/>
2514 <condition property="vmargs-token" value="java-vm-args=&quot;${run.jvmargs}&quot; " else="">
2515 <isset property="vmargs-available"/>
2516 </condition>
2517 <local name="applet-params-token"/>
2518 <local name="application-args-token"/>
2519 <echo message="JavaScript: deploy-deploy-swing 1" level="verbose"/>
2520 <script language="javascript">
2521 <![CDATA[
2522 function prefix(s, len) {
2523 if(s == null || len <= 0 || s.length == 0) {
2524 return new String("");
2525 }
2526 return new String(s.substr(0, len));
2527 }
2528 function replaceSuffix(s, os, ns) {
2529 return prefix(s, s.indexOf(os)).concat(ns);
2530 }
2531 function startsWith(s, prefix) {
2532 return (s != null) && (s.indexOf(prefix) == 0);
2533 }
2534 function endsWith(s, suffix) {
2535 var i = s.lastIndexOf(suffix);
2536 return (i != -1) && (i == (s.length - suffix.length));
2537 }
2538 function defined(s) {
2539 return (s != null) && (s != "null") && (s.length > 0);
2540 }
2541 var JFXPAR = "javafx.param";
2542 var JFXPARN = "name";
2543 var JFXPARV = "value";
2544
2545 var params = new java.lang.StringBuilder();
2546 var args = new java.lang.StringBuilder();
2547 var keys = project.getProperties().keys();
2548 while(keys.hasMoreElements()) {
2549 var pn = new String(keys.nextElement());
2550 if(startsWith(pn, JFXPAR) && endsWith(pn, JFXPARN)) {
2551 var propn = new String(project.getProperty(pn));
2552 if(defined(propn)) {
2553 var pv = replaceSuffix(pn, JFXPARN, JFXPARV);
2554 var propv = new String(project.getProperty(pv));
2555 if(defined(propv)) {
2556 params.append("\n <param name=\"");
2557 params.append(propn);
2558 params.append("\" value=\"");
2559 params.append(propv);
2560 params.append("\"/>");
2561 args.append("\n <argument>");
2562 args.append(propn);
2563 args.append("=");
2564 args.append(propv);
2565 args.append("</argument>");
2566 } else {
2567 params.append("\n <param name=\"");
2568 params.append(propn);
2569 params.append("\" value=\"\"/>");
2570 args.append("\n <argument>");
2571 args.append(propn);
2572 args.append("</argument>");
2573 }
2574 }
2575 }
2576 }
2577 project.setProperty("applet-params-token", new String(params.toString()));
2578 project.setProperty("application-args-token", new String(args.toString()));
2579 ]]>
2580 </script>
2581 <local name="application.desc.processed"/>
2582 <condition property="application.desc.processed" value="${application.desc}" else="Swing applet embedding JavaFX components.">
2583 <isset property="application.desc"/>
2584 </condition>
2585 <filterchain id="jnlp.template.filter">
2586 <replacetokens>
2587 <token key="NAME" value="${dist.filename}"/>
2588 <token key="MAINCLASS" value="${main.class}"/>
2589 <token key="FILESIZE" value="${dist.jar.size}"/>
2590 <token key="VENDOR" value="${application.vendor}"/>
2591 <token key="TITLE" value="${application.title}"/>
2592 <token key="DESCRIPTION" value="${application.desc.processed}"/>
2593 <token key="WIDTH" value="${javafx.run.width}"/>
2594 <token key="HEIGHT" value="${javafx.run.height}"/>
2595 <token key="PERMISSIONS" value="${permissions-elevated-token}"/>
2596 <token key="OFFLINE" value="${offline-allowed-token}"/>
2597 <token key="UPDATEMODE" value="${update-mode-background-token}"/>
2598 <token key="ICON" value="${icon-token}"/>
2599 <token key="VMARGS" value="${vmargs-token}"/>
2600 <token key="PARAMETERS" value="${applet-params-token}"/>
2601 <token key="ARGUMENTS" value="${application-args-token}"/>
2602 </replacetokens>
2603 </filterchain>
2604 <copy file="${basedir}${file.separator}nbproject${file.separator}templates${file.separator}FXSwingTemplateApplication.jnlp"
2605 tofile="${dist.dir}${file.separator}${dist.filename}_application.jnlp" >
2606 <filterchain refid="jnlp.template.filter"/>
2607 </copy>
2608 <copy file="${basedir}${file.separator}nbproject${file.separator}templates${file.separator}FXSwingTemplateApplet.jnlp"
2609 tofile="${dist.dir}${file.separator}${dist.filename}_applet.jnlp" >
2610 <filterchain refid="jnlp.template.filter"/>
2611 </copy>
2612 <copy file="${basedir}${file.separator}nbproject${file.separator}templates${file.separator}FXSwingTemplate.html"
2613 tofile="${dist.dir}${file.separator}${dist.filename}.html" >
2614 <filterchain refid="jnlp.template.filter"/>
2615 </copy>
2616 <echo message="JavaScript: deploy-deploy-swing 2" level="verbose"/>
2617 <script language="javascript">
2618 <![CDATA[
2619 function startsWith(s, prefix) {
2620 return (s != null) && (s.indexOf(prefix) == 0);
2621 }
2622 function defined(s) {
2623 return (s != null) && (s != "null") && (s.length > 0);
2624 }
2625 var PREF = "file:";
2626 var doCopyIcon = new String(project.getProperty("local-icon-filename-available"));
2627 if(defined(doCopyIcon)) {
2628 var iconProp = new String(project.getProperty("javafx.deploy.icon"));
2629 if(startsWith(iconProp, PREF)) {
2630 iconProp = iconProp.slice(PREF.length);
2631 }
2632 while(iconProp.charAt(0) == "/") {
2633 iconProp = iconProp.slice(1);
2634 }
2635 var S = java.io.File.separator;
2636 var baseDir = new String(project.getProperty("basedir"));
2637 var distDir = new String(project.getProperty("dist.dir"));
2638 var copyTask = new String(project.createTask("copy"));
2639 var source = new java.io.File(iconProp);
2640 var target = new java.io.File(baseDir.concat(S).concat(distDir));
2641 copyTask.setFile(source);
2642 copyTask.setTodir(target);
2643 copyTask.setFlatten(true);
2644 copyTask.setFailOnError(false);
2645 copyTask.perform();
2646 }
2647 var doCopyHTMLFrom = new String(project.getProperty("html-template-available"));
2648 var doCopyHTMLTo = new String(project.getProperty("html-template-processed-available"));
2649 if(defined(doCopyHTMLFrom) && defined(doCopyHTMLTo)) {
2650 var htmlFrom = new String(project.getProperty("javafx.run.htmltemplate"));
2651 if(startsWith(htmlFrom, PREF)) {
2652 htmlFrom = htmlFrom.slice(PREF.length);
2653 }
2654 while(startsWith(htmlFrom, "/")) {
2655 htmlFrom = htmlFrom.slice(1);
2656 }
2657 var htmlTo = new String(project.getProperty("javafx.run.htmltemplate.processed"));
2658 if(startsWith(htmlTo, PREF)) {
2659 htmlTo = htmlTo.slice(PREF.length);
2660 }
2661 while(startsWith(htmlTo, "/")) {
2662 htmlTo = htmlTo.slice(1);
2663 }
2664 var copyTask = project.createTask("copy");
2665 var source = new java.io.File(htmlFrom);
2666 var target = new java.io.File(htmlTo);
2667 copyTask.setFile(source);
2668 copyTask.setTofile(target);
2669 copyTask.setFailOnError(false);
2670 copyTask.perform();
2671 }
2672 ]]>
2673 </script>
2674 <antcall target="-post-jfx-deploy"/>
2675 </sequential>
2676 </macrodef>
2677
2678
2679 <!-- Fallback Project Deployment Macros To Support At Least Partially JDKs Without JavaScript Support -->
2680
2681 <macrodef name="fallback-deploy-application-def">
2682 <sequential>
2683 <echo message="Warning: Parameters (if any) not passed to &lt;fx:application&gt; in fallback build mode due to JDK missing JavaScript support."/>
2684 <fx:application id="fxApp"
2685 name="${application.title}"
2686 mainClass="${javafx.main.class}"
2687 fallbackClass="${javafx.fallback.class}">
2688 <!-- PARAMETERS NOT PASSED IN FALLBACK -->
2689 </fx:application>
2690 </sequential>
2691 </macrodef>
2692
2693 <macrodef name="fallback-deploy-application-def-preloader">
2694 <sequential>
2695 <echo message="Warning: Parameters (if any) not passed to &lt;fx:application&gt; in fallback build mode due to JDK missing JavaScript support."/>
2696 <fx:application id="fxApp"
2697 name="${application.title}"
2698 mainClass="${javafx.main.class}"
2699 preloaderClass="${javafx.preloader.class}"
2700 fallbackClass="${javafx.fallback.class}">
2701 <!-- PARAMETERS NOT PASSED IN FALLBACK -->
2702 </fx:application>
2703 </sequential>
2704 </macrodef>
2705
2706 <macrodef name="fallback-deploy-application-def-swing">
2707 <sequential>
2708 <echo message="Warning: Parameters (if any) not passed to &lt;fx:application&gt; in fallback build mode due to JDK missing JavaScript support."/>
2709 <fx:application id="fxApp"
2710 name="${application.title}"
2711 mainClass="${main.class}"
2712 fallbackClass="${javafx.fallback.class}"
2713 toolkit="swing">
2714 <!-- PARAMETERS NOT PASSED IN FALLBACK -->
2715 </fx:application>
2716 </sequential>
2717 </macrodef>
2718
2719 <macrodef name="fallback-deploy-resources">
2720 <sequential>
2721 <fx:resources id="appRes">
2722 <fx:fileset requiredFor="startup" dir="${jfx.deployment.dir}">
2723 <include name="${jfx.deployment.jar}"/>
2724 <include name="lib${file.separator}*.jar"/>
2725 <exclude name="lib${file.separator}${jfx.deployment.jar}"/>
2726 </fx:fileset>
2727 </fx:resources>
2728 </sequential>
2729 </macrodef>
2730
2731 <macrodef name="fallback-deploy-resources-preloader">
2732 <sequential>
2733 <fx:resources id="appRes">
2734 <fx:fileset requiredFor="preloader" dir="${jfx.deployment.dir}">
2735 <include name="lib${file.separator}${javafx.preloader.jar.filename}"/>
2736 </fx:fileset>
2737 <fx:fileset requiredFor="startup" dir="${jfx.deployment.dir}">
2738 <include name="${jfx.deployment.jar}"/>
2739 <include name="lib${file.separator}*.jar"/>
2740 <exclude name="lib${file.separator}${javafx.preloader.jar.filename}"/>
2741 <exclude name="lib${file.separator}${jfx.deployment.jar}"/>
2742 </fx:fileset>
2743 </fx:resources>
2744 </sequential>
2745 </macrodef>
2746
2747 <macrodef name="fallback-deploy-jar">
2748 <sequential>
2749 <antcall target="-pre-jfx-jar"/>
2750 <fx:jar destfile="${jfx.deployment.dir}${file.separator}${jfx.deployment.jar}">
2751 <fx:application refid="fxApp"/>
2752 <fx:resources refid="appRes"/>
2753 <fileset dir="${build.classes.dir}">
2754 <exclude name="**${file.separator}*.${css-exclude-ext}"/>
2755 </fileset>
2756 <manifest>
2757 <attribute name="Implementation-Vendor" value="${application.vendor}"/>
2758 <attribute name="Implementation-Title" value="${application.title}"/>
2759 <attribute name="Implementation-Version" value="1.0"/>
2760 </manifest>
2761 </fx:jar>
2762 <antcall target="-post-jfx-jar"/>
2763 </sequential>
2764 </macrodef>
2765
2766 <macrodef name="fallback-deploy-deploy">
2767 <sequential>
2768 <antcall target="-pre-jfx-deploy"/>
2769 <echo message="Warning: JVM Arguments and Callbacks (if any) not passed to &lt;fx:deploy&gt; in fallback build mode due to JDK missing JavaScript support."/>
2770 <fx:deploy width="${javafx.width}" height="${javafx.height}"
2771 outdir="${jfx.deployment.dir}" embedjnlp="true" updatemode="${update-mode}"
2772 outfile="${application.title}" includeDT="${javafx.deploy.includeDT}">
2773 <fx:application refid="fxApp"/>
2774 <fx:resources refid="appRes"/>
2775 <fx:info title="${application.title}" vendor="${application.vendor}"/>
2776 <fx:permissions elevated="${permissions.elevated}"/>
2777 <fx:preferences shortcut="${javafx.deploy.adddesktopshortcut}" install="${javafx.deploy.installpermanently}" menu="${javafx.deploy.addstartmenushortcut}"/>
2778 <!-- PLATFORM NOT PASSED IN FALLBACK -->
2779 <!-- CALLBACKS NOT PASSED IN FALLBACK -->
2780 </fx:deploy>
2781 <antcall target="-post-jfx-deploy"/>
2782 </sequential>
2783 </macrodef>
2784
2785 <macrodef name="fallback-deploy-deploy-template">
2786 <sequential>
2787 <antcall target="-pre-jfx-deploy"/>
2788 <echo message="Warning: JVM Arguments and Callbacks (if any) not passed to &lt;fx:deploy&gt; in fallback build mode due to JDK missing JavaScript support."/>
2789 <deploy-process-template/>
2790 <fx:deploy width="${javafx.width}" height="${javafx.height}"
2791 outdir="${jfx.deployment.dir}" embedjnlp="true" updatemode="${update-mode}"
2792 outfile="${application.title}" includeDT="${javafx.deploy.includeDT}">
2793 <fx:application refid="fxApp"/>
2794 <fx:resources refid="appRes"/>
2795 <fx:info title="${application.title}" vendor="${application.vendor}"/>
2796 <fx:permissions elevated="${permissions.elevated}"/>
2797 <fx:preferences shortcut="${javafx.deploy.adddesktopshortcut}" install="${javafx.deploy.installpermanently}" menu="${javafx.deploy.addstartmenushortcut}"/>
2798 <fx:template file="${javafx.run.htmltemplate}" tofile="${javafx.run.htmltemplate.processed}"/>
2799 <!-- PLATFORM NOT PASSED IN FALLBACK -->
2800 <!-- CALLBACKS NOT PASSED IN FALLBACK -->
2801 </fx:deploy>
2802 <antcall target="-post-jfx-deploy"/>
2803 </sequential>
2804 </macrodef>
2805
2806
2807 <!-- Project Deployment Targets -->
2808
2809 <target name="-check-sign" depends="-check-project,-javafx-init-keystore" if="javafx.signed.true+signjars.task.available">
2810 <condition property="sign-nopreloader-notemplate">
2811 <and>
2812 <isset property="app-without-preloader"/>
2813 <not><isset property="html-template-available"/></not>
2814 <not><isset property="fx-in-swing-app-workaround"/></not>
2815 <not><isset property="use-blob-signing"/></not>
2816 </and>
2817 </condition>
2818 <condition property="sign-preloader-notemplate">
2819 <and>
2820 <isset property="app-with-preloader"/>
2821 <not><isset property="html-template-available"/></not>
2822 <not><isset property="fx-in-swing-app-workaround"/></not>
2823 <not><isset property="use-blob-signing"/></not>
2824 </and>
2825 </condition>
2826 <condition property="sign-nopreloader-template">
2827 <and>
2828 <isset property="app-without-preloader"/>
2829 <isset property="html-template-available"/>
2830 <not><isset property="fx-in-swing-app-workaround"/></not>
2831 <not><isset property="use-blob-signing"/></not>
2832 </and>
2833 </condition>
2834 <condition property="sign-preloader-template">
2835 <and>
2836 <isset property="app-with-preloader"/>
2837 <isset property="html-template-available"/>
2838 <not><isset property="fx-in-swing-app-workaround"/></not>
2839 <not><isset property="use-blob-signing"/></not>
2840 </and>
2841 </condition>
2842 <condition property="sign-nopreloader-notemplate-swing">
2843 <and>
2844 <isset property="app-without-preloader"/>
2845 <not><isset property="html-template-available"/></not>
2846 <isset property="fx-in-swing-app-workaround"/>
2847 <not><isset property="use-blob-signing"/></not>
2848 </and>
2849 </condition>
2850 <condition property="sign-nopreloader-template-swing">
2851 <and>
2852 <isset property="app-without-preloader"/>
2853 <isset property="html-template-available"/>
2854 <isset property="fx-in-swing-app-workaround"/>
2855 <not><isset property="use-blob-signing"/></not>
2856 </and>
2857 </condition>
2858 <condition property="sign-blob-nopreloader-notemplate">
2859 <and>
2860 <isset property="app-without-preloader"/>
2861 <not><isset property="html-template-available"/></not>
2862 <not><isset property="fx-in-swing-app-workaround"/></not>
2863 <isset property="use-blob-signing"/>
2864 </and>
2865 </condition>
2866 <condition property="sign-blob-preloader-notemplate">
2867 <and>
2868 <isset property="app-with-preloader"/>
2869 <not><isset property="html-template-available"/></not>
2870 <not><isset property="fx-in-swing-app-workaround"/></not>
2871 <isset property="use-blob-signing"/>
2872 </and>
2873 </condition>
2874 <condition property="sign-blob-nopreloader-template">
2875 <and>
2876 <isset property="app-without-preloader"/>
2877 <isset property="html-template-available"/>
2878 <not><isset property="fx-in-swing-app-workaround"/></not>
2879 <isset property="use-blob-signing"/>
2880 </and>
2881 </condition>
2882 <condition property="sign-blob-preloader-template">
2883 <and>
2884 <isset property="app-with-preloader"/>
2885 <isset property="html-template-available"/>
2886 <not><isset property="fx-in-swing-app-workaround"/></not>
2887 <isset property="use-blob-signing"/>
2888 </and>
2889 </condition>
2890 <condition property="sign-blob-nopreloader-notemplate-swing">
2891 <and>
2892 <isset property="app-without-preloader"/>
2893 <not><isset property="html-template-available"/></not>
2894 <isset property="fx-in-swing-app-workaround"/>
2895 <isset property="use-blob-signing"/>
2896 </and>
2897 </condition>
2898 <condition property="sign-blob-nopreloader-template-swing">
2899 <and>
2900 <isset property="app-without-preloader"/>
2901 <isset property="html-template-available"/>
2902 <isset property="fx-in-swing-app-workaround"/>
2903 <isset property="use-blob-signing"/>
2904 </and>
2905 </condition>
2906 </target>
2907 <target name="-check-nosign" depends="-check-project">
2908 <condition property="nosign-nopreloader-notemplate">
2909 <and>
2910 <isset property="app-without-preloader"/>
2911 <not><isset property="html-template-available"/></not>
2912 <not><isset property="javafx.signed.true"/></not>
2913 <not><isset property="fx-in-swing-app-workaround"/></not>
2914 </and>
2915 </condition>
2916 <condition property="nosign-preloader-notemplate">
2917 <and>
2918 <isset property="app-with-preloader"/>
2919 <not><isset property="html-template-available"/></not>
2920 <not><isset property="javafx.signed.true"/></not>
2921 <not><isset property="fx-in-swing-app-workaround"/></not>
2922 </and>
2923 </condition>
2924 <condition property="nosign-nopreloader-template">
2925 <and>
2926 <isset property="app-without-preloader"/>
2927 <isset property="html-template-available"/>
2928 <not><isset property="javafx.signed.true"/></not>
2929 <not><isset property="fx-in-swing-app-workaround"/></not>
2930 </and>
2931 </condition>
2932 <condition property="nosign-preloader-template">
2933 <and>
2934 <isset property="app-with-preloader"/>
2935 <isset property="html-template-available"/>
2936 <not><isset property="javafx.signed.true"/></not>
2937 <not><isset property="fx-in-swing-app-workaround"/></not>
2938 </and>
2939 </condition>
2940 <condition property="nosign-nopreloader-notemplate-swing">
2941 <and>
2942 <isset property="app-without-preloader"/>
2943 <not><isset property="html-template-available"/></not>
2944 <not><isset property="javafx.signed.true"/></not>
2945 <isset property="fx-in-swing-app-workaround"/>
2946 </and>
2947 </condition>
2948 <condition property="nosign-nopreloader-template-swing">
2949 <and>
2950 <isset property="app-without-preloader"/>
2951 <isset property="html-template-available"/>
2952 <not><isset property="javafx.signed.true"/></not>
2953 <isset property="fx-in-swing-app-workaround"/>
2954 </and>
2955 </condition>
2956 </target>
2957
2958
2959 <!-- WITH SIGNING -->
2960
2961 <!-- project without preloader -->
2962 <!-- no html template -->
2963 <target name="-deploy-app-sign-nopreloader-notemplate" depends="-check-sign" if="sign-nopreloader-notemplate" unless="preloader-app">
2964 <echo message="-deploy-app-sign-nopreloader-notemplate" level="verbose"/>
2965 <deploy-defines/>
2966 <deploy-preprocess/>
2967 <deploy-jar/>
2968 <deploy-sign/>
2969 <deploy-deploy/>
2970 </target>
2971 <target name="-deploy-app-sign-blob-nopreloader-notemplate" depends="-check-sign" if="sign-blob-nopreloader-notemplate" unless="preloader-app">
2972 <echo message="-deploy-app-sign-blob-nopreloader-notemplate" level="verbose"/>
2973 <deploy-defines/>
2974 <deploy-preprocess/>
2975 <deploy-jar/>
2976 <deploy-sign-blob/>
2977 <deploy-deploy/>
2978 </target>
2979
2980 <!-- project with preloader -->
2981 <!-- no html template -->
2982 <target name="-deploy-app-sign-preloader-notemplate" depends="-check-sign" if="sign-preloader-notemplate" unless="preloader-app">
2983 <echo message="-deploy-app-sign-preloader-notemplate" level="verbose"/>
2984 <deploy-defines/>
2985 <deploy-preprocess/>
2986 <deploy-jar/>
2987 <deploy-sign-preloader/>
2988 <deploy-deploy/>
2989 </target>
2990 <target name="-deploy-app-sign-blob-preloader-notemplate" depends="-check-sign" if="sign-blob-preloader-notemplate" unless="preloader-app">
2991 <echo message="-deploy-app-sign-blob-preloader-notemplate" level="verbose"/>
2992 <deploy-defines/>
2993 <deploy-preprocess/>
2994 <deploy-jar/>
2995 <deploy-sign-blob-preloader/>
2996 <deploy-deploy/>
2997 </target>
2998
2999 <!-- project without preloader -->
3000 <!-- html template -->
3001 <target name="-deploy-app-sign-nopreloader-template" depends="-check-sign" if="sign-nopreloader-template" unless="preloader-app">
3002 <echo message="-deploy-app-sign-nopreloader-template" level="verbose"/>
3003 <deploy-defines/>
3004 <deploy-preprocess/>
3005 <deploy-jar/>
3006 <deploy-sign/>
3007 <deploy-process-template/>
3008 <deploy-deploy/>
3009 </target>
3010 <target name="-deploy-app-sign-blob-nopreloader-template" depends="-check-sign" if="sign-blob-nopreloader-template" unless="preloader-app">
3011 <echo message="-deploy-app-sign-blob-nopreloader-template" level="verbose"/>
3012 <deploy-defines/>
3013 <deploy-preprocess/>
3014 <deploy-jar/>
3015 <deploy-sign-blob/>
3016 <deploy-process-template/>
3017 <deploy-deploy/>
3018 </target>
3019
3020 <!-- project with preloader -->
3021 <!-- html template -->
3022 <target name="-deploy-app-sign-preloader-template" depends="-check-sign" if="sign-preloader-template" unless="preloader-app">
3023 <echo message="-deploy-app-sign-preloader-template" level="verbose"/>
3024 <deploy-defines/>
3025 <deploy-preprocess/>
3026 <deploy-jar/>
3027 <deploy-sign-preloader/>
3028 <deploy-process-template/>
3029 <deploy-deploy/>
3030 </target>
3031 <target name="-deploy-app-sign-blob-preloader-template" depends="-check-sign" if="sign-blob-preloader-template" unless="preloader-app">
3032 <echo message="-deploy-app-sign-blob-preloader-template" level="verbose"/>
3033 <deploy-defines/>
3034 <deploy-preprocess/>
3035 <deploy-jar/>
3036 <deploy-sign-blob-preloader/>
3037 <deploy-process-template/>
3038 <deploy-deploy/>
3039 </target>
3040
3041 <!-- project without preloader -->
3042 <!-- no html template -->
3043 <!-- FX in Swing app -->
3044 <target name="-deploy-app-sign-nopreloader-notemplate-swing" depends="-check-sign" if="sign-nopreloader-notemplate-swing" unless="preloader-app-no-workaround">
3045 <echo message="-deploy-app-sign-nopreloader-notemplate-swing" level="verbose"/>
3046 <deploy-defines/>
3047 <deploy-preprocess/>
3048 <deploy-jar/>
3049 <deploy-sign/>
3050 <deploy-deploy-swing/>
3051 </target>
3052 <target name="-deploy-app-sign-blob-nopreloader-notemplate-swing" depends="-check-sign" if="sign-blob-nopreloader-notemplate-swing" unless="preloader-app-no-workaround">
3053 <echo message="-deploy-app-sign-blob-nopreloader-notemplate-swing" level="verbose"/>
3054 <deploy-defines/>
3055 <deploy-preprocess/>
3056 <deploy-jar/>
3057 <deploy-sign-blob/>
3058 <deploy-deploy-swing/>
3059 </target>
3060
3061 <!-- project without preloader -->
3062 <!-- html template -->
3063 <!-- FX in Swing app -->
3064 <target name="-deploy-app-sign-nopreloader-template-swing" depends="-check-sign" if="sign-nopreloader-template-swing" unless="preloader-app-no-workaround">
3065 <echo message="-deploy-app-sign-nopreloader-template-swing" level="verbose"/>
3066 <deploy-defines/>
3067 <deploy-preprocess/>
3068 <deploy-jar/>
3069 <deploy-sign/>
3070 <deploy-process-template/>
3071 <deploy-deploy-swing/>
3072 </target>
3073 <target name="-deploy-app-sign-blob-nopreloader-template-swing" depends="-check-sign" if="sign-blob-nopreloader-template-swing" unless="preloader-app-no-workaround">
3074 <echo message="-deploy-app-sign-blob-nopreloader-template-swing" level="verbose"/>
3075 <deploy-defines/>
3076 <deploy-preprocess/>
3077 <deploy-jar/>
3078 <deploy-sign-blob/>
3079 <deploy-process-template/>
3080 <deploy-deploy-swing/>
3081 </target>
3082
3083
3084 <!-- NO SIGNING -->
3085
3086 <!-- project without preloader -->
3087 <!-- no html template -->
3088 <target name="-deploy-app-nosign-nopreloader-notemplate" depends="-check-nosign" if="nosign-nopreloader-notemplate" unless="preloader-app">
3089 <echo message="-deploy-app-nosign-nopreloader-notemplate" level="verbose"/>
3090 <deploy-defines/>
3091 <deploy-preprocess/>
3092 <deploy-jar/>
3093 <deploy-deploy/>
3094 </target>
3095
3096 <!-- project with preloader -->
3097 <!-- no html template -->
3098 <target name="-deploy-app-nosign-preloader-notemplate" depends="-check-nosign" if="nosign-preloader-notemplate" unless="preloader-app">
3099 <echo message="-deploy-app-nosign-preloader-notemplate" level="verbose"/>
3100 <deploy-defines/>
3101 <deploy-preprocess/>
3102 <deploy-jar/>
3103 <deploy-deploy/>
3104 </target>
3105
3106 <!-- project without preloader -->
3107 <!-- html template -->
3108 <target name="-deploy-app-nosign-nopreloader-template" depends="-check-nosign" if="nosign-nopreloader-template" unless="preloader-app">
3109 <echo message="-deploy-app-nosign-nopreloader-template" level="verbose"/>
3110 <deploy-defines/>
3111 <deploy-preprocess/>
3112 <deploy-jar/>
3113 <deploy-process-template/>
3114 <deploy-deploy/>
3115 </target>
3116
3117 <!-- project with preloader -->
3118 <!-- html template -->
3119 <target name="-deploy-app-nosign-preloader-template" depends="-check-nosign" if="nosign-preloader-template" unless="preloader-app">
3120 <echo message="-deploy-app-nosign-preloader-template" level="verbose"/>
3121 <deploy-defines/>
3122 <deploy-preprocess/>
3123 <deploy-jar/>
3124 <deploy-process-template/>
3125 <deploy-deploy/>
3126 </target>
3127
3128 <!-- project without preloader -->
3129 <!-- no html template -->
3130 <!-- FX in Swing app -->
3131 <target name="-deploy-app-nosign-nopreloader-notemplate-swing" depends="-check-nosign" if="nosign-nopreloader-notemplate-swing" unless="preloader-app-no-workaround">
3132 <echo message="-deploy-app-nosign-nopreloader-notemplate-swing" level="verbose"/>
3133 <deploy-defines/>
3134 <deploy-preprocess/>
3135 <deploy-jar/>
3136 <deploy-deploy-swing/>
3137 </target>
3138
3139 <!-- project without preloader -->
3140 <!-- html template -->
3141 <!-- FX in Swing app -->
3142 <target name="-deploy-app-nosign-nopreloader-template-swing" depends="-check-nosign" if="nosign-nopreloader-template-swing" unless="preloader-app-no-workaround">
3143 <echo message="-deploy-app-nosign-nopreloader-template-swing" level="verbose"/>
3144 <deploy-defines/>
3145 <deploy-preprocess/>
3146 <deploy-jar/>
3147 <deploy-process-template/>
3148 <deploy-deploy-swing/>
3149 </target>
3150
3151
3152 <!-- FALLBACK (NO JAVASCRIPT) TARGETS WITH SIGNING -->
3153
3154 <target name="-check-fallback-sign-deploy-swing-possible" depends="-check-sign">
3155 <local name="fail-deploy-swing-possible"/>
3156 <condition property="fail-deploy-swing-possible">
3157 <and>
3158 <or>
3159 <isset property="sign-nopreloader-notemplate-swing"/>
3160 <isset property="sign-nopreloader-template-swing"/>
3161 </or>
3162 <not><isset property="have-fx-ant-api-1.2"/></not>
3163 </and>
3164 </condition>
3165 <fail message="Error: JavaFX SDK version 2.2 or newer is needed to deploy FX-in-Swing on JDK without JavaScript support."
3166 if="fail-deploy-swing-possible"/>
3167 </target>
3168
3169 <!-- FALLBACK project without preloader -->
3170 <!-- FALLBACK no html template -->
3171 <target name="-fallback-deploy-app-sign-nopreloader-notemplate" depends="-check-sign" if="sign-nopreloader-notemplate" unless="preloader-app">
3172 <echo message="-fallback-deploy-app-sign-nopreloader-notemplate" level="verbose"/>
3173 <deploy-defines/>
3174 <deploy-preprocess/>
3175 <fallback-deploy-application-def/>
3176 <fallback-deploy-resources/>
3177 <fallback-deploy-jar/>
3178 <deploy-sign/>
3179 <fallback-deploy-deploy/>
3180 </target>
3181 <target name="-fallback-deploy-app-sign-blob-nopreloader-notemplate" depends="-check-sign" if="sign-blob-nopreloader-notemplate" unless="preloader-app">
3182 <echo message="-fallback-deploy-app-sign-blob-nopreloader-notemplate" level="verbose"/>
3183 <deploy-defines/>
3184 <deploy-preprocess/>
3185 <fallback-deploy-application-def/>
3186 <fallback-deploy-resources/>
3187 <fallback-deploy-jar/>
3188 <deploy-sign-blob/>
3189 <fallback-deploy-deploy/>
3190 </target>
3191
3192 <!-- FALLBACK project with preloader -->
3193 <!-- FALLBACK no html template -->
3194 <target name="-fallback-deploy-app-sign-preloader-notemplate" depends="-check-sign" if="sign-preloader-notemplate" unless="preloader-app">
3195 <echo message="-fallback-deploy-app-sign-preloader-notemplate" level="verbose"/>
3196 <deploy-defines/>
3197 <deploy-preprocess/>
3198 <fallback-deploy-application-def-preloader/>
3199 <fallback-deploy-resources-preloader/>
3200 <fallback-deploy-jar/>
3201 <deploy-sign-preloader/>
3202 <fallback-deploy-deploy/>
3203 </target>
3204 <target name="-fallback-deploy-app-sign-blob-preloader-notemplate" depends="-check-sign" if="sign-blob-preloader-notemplate" unless="preloader-app">
3205 <echo message="-fallback-deploy-app-sign-blob-preloader-notemplate" level="verbose"/>
3206 <deploy-defines/>
3207 <deploy-preprocess/>
3208 <fallback-deploy-application-def-preloader/>
3209 <fallback-deploy-resources-preloader/>
3210 <fallback-deploy-jar/>
3211 <deploy-sign-blob-preloader/>
3212 <fallback-deploy-deploy/>
3213 </target>
3214
3215 <!-- FALLBACK project without preloader -->
3216 <!-- FALLBACK html template -->
3217 <target name="-fallback-deploy-app-sign-nopreloader-template" depends="-check-sign" if="sign-nopreloader-template" unless="preloader-app">
3218 <echo message="-fallback-deploy-app-sign-nopreloader-template" level="verbose"/>
3219 <deploy-defines/>
3220 <deploy-preprocess/>
3221 <fallback-deploy-application-def/>
3222 <fallback-deploy-resources/>
3223 <fallback-deploy-jar/>
3224 <deploy-sign/>
3225 <fallback-deploy-deploy-template/>
3226 </target>
3227 <target name="-fallback-deploy-app-sign-blob-nopreloader-template" depends="-check-sign" if="sign-blob-nopreloader-template" unless="preloader-app">
3228 <echo message="-fallback-deploy-app-sign-blob-nopreloader-template" level="verbose"/>
3229 <deploy-defines/>
3230 <deploy-preprocess/>
3231 <fallback-deploy-application-def/>
3232 <fallback-deploy-resources/>
3233 <fallback-deploy-jar/>
3234 <deploy-sign-blob/>
3235 <fallback-deploy-deploy-template/>
3236 </target>
3237
3238 <!-- FALLBACK project with preloader -->
3239 <!-- FALLBACK html template -->
3240 <target name="-fallback-deploy-app-sign-preloader-template" depends="-check-sign" if="sign-preloader-template" unless="preloader-app">
3241 <echo message="-fallback-deploy-app-sign-preloader-template" level="verbose"/>
3242 <deploy-defines/>
3243 <deploy-preprocess/>
3244 <fallback-deploy-application-def-preloader/>
3245 <fallback-deploy-resources-preloader/>
3246 <fallback-deploy-jar/>
3247 <deploy-sign-preloader/>
3248 <fallback-deploy-deploy-template/>
3249 </target>
3250 <target name="-fallback-deploy-app-sign-blob-preloader-template" depends="-check-sign" if="sign-blob-preloader-template" unless="preloader-app">
3251 <echo message="-fallback-deploy-app-sign-blob-preloader-template" level="verbose"/>
3252 <deploy-defines/>
3253 <deploy-preprocess/>
3254 <fallback-deploy-application-def-preloader/>
3255 <fallback-deploy-resources-preloader/>
3256 <fallback-deploy-jar/>
3257 <deploy-sign-blob-preloader/>
3258 <fallback-deploy-deploy-template/>
3259 </target>
3260
3261 <!-- FALLBACK project without preloader -->
3262 <!-- FALLBACK no html template -->
3263 <!-- FALLBACK FX in Swing app -->
3264 <target name="-fallback-deploy-app-sign-nopreloader-notemplate-swing" depends="-check-fallback-sign-deploy-swing-possible" if="sign-nopreloader-notemplate-swing" unless="preloader-app-no-workaround">
3265 <echo message="-fallback-deploy-app-sign-nopreloader-notemplate-swing" level="verbose"/>
3266 <deploy-defines/>
3267 <deploy-preprocess/>
3268 <fallback-deploy-application-def-swing/>
3269 <fallback-deploy-resources/>
3270 <fallback-deploy-jar/>
3271 <deploy-sign/>
3272 <fallback-deploy-deploy/>
3273 </target>
3274 <target name="-fallback-deploy-app-sign-blob-nopreloader-notemplate-swing" depends="-check-fallback-sign-deploy-swing-possible" if="sign-nopreloader-notemplate-swing" unless="preloader-app-no-workaround">
3275 <echo message="-fallback-deploy-app-sign-blob-nopreloader-notemplate-swing" level="verbose"/>
3276 <deploy-defines/>
3277 <deploy-preprocess/>
3278 <fallback-deploy-application-def-swing/>
3279 <fallback-deploy-resources/>
3280 <fallback-deploy-jar/>
3281 <deploy-sign-blob/>
3282 <fallback-deploy-deploy/>
3283 </target>
3284
3285 <!-- FALLBACK project without preloader -->
3286 <!-- FALLBACK html template -->
3287 <!-- FALLBACK FX in Swing app -->
3288 <target name="-fallback-deploy-app-sign-nopreloader-template-swing" depends="-check-fallback-sign-deploy-swing-possible" if="sign-nopreloader-template-swing" unless="preloader-app-no-workaround">
3289 <echo message="-fallback-deploy-app-sign-nopreloader-template-swing" level="verbose"/>
3290 <deploy-defines/>
3291 <deploy-preprocess/>
3292 <fallback-deploy-application-def-swing/>
3293 <fallback-deploy-resources/>
3294 <fallback-deploy-jar/>
3295 <deploy-sign/>
3296 <fallback-deploy-deploy-template/>
3297 </target>
3298 <target name="-fallback-deploy-app-sign-blob-nopreloader-template-swing" depends="-check-fallback-sign-deploy-swing-possible" if="sign-nopreloader-template-swing" unless="preloader-app-no-workaround">
3299 <echo message="-fallback-deploy-app-sign-blob-nopreloader-template-swing" level="verbose"/>
3300 <deploy-defines/>
3301 <deploy-preprocess/>
3302 <fallback-deploy-application-def-swing/>
3303 <fallback-deploy-resources/>
3304 <fallback-deploy-jar/>
3305 <deploy-sign-blob/>
3306 <fallback-deploy-deploy-template/>
3307 </target>
3308
3309
3310 <!-- FALLBACK (NO JAVASCRIPT) TARGETS NO SIGNING -->
3311
3312 <target name="-check-fallback-nosign-deploy-swing-possible" depends="-check-nosign">
3313 <local name="fail-deploy-swing-possible"/>
3314 <condition property="fail-deploy-swing-possible">
3315 <and>
3316 <or>
3317 <isset property="nosign-nopreloader-notemplate-swing"/>
3318 <isset property="nosign-nopreloader-template-swing"/>
3319 </or>
3320 <not><isset property="have-fx-ant-api-1.2"/></not>
3321 </and>
3322 </condition>
3323 <fail message="Error: JavaFX SDK version 2.2 or newer is needed to deploy FX-in-Swing on JDK without JavaScript support."
3324 if="fail-deploy-swing-possible"/>
3325 </target>
3326
3327 <!-- FALLBACK project without preloader -->
3328 <!-- FALLBACK no html template -->
3329 <target name="-fallback-deploy-app-nosign-nopreloader-notemplate" depends="-check-nosign" if="nosign-nopreloader-notemplate" unless="preloader-app">
3330 <echo message="-fallback-deploy-app-nosign-nopreloader-notemplate" level="verbose"/>
3331 <deploy-defines/>
3332 <deploy-preprocess/>
3333 <fallback-deploy-application-def/>
3334 <fallback-deploy-resources/>
3335 <fallback-deploy-jar/>
3336 <fallback-deploy-deploy/>
3337 </target>
3338
3339 <!-- FALLBACK project with preloader -->
3340 <!-- FALLBACK no html template -->
3341 <target name="-fallback-deploy-app-nosign-preloader-notemplate" depends="-check-nosign" if="nosign-preloader-notemplate" unless="preloader-app">
3342 <echo message="-fallback-deploy-app-nosign-preloader-notemplate" level="verbose"/>
3343 <deploy-defines/>
3344 <deploy-preprocess/>
3345 <fallback-deploy-application-def-preloader/>
3346 <fallback-deploy-resources-preloader/>
3347 <fallback-deploy-jar/>
3348 <fallback-deploy-deploy/>
3349 </target>
3350
3351 <!-- FALLBACK project without preloader -->
3352 <!-- FALLBACK html template -->
3353 <target name="-fallback-deploy-app-nosign-nopreloader-template" depends="-check-nosign" if="nosign-nopreloader-template" unless="preloader-app">
3354 <echo message="-fallback-deploy-app-nosign-nopreloader-template" level="verbose"/>
3355 <deploy-defines/>
3356 <deploy-preprocess/>
3357 <fallback-deploy-application-def/>
3358 <fallback-deploy-resources/>
3359 <fallback-deploy-jar/>
3360 <fallback-deploy-deploy-template/>
3361 </target>
3362
3363 <!-- FALLBACK project with preloader -->
3364 <!-- FALLBACK html template -->
3365 <target name="-fallback-deploy-app-nosign-preloader-template" depends="-check-nosign" if="nosign-preloader-template" unless="preloader-app">
3366 <echo message="-fallback-deploy-app-nosign-preloader-template" level="verbose"/>
3367 <deploy-defines/>
3368 <deploy-preprocess/>
3369 <fallback-deploy-application-def-preloader/>
3370 <fallback-deploy-resources-preloader/>
3371 <fallback-deploy-jar/>
3372 <fallback-deploy-deploy-template/>
3373 </target>
3374
3375 <!-- FALLBACK project without preloader -->
3376 <!-- FALLBACK no html template -->
3377 <!-- FALLBACK FX in Swing app -->
3378 <target name="-fallback-deploy-app-nosign-nopreloader-notemplate-swing" depends="-check-fallback-nosign-deploy-swing-possible" if="nosign-nopreloader-notemplate-swing" unless="preloader-app-no-workaround">
3379 <echo message="-fallback-deploy-app-nosign-nopreloader-notemplate-swing" level="verbose"/>
3380 <deploy-defines/>
3381 <deploy-preprocess/>
3382 <fallback-deploy-application-def-swing/>
3383 <fallback-deploy-resources/>
3384 <fallback-deploy-jar/>
3385 <fallback-deploy-deploy/>
3386 </target>
3387
3388 <!-- FALLBACK project without preloader -->
3389 <!-- FALLBACK html template -->
3390 <!-- FALLBACK FX in Swing app -->
3391 <target name="-fallback-deploy-app-nosign-nopreloader-template-swing" depends="-check-fallback-nosign-deploy-swing-possible" if="nosign-nopreloader-template-swing" unless="preloader-app-no-workaround">
3392 <echo message="-fallback-deploy-app-nosign-nopreloader-template-swing" level="verbose"/>
3393 <deploy-defines/>
3394 <deploy-preprocess/>
3395 <fallback-deploy-application-def-swing/>
3396 <fallback-deploy-resources/>
3397 <fallback-deploy-jar/>
3398 <fallback-deploy-deploy-template/>
3399 </target>
3400
3401
3402 <!-- Project Build Targets -->
3403
3404 <target name="jfx-build" depends="-jfx-do-compile, -jfx-do-jar, -jfx-do-post-jar"/>
3405 <target name="jfx-build-noscript" depends="-set-fallback-no-javascript, -jfx-do-compile, -jfx-do-jar, -jfx-do-post-jar"/>
3406
3407 <target name="jfx-rebuild" depends="clean, -jfx-do-compile, -jfx-do-jar, -jfx-do-post-jar"/>
3408 <target name="jfx-rebuild-noscript" depends="-set-fallback-no-javascript, clean, -jfx-do-compile, -jfx-do-jar, -jfx-do-post-jar"/>
3409
3410 <target name="jfx-build-native" depends="-set-do-build-native-package, -check-ant-jre-supports-native-packaging, -check-native-packager-external-tools, jfx-rebuild"/>
3411 <target name="jfx-build-native-noscript" depends="-set-do-build-native-package, -check-ant-jre-supports-native-packaging, -check-native-packager-external-tools, jfx-rebuild-noscript"/>
3412
3413 <target name="build-native">
3414 <property name="javafx.native.bundling.type" value="${native.bundling.type}"/>
3415 <antcall target="jfx-build-native"/>
3416 </target>
3417 <target name="build-native-noscript">
3418 <property name="javafx.native.bundling.type" value="${native.bundling.type}"/>
3419 <antcall target="jfx-build-native-noscript"/>
3420 </target>
3421
3422 <target name="-check-do-jar">
3423 <condition property="do-jar-false">
3424 <and>
3425 <isset property="do.jar"/>
3426 <equals arg1="${do.jar}" arg2="false"/>
3427 </and>
3428 </condition>
3429 </target>
3430 <target name="-set-fallback-no-javascript">
3431 <property name="fallback.no.javascript" value="true"/>
3432 <echo message="Warning: Using fallback build infrastructure due to default JDK missing JavaScript support."/>
3433 </target>
3434 <target name="-jfx-do-compile" depends="-check-do-jar" if="do-jar-false">
3435 <antcall target="compile"/>
3436 </target>
3437 <target name="-jfx-do-jar" depends="-check-do-jar" unless="do-jar-false">
3438 <antcall target="jar"/>
3439 </target>
3440 <target name="-jfx-do-post-jar" depends="-init-check,-check-project" if="preloader-app">
3441 <!-- Preloaders are created using SE copylibs task that creates readme file relevant for SE only -->
3442 <delete file="${basedir}${file.separator}${dist.dir}${file.separator}README.TXT"/>
3443 </target>
3444
3445 <target name="-set-do-build-native-package">
3446 <property name="do.build.native.package" value="true"/>
3447 <echo message="do.build.native.package = ${do.build.native.package}" level="verbose"/>
3448 </target>
3449 <target name="-check-ant-jre-supports-native-packaging" depends="-check-ant-jre-version">
3450 <fail message="Error:${line.separator}JavaFX native packager requires NetBeans to run on JDK 1.7u6 or later !" if="have-ant-jre-pre7u6"/>
3451 </target>
3452
3453 <target name="-call-pre-jfx-native" if="do.build.native.package">
3454 <antcall target="-pre-jfx-native"/>
3455 </target>
3456 <target name="-call-post-jfx-native" if="do.build.native.package">
3457 <antcall target="-post-jfx-native"/>
3458 </target>
3459
3460 <target name="-check-native-bundling-type" depends="-check-operating-system" if="do.build.native.package">
3461 <condition property="need.Inno.presence">
3462 <and>
3463 <isset property="running.on.windows"/>
3464 <isset property="javafx.native.bundling.type"/>
3465 <or>
3466 <equals arg1="${javafx.native.bundling.type}" arg2="all" casesensitive="false"/>
3467 <equals arg1="${javafx.native.bundling.type}" arg2="installer" casesensitive="false"/>
3468 <equals arg1="${javafx.native.bundling.type}" arg2="exe" casesensitive="false"/>
3469 </or>
3470 </and>
3471 </condition>
3472 <condition property="need.WiX.presence">
3473 <and>
3474 <isset property="running.on.windows"/>
3475 <isset property="javafx.native.bundling.type"/>
3476 <or>
3477 <equals arg1="${javafx.native.bundling.type}" arg2="all" casesensitive="false"/>
3478 <equals arg1="${javafx.native.bundling.type}" arg2="installer" casesensitive="false"/>
3479 <equals arg1="${javafx.native.bundling.type}" arg2="msi" casesensitive="false"/>
3480 </or>
3481 </and>
3482 </condition>
3483 <condition property="need.dpkg.presence">
3484 <and>
3485 <isset property="running.on.unix"/>
3486 <isset property="javafx.native.bundling.type"/>
3487 <or>
3488 <equals arg1="${javafx.native.bundling.type}" arg2="deb" casesensitive="false"/>
3489 </or>
3490 </and>
3491 </condition>
3492 <condition property="need.rpmbuild.presence">
3493 <and>
3494 <isset property="running.on.unix"/>
3495 <isset property="javafx.native.bundling.type"/>
3496 <or>
3497 <equals arg1="${javafx.native.bundling.type}" arg2="rpm" casesensitive="false"/>
3498 </or>
3499 </and>
3500 </condition>
3501 <echo message="need.Inno.presence:${need.Inno.presence}" level="verbose"/>
3502 <echo message="need.WiX.presence:${need.WiX.presence}" level="verbose"/>
3503 <echo message="need.dpkg.presence:${need.dpkg.presence}" level="verbose"/>
3504 <echo message="need.rpmbuild.presence:${need.rpmbuild.presence}" level="verbose"/>
3505 </target>
3506 <target name="-check-Inno-presence" depends="-check-native-bundling-type" if="need.Inno.presence">
3507 <local name="exec-output"/>
3508 <local name="exec-error"/>
3509 <local name="exec-result"/>
3510 <exec executable="iscc" outputproperty="exec-output" failifexecutionfails="false" errorproperty="exec-error" resultproperty="exec-result"/>
3511 <echo message="exec-output:${exec-output}" level="verbose"/>
3512 <echo message="exec-error:${exec-error}" level="verbose"/>
3513 <echo message="exec-result:${exec-result}" level="verbose"/>
3514 <condition property="missing.Inno">
3515 <not><and>
3516 <contains string="${exec-output}" substring="Inno Setup"/>
3517 <not><contains string="${exec-output}" substring="Inno Setup 1"/></not>
3518 <not><contains string="${exec-output}" substring="Inno Setup 2"/></not>
3519 <not><contains string="${exec-output}" substring="Inno Setup 3"/></not>
3520 <not><contains string="${exec-output}" substring="Inno Setup 4"/></not>
3521 </and></not>
3522 </condition>
3523 </target>
3524 <target name="-check-WiX-presence" depends="-check-native-bundling-type" if="need.WiX.presence">
3525 <local name="exec-output"/>
3526 <local name="exec-error"/>
3527 <local name="exec-result"/>
3528 <exec executable="candle" outputproperty="exec-output" failifexecutionfails="false" errorproperty="exec-error" resultproperty="exec-result">
3529 <arg value="-?"/>
3530 </exec>
3531 <echo message="exec-output:${exec-output}" level="verbose"/>
3532 <echo message="exec-error:${exec-error}" level="verbose"/>
3533 <echo message="exec-result:${exec-result}" level="verbose"/>
3534 <condition property="missing.WiX">
3535 <not>
3536 <matches string="${exec-output}" pattern="windows\s+installer\s+xml\s+(toolset\s+)?compiler\s+version\s+3.*" casesensitive="false"/>
3537 </not>
3538 </condition>
3539 </target>
3540 <target name="-check-dpkg-presence" depends="-check-native-bundling-type" if="need.dpkg.presence">
3541 <local name="exec.which.dpkg.result"/>
3542 <local name="exec.which.dpkg.output"/>
3543 <exec executable="command" failifexecutionfails="false" failonerror="false" resultproperty="exec.which.dpkg.result" outputproperty="exec.which.dpkg.output">
3544 <arg line="-v dpkg"/>
3545 </exec>
3546 <condition property="missing.dpkg">
3547 <not><and>
3548 <isset property="exec.which.dpkg.result"/>
3549 <equals arg1="${exec.which.dpkg.result}" arg2="0"/>
3550 <isset property="exec.which.dpkg.output"/>
3551 <not><equals arg1="${exec.which.dpkg.output}" arg2=""/></not>
3552 </and></not>
3553 </condition>
3554 </target>
3555 <target name="-check-rpmbuild-presence" depends="-check-native-bundling-type" if="need.rpmbuild.presence">
3556 <local name="exec.which.rpmbuild.result"/>
3557 <local name="exec.which.rpmbuild.output"/>
3558 <exec executable="command" failifexecutionfails="false" failonerror="false" resultproperty="exec.which.rpmbuild.result" outputproperty="exec.which.rpmbuild.output">
3559 <arg line="-v rpmbuild"/>
3560 </exec>
3561 <condition property="missing.rpmbuild">
3562 <not><and>
3563 <isset property="exec.which.rpmbuild.result"/>
3564 <equals arg1="${exec.which.rpmbuild.result}" arg2="0"/>
3565 <isset property="exec.which.rpmbuild.output"/>
3566 <not><equals arg1="${exec.which.rpmbuild.output}" arg2=""/></not>
3567 </and></not>
3568 </condition>
3569 </target>
3570 <target name="-check-native-packager-external-tools" depends="-check-Inno-presence, -check-WiX-presence, -check-dpkg-presence, -check-rpmbuild-presence">
3571 <property name="missing.Inno.message" value="JavaFX native packager requires external Inno Setup 5+ tools installed and included on PATH to create EXE installer. See http://www.jrsoftware.org/"/>
3572 <property name="missing.WiX.message" value="JavaFX native packager requires external WiX 3.0+ tools installed and included on PATH to create MSI installer. See http://wix.sourceforge.net/"/>
3573 <property name="missing.dpkg.message" value="JavaFX native packager requires Debian Packager tools to create DEB package, but dpkg could not be found."/>
3574 <property name="missing.rpmbuild.message" value="JavaFX native packager requires RPMBuild to create RPM package, but rpmbuild could not be found."/>
3575 <condition property="missing.Inno.WiX">
3576 <and>
3577 <isset property="missing.Inno"/>
3578 <isset property="missing.WiX"/>
3579 </and>
3580 </condition>
3581 <fail message="Error:${line.separator}${missing.Inno.message}${line.separator}${missing.WiX.message}" if="missing.Inno.WiX"/>
3582 <fail message="Error:${line.separator}${missing.Inno.message}" if="missing.Inno"/>
3583 <fail message="Error:${line.separator}${missing.WiX.message}" if="missing.WiX"/>
3584 <fail message="Error:${line.separator}${missing.dpkg.message}" if="missing.dpkg"/>
3585 <fail message="Error:${line.separator}${missing.rpmbuild.message}" if="missing.rpmbuild"/>
3586 </target>
3587
3588 <!-- Project Run Support -->
3589
3590 <target name="-warn-of-preloader" depends="-check-project" if="preloader-app-no-workaround">
3591 <fail message="Error:${line.separator}JavaFX 2 Preloader Project can not be executed directly.${line.separator}Please execute instead a JavaFX Application that uses the Preloader."/>
3592 </target>
3593
3594 <target name="-mark-project-state-running">
3595 <property name="project.state.running" value="true"/>
3596 <echo message="project.state.running = ${project.state.running}" level="verbose"/>
3597 </target>
3598 <target name="-mark-project-state-debugging">
3599 <property name="project.state.debugging" value="true"/>
3600 <echo message="project.state.debugging = ${project.state.debugging}" level="verbose"/>
3601 </target>
3602 <target name="-mark-project-state-debugging-in-browser" depends="-mark-project-state-debugging">
3603 <property name="project.state.debugging.in.browser" value="true"/>
3604 <echo message="project.state.debugging.in.browser = ${project.state.debugging.in.browser}" level="verbose"/>
3605 </target>
3606 <target name="-mark-project-state-profiling">
3607 <property name="project.state.profiling" value="true"/>
3608 <echo message="project.state.profiling = ${project.state.profiling}" level="verbose"/>
3609 </target>
3610 <target name="-mark-project-needs-jnlp">
3611 <property name="project.needs.jnlp" value="true"/>
3612 <echo message="project.needs.jnlp = ${project.needs.jnlp}" level="verbose"/>
3613 </target>
3614
3615 <!-- set property javafx.disable.concurrent.runs=true to disable runs from temporary directory -->
3616 <target name="-check-concurrent-runs">
3617 <condition property="disable-concurrent-runs">
3618 <and>
3619 <isset property="javafx.disable.concurrent.runs"/>
3620 <equals arg1="${javafx.disable.concurrent.runs}" arg2="true" trim="true"/>
3621 </and>
3622 </condition>
3623 <condition property="temp.run.jar" value="${jfx.deployment.dir}${file.separator}${jfx.deployment.jar}">
3624 <isset property="disable-concurrent-runs"/>
3625 </condition>
3626 <condition property="temp.run.jnlp" value="${jfx.deployment.jnlp}">
3627 <isset property="disable-concurrent-runs"/>
3628 </condition>
3629 <condition property="temp.run.html" value="${jfx.deployment.html}">
3630 <isset property="disable-concurrent-runs"/>
3631 </condition>
3632 </target>
3633 <target name="-create-temp-run-dir" depends="-check-concurrent-runs" unless="disable-concurrent-runs">
3634 <echo message="Creating temp run dir" level="verbose"/>
3635 <tempfile property="temp.run.dir" destDir="${basedir}${file.separator}${dist.dir}${file.separator}" prefix="run"/>
3636 <echo message="temp.run.dir = ${temp.run.dir}" level="verbose"/>
3637 <copy todir="${temp.run.dir}" includeemptydirs="true" overwrite="true">
3638 <fileset dir="${basedir}${file.separator}${dist.dir}">
3639 <exclude name="**${file.separator}bundles${file.separator}**"/>
3640 <exclude name="**${file.separator}run*${file.separator}**"/>
3641 </fileset>
3642 </copy>
3643 <property name="temp.run.jar" value="${temp.run.dir}${file.separator}${jfx.deployment.jar}"/>
3644 <basename property="jfx.deployment.base" file="${jfx.deployment.jar}" suffix=".jar"/>
3645 <property name="temp.run.jnlp" value="${temp.run.dir}${file.separator}${jfx.deployment.base}.jnlp"/>
3646 <property name="temp.run.html" value="${temp.run.dir}${file.separator}${jfx.deployment.base}.html"/>
3647 </target>
3648 <target name="-remove-temp-run-dir" if="temp.run.dir">
3649 <echo message="Removing temp run dir" level="verbose"/>
3650 <delete dir="${temp.run.dir}" quiet="true" failonerror="false"/>
3651 </target>
3652 <target depends="init,compile,jar,-create-temp-run-dir" description="Run JavaFX project standalone." name="jfx-project-run">
3653 <echo message="Executing ${temp.run.jar} using platform ${platform.java}"/>
3654 <property name="run.jvmargs" value=""/>
3655 <property name="run.jvmargs.ide" value=""/>
3656 <java jar="${temp.run.jar}" dir="${work.dir}" fork="true" jvm="${platform.java}">
3657 <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
3658 <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
3659 <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
3660 <jvmarg line="${run.jvmargs}"/>
3661 <jvmarg line="${run.jvmargs.ide}"/>
3662 <classpath>
3663 <path path="${temp.run.jar}:${javac.classpath}"/>
3664 </classpath>
3665 <arg line="${application.args}"/>
3666 <syspropertyset>
3667 <propertyref prefix="run-sys-prop."/>
3668 <mapper from="run-sys-prop.*" to="*" type="glob"/>
3669 </syspropertyset>
3670 </java>
3671 <antcall target="-remove-temp-run-dir"/>
3672 </target>
3673 <target depends="init,compile,jar,-create-temp-run-dir,-debug-start-debugger" description="Debug JavaFX project standalone." name="jfx-project-debug">
3674 <echo message="Executing ${temp.run.jar} using platform ${platform.java}"/>
3675 <property name="run.jvmargs" value=""/>
3676 <property name="run.jvmargs.ide" value=""/>
3677 <java jar="${temp.run.jar}" dir="${work.dir}" fork="true" jvm="${platform.java}">
3678 <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
3679 <jvmarg line="${debug-args-line}"/>
3680 <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
3681 <jvmarg value="-Dglass.disableGrab=true"/>
3682 <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
3683 <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
3684 <jvmarg line="${run.jvmargs}"/>
3685 <jvmarg line="${run.jvmargs.ide}"/>
3686 <classpath>
3687 <path path="${temp.run.jar}:${javac.classpath}"/>
3688 </classpath>
3689 <arg line="${application.args}"/>
3690 <syspropertyset>
3691 <propertyref prefix="run-sys-prop."/>
3692 <mapper from="run-sys-prop.*" to="*" type="glob"/>
3693 </syspropertyset>
3694 </java>
3695 <antcall target="-remove-temp-run-dir"/>
3696 </target>
3697
3698
3699 <!-- Running/Debugging/Profiling Standalone -->
3700
3701 <target name="jfxsa-run" depends="-mark-project-state-running,-clean-if-config-changed,-check-jfx-runtime,-warn-of-preloader,jfx-project-run"/>
3702 <target name="jfxsa-run-noscript" depends="-set-fallback-no-javascript, jfxsa-run"/>
3703
3704 <target name="jfxsa-debug" depends="-mark-project-state-debugging,-clean-if-config-changed,jar,-check-jfx-runtime,-warn-of-preloader,jfx-project-debug"/>
3705 <target name="jfxsa-debug-noscript" depends="-set-fallback-no-javascript, jfxsa-debug"/>
3706
3707 <target name="jfxsa-profile" depends="-mark-project-state-profiling,-check-jfx-runtime,-warn-of-preloader,jfx-project-profile"/>
3708 <target name="jfxsa-profile-noscript" depends="-set-fallback-no-javascript, jfxsa-profile"/>
3709
3710 <target name="-check-clean-if-config-changed" depends="-init-project">
3711 <deploy-defines/>
3712 <uptodate property="jfx.deployment.jar.newer.than.nbproject" targetfile="${jfx.deployment.dir}${file.separator}${jfx.deployment.jar}" >
3713 <srcfiles dir="${basedir}${file.separator}nbproject" includes="**${file.separator}*"/>
3714 </uptodate>
3715 <echo message="jfx.deployment.jar.newer.than.nbproject = ${jfx.deployment.jar.newer.than.nbproject}" level="verbose"/>
3716 <available file="${jfx.deployment.dir}${file.separator}${jfx.deployment.jar}" type="file" property="jfx.deployment.jar.exists"/>
3717 <condition property="request.clean.due.to.config.change">
3718 <and>
3719 <isset property="jfx.deployment.jar.exists"/>
3720 <not><isset property="jfx.deployment.jar.newer.than.nbproject"/></not>
3721 </and>
3722 </condition>
3723 </target>
3724 <target name="-clean-if-config-changed" depends="-check-clean-if-config-changed" if="request.clean.due.to.config.change">
3725 <echo message="Config change detected. Invoking clean." level="verbose"/>
3726 <antcall target="clean"/>
3727 </target>
3728
3729 <target depends="-profile-check-1,-profile-pre72" description="Profile a project in the IDE." if="profiler.configured" name="jfx-project-profile" unless="profiler.info.jvmargs.agent">
3730 <startprofiler/>
3731 <antcall target="jfxsa-run"/>
3732 </target>
3733
3734 <!-- Shared Debugging init -->
3735
3736 <target name="-init-debug-args">
3737 <property name="version-output" value="java version &quot;${ant.java.version}"/>
3738 <condition property="have-jdk-older-than-1.4">
3739 <or>
3740 <contains string="${version-output}" substring="java version &quot;1.0"/>
3741 <contains string="${version-output}" substring="java version &quot;1.1"/>
3742 <contains string="${version-output}" substring="java version &quot;1.2"/>
3743 <contains string="${version-output}" substring="java version &quot;1.3"/>
3744 </or>
3745 </condition>
3746 <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
3747 <istrue value="${have-jdk-older-than-1.4}"/>
3748 </condition>
3749 <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
3750 <os family="windows"/>
3751 </condition>
3752 <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
3753 <isset property="debug.transport"/>
3754 </condition>
3755 </target>
3756
3757
3758 <!-- Running/Debugging/Profiling as WebStart -->
3759
3760 <target name="-check-jnlp-file-fx" depends="-swing-api-check" unless="fx-in-swing-app-workaround">
3761 <basename property="jfx.deployment.base" file="${jfx.deployment.jar}" suffix=".jar"/>
3762 <property name="jfx.deployment.jnlp" location="${jfx.deployment.dir}${file.separator}${jfx.deployment.base}.jnlp"/>
3763 </target>
3764 <target name="-check-jnlp-file-swing" depends="-swing-api-check" if="fx-in-swing-app-workaround">
3765 <basename property="jfx.deployment.base" file="${jfx.deployment.jar}" suffix=".jar"/>
3766 <property name="jfx.deployment.jnlp" location="${jfx.deployment.dir}${file.separator}${jfx.deployment.base}_application.jnlp"/>
3767 </target>
3768 <target name="-check-jnlp-file" depends="-check-jnlp-file-fx,-check-jnlp-file-swing">
3769 <condition property="jnlp-file-exists">
3770 <available file="${jfx.deployment.jnlp}"/>
3771 </condition>
3772 <condition property="jnlp-file-exists+netbeans.home">
3773 <and>
3774 <isset property="jnlp-file-exists"/>
3775 <isset property="netbeans.home"/>
3776 </and>
3777 </condition>
3778 </target>
3779
3780 <target name="-resolve-jnlp-file" depends="-check-jnlp-file" unless="jnlp-file-exists">
3781 <antcall target="jfx-deployment"/>
3782 <antcall target="-check-jnlp-file"/>
3783 </target>
3784
3785 <!-- set property javafx.enable.concurrent.external.runs=true to enable multiple runs of the same WebStart or Run-in-Browser project -->
3786 <target name="-check-concurrent-jnlp-runs" depends="-resolve-jnlp-file">
3787 <condition property="disable-concurrent-runs">
3788 <not>
3789 <and>
3790 <isset property="javafx.enable.concurrent.external.runs"/>
3791 <equals arg1="${javafx.enable.concurrent.external.runs}" arg2="true" trim="true"/>
3792 </and>
3793 </not>
3794 </condition>
3795 <condition property="temp.run.jnlp" value="${jfx.deployment.jnlp}">
3796 <isset property="disable-concurrent-runs"/>
3797 </condition>
3798 </target>
3799 <target name="-warn-concurrent-jnlp-runs" unless="disable-concurrent-runs">
3800 <echo message="Note: Concurrent Run as WebStart enabled.${line.separator}Temporary directory ${temp.run.dir}${line.separator}will remain unused when WebStart execution has finished. Use project Clean to delete unused directories."/>
3801 </target>
3802
3803 <target name="jfxws-run" if="jnlp-file-exists" depends="-mark-project-state-running,-clean-if-config-changed,-mark-project-needs-jnlp,-check-jdk-7u4or5-mac,jar,
3804 -check-jfx-webstart,-resolve-jnlp-file,-check-jfx-runtime,-check-concurrent-jnlp-runs,-create-temp-run-dir,-warn-insufficient-signing"
3805 description="Start JavaFX javaws execution">
3806 <echo message="Executing ${temp.run.jnlp} using ${active.webstart.executable}"/>
3807 <exec executable="${active.webstart.executable}">
3808 <arg file="${temp.run.jnlp}"/>
3809 </exec>
3810 <antcall target="-warn-concurrent-jnlp-runs"/>
3811 </target>
3812
3813 <target name="jfxws-debug" if="jnlp-file-exists+netbeans.home" depends="-mark-project-state-debugging,-clean-if-config-changed,-mark-project-needs-jnlp,
3814 -check-jdk-7u4or5-mac,jar,-check-jfx-webstart,-resolve-jnlp-file,-check-jfx-runtime,-warn-insufficient-signing,
3815 -debug-start-debugger,-debug-javaws-debuggee" description="Debug JavaFX javaws project in IDE"/>
3816
3817 <target name="-debug-javaws-debuggee" depends="-init-debug-args">
3818 <echo message="Executing ${jfx.deployment.jnlp} in debug mode using ${active.webstart.executable}"/>
3819 <exec executable="${active.webstart.executable}">
3820 <env key="JAVAWS_VM_ARGS" value="${debug-args-line} -Xrunjdwp:transport=${debug-transport},address=${jpda.address} -Dglass.disableGrab=true"/>
3821 <arg value="-wait"/>
3822 <arg file="${jfx.deployment.jnlp}"/>
3823 </exec>
3824 </target>
3825
3826 <target name="-profile-check-1">
3827 <property name="run.jvmargs.ide" value=""/>
3828 <condition property="profiler.configured">
3829 <or>
3830 <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
3831 <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
3832 </or>
3833 </condition>
3834 </target>
3835
3836 <target if="jnlp-file-exists+netbeans.home" name="-profile-check-jnlp">
3837 <antcall target="-profile-check-1"/>
3838 </target>
3839
3840 <target name="-do-jfxws-profile" depends="-mark-project-state-profiling,-mark-project-needs-jnlp,
3841 -check-jdk-7u4or5-mac,jar,-check-jfx-webstart,-resolve-jnlp-file,-check-jfx-runtime,-warn-insufficient-signing">
3842 <echo message="Executing ${jfx.deployment.jnlp} in profile mode using ${active.webstart.executable}"/>
3843 <property name="run.jvmargs.ide" value=""/>
3844 <exec executable="${active.webstart.executable}">
3845 <env key="JAVAWS_VM_ARGS" value="${run.jvmargs.ide}"/>
3846 <arg value="-wait"/>
3847 <arg file="${jfx.deployment.jnlp}"/>
3848 </exec>
3849 </target>
3850
3851 <target name="jfxws-profile" if="profiler.configured"
3852 depends="-profile-check-1"
3853 description="Profile JavaFX javaws project in IDE">
3854 <startprofiler/>
3855 <antcall target="-do-jfxws-profile"/>
3856 </target>
3857
3858 <target name="jfxws-run-noscript" depends="-set-fallback-no-javascript, jfxws-run"/>
3859
3860 <target name="jfxws-debug-noscript" depends="-set-fallback-no-javascript, jfxws-debug"/>
3861
3862 <target name="jfxws-profile-noscript" depends="-set-fallback-no-javascript, jfxws-profile"/>
3863
3864
3865 <!-- Running/Debugging/Profiling in Browser -->
3866
3867 <target name="-check-selected-browser-path" depends="-check-default-run-config">
3868 <condition property="javafx.run.inbrowser.undefined">
3869 <or>
3870 <and>
3871 <isset property="javafx.run.inbrowser"/>
3872 <equals arg1="${javafx.run.inbrowser}" arg2="undefined"/>
3873 </and>
3874 <and>
3875 <isset property="javafx.run.inbrowser.path"/>
3876 <equals arg1="${javafx.run.inbrowser.path}" arg2="undefined"/>
3877 </and>
3878 </or>
3879 </condition>
3880 <condition property="javafx.run.inbrowser.path-exists">
3881 <and>
3882 <isset property="javafx.run.inbrowser.path"/>
3883 <available file="${javafx.run.inbrowser.path}"/>
3884 </and>
3885 </condition>
3886 <fail message="Error:${line.separator}Browser selection not recognizable from ${config} run configuration.${line.separator}Please go to Project Properties dialog, category Run, to select a valid browser." unless="javafx.run.inbrowser.path"/>
3887 <fail message="Error:${line.separator}No browser defined in ${config} run configuration.${line.separator}Please verify in Tools->Options dialog that NetBeans recognizes a valid browser, then go to Project Properties dialog, category Run, to select a valid browser." if="javafx.run.inbrowser.undefined"/>
3888 <fail message="Error:${line.separator}Browser ${javafx.run.inbrowser.path} referred from ${config} run configuration can not be found.${line.separator}(This can happen, e.g, when the JavaFX Project is transferred to another system.)${line.separator}Please go to Project Properties dialog, category Run, to select a valid browser." unless="javafx.run.inbrowser.path-exists"/>
3889 </target>
3890
3891 <target name="-substitute-template-processed-html-file" depends="-check-project" if="html-template-available">
3892 <deploy-process-template/>
3893 </target>
3894 <target name="-check-template-processed-html-file" depends="-substitute-template-processed-html-file">
3895 <condition property="html-file-exists">
3896 <and>
3897 <isset property="html-template-available"/>
3898 <available file="${javafx.run.htmltemplate.processed}"/>
3899 </and>
3900 </condition>
3901 </target>
3902
3903 <target name="-set-template-processed-html-file" depends="-check-template-processed-html-file" if="html-file-exists">
3904 <property name="jfx.deployment.html" location="${javafx.run.htmltemplate.processed}"/>
3905 </target>
3906
3907 <target name="-set-html-file" depends="-set-template-processed-html-file" unless="html-file-exists">
3908 <basename property="jfx.deployment.base" file="${jfx.deployment.jar}" suffix=".jar"/>
3909 <property name="jfx.deployment.html" location="${jfx.deployment.dir}${file.separator}${jfx.deployment.base}.html"/>
3910 <condition property="html-file-exists">
3911 <available file="${jfx.deployment.html}"/>
3912 </condition>
3913 <condition property="html-file-exists+netbeans.home">
3914 <and>
3915 <isset property="html-file-exists"/>
3916 <isset property="netbeans.home"/>
3917 </and>
3918 </condition>
3919 </target>
3920
3921 <!-- set property javafx.enable.concurrent.external.runs=true to enable multiple runs of the same WebStart or Run-in-Browser project -->
3922 <target name="-check-concurrent-html-runs" depends="-set-html-file">
3923 <condition property="disable-concurrent-runs">
3924 <or>
3925 <not>
3926 <and>
3927 <isset property="javafx.enable.concurrent.external.runs"/>
3928 <equals arg1="${javafx.enable.concurrent.external.runs}" arg2="true" trim="true"/>
3929 </and>
3930 </not>
3931 <and>
3932 <isset property="html-template-available"/>
3933 <available file="${javafx.run.htmltemplate.processed}"/>
3934 </and>
3935 </or>
3936 </condition>
3937 <condition property="temp.run.html" value="${jfx.deployment.html}">
3938 <isset property="disable-concurrent-runs"/>
3939 </condition>
3940 </target>
3941 <target name="-warn-concurrent-html-runs" unless="disable-concurrent-runs">
3942 <echo message="Note: Concurrent Run in Browser enabled.${line.separator}Temporary directory ${temp.run.dir}${line.separator}will remain unused when execution in browser has finished. Use project Clean to delete unused directories."/>
3943 </target>
3944
3945 <target name="jfxbe-run" if="html-file-exists" depends="-mark-project-state-running,-clean-if-config-changed,-mark-project-needs-jnlp,-check-jdk-7u4or5-mac,jar,
3946 -check-selected-browser-path,-set-html-file,-check-jfx-runtime,-check-concurrent-html-runs,-create-temp-run-dir,-warn-insufficient-signing"
3947 description="Start JavaFX execution in browser">
3948 <echo message="Executing ${temp.run.html} using ${javafx.run.inbrowser}"/>
3949 <echo message="(${javafx.run.inbrowser.path})"/>
3950 <property name="javafx.run.inbrowser.arguments" value=""/>
3951 <exec executable="${javafx.run.inbrowser.path}">
3952 <arg line="${javafx.run.inbrowser.arguments}"/>
3953 <arg file="${temp.run.html}"/>
3954 </exec>
3955 <antcall target="-warn-concurrent-html-runs"/>
3956 </target>
3957
3958 <target name="jfxbe-debug" if="html-file-exists+netbeans.home" depends="-mark-project-state-debugging-in-browser,-init-debug-args,
3959 clean,-debug-start-debugger,-mark-project-needs-jnlp,-check-jdk-7u4or5-mac,jar,
3960 -check-selected-browser-path,-set-html-file,-check-jfx-runtime,-warn-insufficient-signing,
3961 -debug-jfxbe-debuggee" description="Debug JavaFX project in browser">
3962 <!-- after the session clean up the jnlp containing debug settings -->
3963 <antcall target="clean"/>
3964 </target>
3965
3966 <target name="-debug-jfxbe-debuggee" depends="-init-debug-args">
3967 <echo message="Executing ${jfx.deployment.html} in debug mode using ${javafx.run.inbrowser}"/>
3968 <echo message="(${javafx.run.inbrowser.path})"/>
3969 <property name="javafx.run.inbrowser.arguments" value=""/>
3970 <exec executable="${javafx.run.inbrowser.path}">
3971 <arg line="${javafx.run.inbrowser.arguments}"/>
3972 <env key="_JPI_VM_OPTIONS" value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
3973 <arg file="${jfx.deployment.html}"/>
3974 </exec>
3975 </target>
3976
3977 <target if="html-file-exists+netbeans.home" name="-profile-check-html">
3978 <antcall target="-profile-check-1"/>
3979 </target>
3980
3981 <target name="-do-jfxbe-profile" depends="-mark-project-state-profiling,-mark-project-needs-jnlp,
3982 -check-jdk-7u4or5-mac,jar,-check-selected-browser-path,-set-html-file,-check-jfx-runtime,-warn-insufficient-signing">
3983 <echo message="Executing ${jfx.deployment.html} in profile mode using ${javafx.run.inbrowser}"/>
3984 <echo message="(${javafx.run.inbrowser.path})"/>
3985 <property name="run.jvmargs.ide" value=""/>
3986 <property name="javafx.run.inbrowser.arguments" value=""/>
3987 <exec executable="${javafx.run.inbrowser.path}">
3988 <arg line="${javafx.run.inbrowser.arguments}"/>
3989 <env key="_JPI_VM_OPTIONS" value="${run.jvmargs.ide}"/>
3990 <arg file="${jfx.deployment.html}"/>
3991 </exec>
3992 </target>
3993
3994 <target name="jfxbe-profile" if="profiler.configured"
3995 depends="-profile-check-html"
3996 description="Profile JavaFX project in browser">
3997 <startprofiler/>
3998 <antcall target="-do-jfxbe-profile"/>
3999 </target>
4000
4001 <target name="jfxbe-run-noscript" depends="-set-fallback-no-javascript, jfxbe-run"/>
4002
4003 <target name="jfxbe-debug-noscript" depends="-set-fallback-no-javascript, jfxbe-debug"/>
4004
4005 <target name="jfxbe-profile-noscript" depends="-set-fallback-no-javascript, jfxbe-profile"/>
4006
4007
4008 </project>