a simple Java-FX Application which Simulate the Approximation of Pi https://nextn.xyz
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4198 lines
226 KiB

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