changeset 10290:493acc2a57e1

8172789: fx packager: fx:info doesn't work Reviewed-by: cbensen
author vdrozdov
date Tue, 24 Jan 2017 11:25:04 -0800
parents aecac095fe44
children 857bbcdb5e70
files modules/jdk.packager/src/antplugin/java/com/sun/javafx/tools/ant/DeployFXTask.java
diffstat 1 files changed, 33 insertions(+), 49 deletions(-) [+]
line wrap: on
line diff
--- a/modules/jdk.packager/src/antplugin/java/com/sun/javafx/tools/ant/DeployFXTask.java	Mon Jan 23 17:39:25 2017 -0800
+++ b/modules/jdk.packager/src/antplugin/java/com/sun/javafx/tools/ant/DeployFXTask.java	Tue Jan 24 11:25:04 2017 -0800
@@ -164,12 +164,15 @@
             (nativeBundles == BundleType.JNLP ||
              nativeBundles == BundleType.ALL ||
              nativeBundles == BundleType.NONE)) {
+
+            setAppInfo();
+
             deployParams.setOfflineAllowed(offlineAllowed);
             deployParams.setVerbose(verbose);
             deployParams.setCodebase(codebase);
             deployParams.setSignBundle(signBundle);
 
-            if (app.getModule() == null) {
+            if (app != null && app.getModule() == null) {
                 deployParams.setApplicationClass(app.get().mainClass);
             }
 
@@ -243,30 +246,7 @@
                 setRuntime();
             }
 
-            if (appInfo != null) {
-                deployParams.setTitle(appInfo.title);
-                deployParams.setVendor(appInfo.vendor);
-                deployParams.setDescription(appInfo.appDescription);
-                deployParams.setCategory(appInfo.category);
-                deployParams.setLicenseType(appInfo.licenseType);
-                deployParams.setCopyright(appInfo.copyright);
-                deployParams.setEmail(appInfo.email);
-
-                for (Info.Icon i: appInfo.icons) {
-                    if (i instanceof Info.Splash) {
-                       deployParams.addIcon(i.href, i.kind, i.width, i.height, i.depth,
-                            ((Info.Splash) i).mode);
-                    } else {
-                       deployParams.addIcon(i.href, i.kind, i.width, i.height, i.depth,
-                            DeployParams.RunMode.WEBSTART);
-                    }
-                }
-
-                deployParams.addBundleArgument(StandardBundlerParam.FILE_ASSOCIATIONS.getID(),
-                        appInfo.fileAssociations.stream()
-                            .map(FileAssociation::createLauncherMap)
-                            .collect(Collectors.toList()));
-            }
+            setAppInfo();
 
             setPlatform();
             setPreferences();
@@ -294,30 +274,7 @@
                 setRuntime();
             }
 
-            if (appInfo != null) {
-                deployParams.setTitle(appInfo.title);
-                deployParams.setVendor(appInfo.vendor);
-                deployParams.setDescription(appInfo.appDescription);
-                deployParams.setCategory(appInfo.category);
-                deployParams.setLicenseType(appInfo.licenseType);
-                deployParams.setCopyright(appInfo.copyright);
-                deployParams.setEmail(appInfo.email);
-
-                for (Info.Icon i: appInfo.icons) {
-                    if (i instanceof Info.Splash) {
-                       deployParams.addIcon(i.href, i.kind, i.width, i.height, i.depth,
-                            ((Info.Splash) i).mode);
-                    } else {
-                       deployParams.addIcon(i.href, i.kind, i.width, i.height, i.depth,
-                            DeployParams.RunMode.WEBSTART);
-                    }
-                }
-
-                deployParams.addBundleArgument(StandardBundlerParam.FILE_ASSOCIATIONS.getID(),
-                        appInfo.fileAssociations.stream()
-                            .map(FileAssociation::createLauncherMap)
-                            .collect(Collectors.toList()));
-            }
+            setAppInfo();
 
             setPlatform();
             setPreferences();
@@ -674,6 +631,33 @@
         }
     }
 
+    private void setAppInfo() {
+        if (appInfo != null) {
+            deployParams.setTitle(appInfo.title);
+            deployParams.setVendor(appInfo.vendor);
+            deployParams.setDescription(appInfo.appDescription);
+            deployParams.setCategory(appInfo.category);
+            deployParams.setLicenseType(appInfo.licenseType);
+            deployParams.setCopyright(appInfo.copyright);
+            deployParams.setEmail(appInfo.email);
+
+            for (Info.Icon i: appInfo.icons) {
+                if (i instanceof Info.Splash) {
+                   deployParams.addIcon(i.href, i.kind, i.width, i.height, i.depth,
+                        ((Info.Splash) i).mode);
+                } else {
+                   deployParams.addIcon(i.href, i.kind, i.width, i.height, i.depth,
+                        DeployParams.RunMode.WEBSTART);
+                }
+            }
+
+            deployParams.addBundleArgument(StandardBundlerParam.FILE_ASSOCIATIONS.getID(),
+                    appInfo.fileAssociations.stream()
+                        .map(FileAssociation::createLauncherMap)
+                        .collect(Collectors.toList()));
+        }
+    }
+
     /**
      * Template to preprocess.
      * <p>