8233594: create a new option --bind-servces to pass on to jlink JDK-8200758-branch
authorherrick
Wed, 06 Nov 2019 07:13:25 -0500
branchJDK-8200758-branch
changeset 58992 7249e95cc439
parent 58922 fbaf2e6402ad
child 58993 b5e1baa9d2c3
8233594: create a new option --bind-servces to pass on to jlink Reviewed-by: asemenyuk, almatvee, kcr
src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java
src/jdk.jpackage/share/classes/jdk/jpackage/internal/JLinkBundlerHelper.java
src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java
src/jdk.jpackage/share/classes/jdk/jpackage/internal/ValidOptions.java
src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources.properties
src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties
src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java	Mon Nov 04 15:06:01 2019 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java	Wed Nov 06 07:13:25 2019 -0500
@@ -263,6 +263,10 @@
 
         MODULE_PATH ("module-path", "p", OptionCategories.MODULAR),
 
+        BIND_SERVICES ("bind-services", OptionCategories.PROPERTY, () -> {
+            setOptionValue("bind-services", true);
+        }),
+
         MAC_SIGN ("mac-sign", "s", OptionCategories.PLATFORM_MAC, () -> {
             setOptionValue("mac-sign", true);
         }),
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/JLinkBundlerHelper.java	Mon Nov 04 15:06:01 2019 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/JLinkBundlerHelper.java	Wed Nov 06 07:13:25 2019 -0500
@@ -155,7 +155,8 @@
             mainJarType = ModFile.ModType.UnnamedJar;
         }
 
-        boolean bindServices = addModules.isEmpty();
+        boolean bindServices =
+                StandardBundlerParam.BIND_SERVICES.fetchFrom(params);
 
         // Modules
         String mainModule = getMainModule(params);
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java	Mon Nov 04 15:06:01 2019 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java	Wed Nov 06 07:13:25 2019 -0500
@@ -320,6 +320,16 @@
                     (s, p) -> s
             );
 
+    static final StandardBundlerParam<Boolean> BIND_SERVICES =
+            new StandardBundlerParam<>(
+                    Arguments.CLIOptions.BIND_SERVICES.getId(),
+                    Boolean.class,
+                    params -> false,
+                    (s, p) -> (s == null || "null".equalsIgnoreCase(s)) ?
+                            true : Boolean.valueOf(s)
+            );
+
+
     static final StandardBundlerParam<Boolean> VERBOSE  =
             new StandardBundlerParam<>(
                     Arguments.CLIOptions.VERBOSE.getId(),
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ValidOptions.java	Mon Nov 04 15:06:01 2019 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ValidOptions.java	Wed Nov 06 07:13:25 2019 -0500
@@ -84,6 +84,7 @@
         options.put(CLIOptions.ARGUMENTS.getId(), USE.LAUNCHER);
         options.put(CLIOptions.JAVA_OPTIONS.getId(), USE.LAUNCHER);
         options.put(CLIOptions.ADD_LAUNCHER.getId(), USE.LAUNCHER);
+        options.put(CLIOptions.BIND_SERVICES.getId(), USE.LAUNCHER);
 
         options.put(CLIOptions.LICENSE_FILE.getId(), USE.INSTALL);
         options.put(CLIOptions.INSTALL_DIR.getId(), USE.INSTALL);
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources.properties	Mon Nov 04 15:06:01 2019 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources.properties	Wed Nov 06 07:13:25 2019 -0500
@@ -102,6 +102,9 @@
 \          modular jar.\n\
 \          (each path is absolute or relative to the current directory)\n\
 \          This option can be used multiple times.\n\
+\  --bind-services \n\
+\          Pass on --bind-services option to jlink (which will link in \n\
+\          service provider modules and their dependences) \n\
 \  --runtime-image <file path>\n\
 \          Path of the predefined runtime image that will be copied into\n\
 \          the application image\n\
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties	Mon Nov 04 15:06:01 2019 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties	Wed Nov 06 07:13:25 2019 -0500
@@ -102,6 +102,9 @@
 \          modular jar.\n\
 \          (each path is absolute or relative to the current directory)\n\
 \          This option can be used multiple times.\n\
+\  --bind-services \n\
+\          Pass on --bind-services option to jlink (which will link in \n\
+\          service provider modules and their dependences) \n\
 \  --runtime-image <file path>\n\
 \          Path of the predefined runtime image that will be copied into\n\
 \          the application image\n\
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties	Mon Nov 04 15:06:01 2019 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties	Wed Nov 06 07:13:25 2019 -0500
@@ -102,6 +102,9 @@
 \          modular jar.\n\
 \          (each path is absolute or relative to the current directory)\n\
 \          This option can be used multiple times.\n\
+\  --bind-services \n\
+\          Pass on --bind-services option to jlink (which will link in \n\
+\          service provider modules and their dependences) \n\
 \  --runtime-image <file path>\n\
 \          Path of the predefined runtime image that will be copied into\n\
 \          the application image\n\