# HG changeset patch # User herrick # Date 1544047438 18000 # Node ID 5103d6d2e7961c5e6f245f04f4f2d07c50211943 # Parent 9bb2a4dc3af7f487b61fbdcbd8d70b0466083969 8213385: jpackager Command-Line Argument File. Reviewed-by: almatvee, kcr diff -r 9bb2a4dc3af7 -r 5103d6d2e796 src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java Wed Dec 05 12:23:37 2018 -0500 +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java Wed Dec 05 17:03:58 2018 -0500 @@ -512,7 +512,20 @@ } private void initArgumentList(String[] args) { - argList = new ArrayList<>(Arrays.asList(args)); + argList = new ArrayList(args.length); + for (String arg : args) { + if (arg.startsWith("@")) { + if (arg.length() > 1) { + String filename = arg.substring(1); + argList.addAll(extractArgList(filename)); + } else { + Log.error("Illegal argument ["+arg+"]"); + } + } else { + argList.add(arg); + } + } + Log.debug ("\nJPackage argument list: \n" + argList + "\n"); pos = 0; deployParams = new DeployParams(); @@ -523,6 +536,46 @@ secondaryLaunchers = new ArrayList<>(); } + private List extractArgList(String filename) { + List args = new ArrayList(); + try { + File f = new File(filename); + if (f.exists()) { + List lines = Files.readAllLines(f.toPath()); + for (String line : lines) { + String [] qsplit; + String quote = "\""; + if (line.contains("\"")) { + qsplit = line.split("\""); + } else { + qsplit = line.split("\'"); + quote = "\'"; + } + for (int i=0; i \n\ +\ read options and mode from file. \n\ \ --help -h \n\ \ Shows the usage text, followed by a list and description of each valid option for the current platform and the given mode.\n\ \ If no mode is given, shows the usage text, followed by a list and description of each valid option for the current platform.\n\ diff -r 9bb2a4dc3af7 -r 5103d6d2e796 src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties Wed Dec 05 12:23:37 2018 -0500 +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties Wed Dec 05 17:03:58 2018 -0500 @@ -56,6 +56,8 @@ Generates a Server JRE installer.\n\ \n\ The following options are valid for all platforms:\n\ +\ @ \n\ +\ read options and mode from file. \n\ \ --help -h \n\ \ Shows the usage text, followed by a list and description of each valid option for the current platform and the given mode.\n\ \ If no mode is given, shows the usage text, followed by a list and description of each valid option for the current platform.\n\ diff -r 9bb2a4dc3af7 -r 5103d6d2e796 src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties Wed Dec 05 12:23:37 2018 -0500 +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties Wed Dec 05 17:03:58 2018 -0500 @@ -56,6 +56,8 @@ Generates a Server JRE installer.\n\ \n\ The following options are valid for all platforms:\n\ +\ @ \n\ +\ read options and mode from file. \n\ \ --help -h \n\ \ Shows the usage text, followed by a list and description of each valid option for the current platform and the given mode.\n\ \ If no mode is given, shows the usage text, followed by a list and description of each valid option for the current platform.\n\