changeset 5642:170a4c3af374 8.0-b115

Automated merge with ssh://jfxsrc.us.oracle.com//javafx/8.0/MASTER/jfx/rt
author mhowe
date Tue, 05 Nov 2013 14:07:29 -0800
parents ac9c1d089a27 58064c5894fa
children b72ce0e92eee b49810ea616a
files modules/fxpackager/src/main/resources/META-INF/services/com.sun.javafx.tools.packager.bundlers.Bundler
diffstat 8 files changed, 21 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/BundleParams.java	Tue Nov 05 18:19:31 2013 +0200
+++ b/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/BundleParams.java	Tue Nov 05 14:07:29 2013 -0800
@@ -35,7 +35,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.TreeSet;
 import java.util.jar.Attributes;
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
@@ -45,7 +44,7 @@
     RelativeFileSet runtime;
     RelativeFileSet appResources;
     Bundler.BundleType type;
-    Set<String> bundleFormat = new TreeSet<String>();
+    String bundleFormat;
     File icon;
 
     /* Name of bundle file and native launcher.
@@ -195,16 +194,7 @@
     }
 
     public void setBundleFormat(String t) {
-        bundleFormat.clear();
-        if (t != null) {
-            if (t.startsWith("[") && t.endsWith("]")) {
-                t = t.substring(1, t.length() - 1);
-            }
-            for (String s : t.split(",")) {
-                if (s.isEmpty()) continue;
-                bundleFormat.add(s.trim());
-            }
-        }
+        bundleFormat = t;
     }
 
     private boolean shouldExclude(File baseDir, File f, Rule ruleset[]) {
--- a/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/Bundler.java	Tue Nov 05 18:19:31 2013 +0200
+++ b/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/Bundler.java	Tue Nov 05 14:07:29 2013 -0800
@@ -34,7 +34,6 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
-import java.util.ServiceLoader;
 import java.util.Set;
 
 public abstract class Bundler {
@@ -78,7 +77,18 @@
         }
     };
 
-   private static ServiceLoader<Bundler> bundlerLoader = ServiceLoader.load(Bundler.class);
+    private static final List<Bundler> knownBundlers = new LinkedList<Bundler>();
+
+    static {
+        knownBundlers.add(new WinAppBundler());
+        knownBundlers.add(new MacAppBundler());
+        knownBundlers.add(new WinMsiBundler());
+        knownBundlers.add(new WinExeBundler());
+        knownBundlers.add(new MacDMGBundler());
+        knownBundlers.add(new LinuxAppBundler());
+        knownBundlers.add(new LinuxRPMBundler());
+        knownBundlers.add(new LinuxDebBundler());
+    }
 
     protected void setBuildRoot(File dir) {
         buildRoot = dir;
@@ -96,8 +106,8 @@
         } catch (IOException ioe) {}
 
         Log.verbose("Looking for bundlers for type=" + p.type.toString()
-                + " format=" + (p.bundleFormat.isEmpty() ? "any" : p.bundleFormat.toString()));
-        for (Bundler b: bundlerLoader) {
+                + " format=" + (p.bundleFormat != null ? p.bundleFormat : "any"));
+        for (Bundler b: knownBundlers) {
             if (verbose) {
                 b.setVerbose(true);
             }
--- a/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/LinuxDebBundler.java	Tue Nov 05 18:19:31 2013 +0200
+++ b/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/LinuxDebBundler.java	Tue Nov 05 14:07:29 2013 -0800
@@ -91,7 +91,7 @@
     @Override
     boolean validate(BundleParams p) throws Bundler.UnsupportedPlatformException, Bundler.ConfigException {
         if (!(p.type == Bundler.BundleType.ALL || p.type == Bundler.BundleType.INSTALLER)
-                 || !(p.bundleFormat.isEmpty() || p.bundleFormat.contains("deb"))) {
+                 || !(p.bundleFormat == null || "deb".equals(p.bundleFormat))) {
             return false;
         }
         //run basic validation to ensure requirements are met
--- a/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/LinuxRPMBundler.java	Tue Nov 05 18:19:31 2013 +0200
+++ b/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/LinuxRPMBundler.java	Tue Nov 05 14:07:29 2013 -0800
@@ -86,7 +86,7 @@
     @Override
     boolean validate(BundleParams p) throws Bundler.UnsupportedPlatformException, Bundler.ConfigException {
         if (!(p.type == Bundler.BundleType.ALL || p.type == Bundler.BundleType.INSTALLER)
-                 || !(p.bundleFormat.isEmpty() || p.bundleFormat.contains("rpm"))) {
+                 || !(p.bundleFormat == null || "rpm".equals(p.bundleFormat))) {
             return false;
         }
         //run basic validation to ensure requirements are met
--- a/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/MacDMGBundler.java	Tue Nov 05 18:19:31 2013 +0200
+++ b/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/MacDMGBundler.java	Tue Nov 05 14:07:29 2013 -0800
@@ -62,7 +62,7 @@
     boolean validate(BundleParams p)
             throws UnsupportedPlatformException, ConfigException {
         if (!(p.type == Bundler.BundleType.ALL || p.type == Bundler.BundleType.INSTALLER)
-                 || !(p.bundleFormat.isEmpty() || p.bundleFormat.contains("dmg"))) {
+                 || !(p.bundleFormat == null || "dmg".equals(p.bundleFormat))) {
             return false;
         }
         //run basic validation to ensure requirements are met
--- a/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/WinExeBundler.java	Tue Nov 05 18:19:31 2013 +0200
+++ b/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/WinExeBundler.java	Tue Nov 05 14:07:29 2013 -0800
@@ -104,7 +104,7 @@
     @Override
     boolean validate(BundleParams p) throws Bundler.UnsupportedPlatformException, Bundler.ConfigException {
         if (!(p.type == Bundler.BundleType.ALL || p.type == Bundler.BundleType.INSTALLER)
-                 || !(p.bundleFormat.isEmpty() || p.bundleFormat.contains("exe"))) {
+                 || !(p.bundleFormat == null || "exe".equals(p.bundleFormat))) {
             return false;
         }
         //run basic validation to ensure requirements are met
--- a/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/WinMsiBundler.java	Tue Nov 05 18:19:31 2013 +0200
+++ b/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/WinMsiBundler.java	Tue Nov 05 14:07:29 2013 -0800
@@ -104,7 +104,7 @@
     @Override
     boolean validate(BundleParams p) throws UnsupportedPlatformException, ConfigException {
         if (!(p.type == Bundler.BundleType.ALL || p.type == Bundler.BundleType.INSTALLER)
-                 || !(p.bundleFormat.isEmpty() || p.bundleFormat.contains("msi"))) {
+                 || !(p.bundleFormat == null || "msi".equals(p.bundleFormat))) {
             return false;
         }
         //run basic validation to ensure requirements are met
--- a/modules/fxpackager/src/main/resources/META-INF/services/com.sun.javafx.tools.packager.bundlers.Bundler	Tue Nov 05 18:19:31 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-com.sun.javafx.tools.packager.bundlers.LinuxAppBundler
-com.sun.javafx.tools.packager.bundlers.LinuxDebBundler
-com.sun.javafx.tools.packager.bundlers.LinuxRPMBundler
-com.sun.javafx.tools.packager.bundlers.MacAppBundler
-com.sun.javafx.tools.packager.bundlers.MacDMGBundler
-com.sun.javafx.tools.packager.bundlers.WinAppBundler
-com.sun.javafx.tools.packager.bundlers.WinExeBundler
-com.sun.javafx.tools.packager.bundlers.WinMsiBundler
\ No newline at end of file