changeset 10162:5310c9067b11

8170295: fx:jvmarg is not set Reviewed-by: vdrozdov
author cbensen
date Tue, 29 Nov 2016 09:51:52 -0800
parents 67a8bf49e6ea
children a6fafaa51082
files modules/jdk.packager/src/antplugin/java/com/sun/javafx/tools/ant/DeployFXTask.java
diffstat 1 files changed, 35 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/modules/jdk.packager/src/antplugin/java/com/sun/javafx/tools/ant/DeployFXTask.java	Tue Nov 15 10:56:46 2016 +1300
+++ b/modules/jdk.packager/src/antplugin/java/com/sun/javafx/tools/ant/DeployFXTask.java	Tue Nov 29 09:51:52 2016 -0800
@@ -194,42 +194,13 @@
             deployParams.setExtension(isExtension);
             deployParams.setIncludeDT(includeDT);
 
-            if (platform != null) {
-                Platform pl = platform.get();
-                if (pl.j2se != null) {
-                    deployParams.setJRE(pl.j2se);
-                }
-                if (pl.javafx != null) {
-                    deployParams.setJavafx(pl.javafx);
-                }
-
-                //only pass it further if it was explicitly set
-                // as we do not want to override default
-                if (pl.javaRoot != null) {
-                    if (Platform.USE_SYSTEM_JRE.equals(pl.javaRoot)) {
-                        deployParams.setJavaRuntimeSource(null);
-                    } else {
-                        deployParams.setJavaRuntimeSource(new File(pl.javaRoot));
-                    }
-                }
-
-                for (Property p: pl.properties) {
-                    deployParams.addJvmProperty(p.name, p.value);
-                }
-                for (Jvmarg a: pl.jvmargs) {
-                    deployParams.addJvmArg(a.value);
-                }
-                for (Property a: pl.jvmUserArgs) {
-                    deployParams.addJvmUserArg(a.name, a.value);
-                }
-            }
-
             if (callbacks != null) {
                 for (Callback cb: callbacks.callbacks) {
                     deployParams.addCallback(cb.getName(), cb.getCmd());
                 }
             }
 
+            setPlatform();
             setPreferences();
 
             for (Template t: templateList) {
@@ -319,6 +290,7 @@
                             .collect(Collectors.toList()));
             }
 
+            setPlatform();
             setPreferences();
         }
 
@@ -367,6 +339,7 @@
                             .collect(Collectors.toList()));
             }
 
+            setPlatform();
             setPreferences();
         }
 
@@ -653,6 +626,38 @@
         bundleArgumentList.add(new BundleArgument(name, value));
     }
 
+    private void setPlatform() {
+        if (platform != null) {
+            Platform pl = platform.get();
+            if (pl.j2se != null) {
+                deployParams.setJRE(pl.j2se);
+            }
+            if (pl.javafx != null) {
+                deployParams.setJavafx(pl.javafx);
+            }
+
+            //only pass it further if it was explicitly set
+            // as we do not want to override default
+            if (pl.javaRoot != null) {
+                if (Platform.USE_SYSTEM_JRE.equals(pl.javaRoot)) {
+                    deployParams.setJavaRuntimeSource(null);
+                } else {
+                    deployParams.setJavaRuntimeSource(new File(pl.javaRoot));
+                }
+            }
+
+            for (Property p: pl.properties) {
+                deployParams.addJvmProperty(p.name, p.value);
+            }
+            for (Jvmarg a: pl.jvmargs) {
+                deployParams.addJvmArg(a.value);
+            }
+            for (Property a: pl.jvmUserArgs) {
+                deployParams.addJvmUserArg(a.name, a.value);
+            }
+        }
+    }
+
     private void setPreferences() {
         if (prefs != null) {
             deployParams.setNeedShortcut(prefs.getShortcut());