--- old/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java 2019-08-16 15:45:01.324261300 -0400 +++ new/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java 2019-08-16 15:44:59.405412100 -0400 @@ -82,8 +82,6 @@ private final Path runtimeRoot; private final Path mdir; - private final Map params; - private static List keyChains; public static final BundlerParamInfo @@ -163,14 +161,13 @@ null : Boolean.valueOf(s) ); - public MacAppImageBuilder(Map config, Path imageOutDir) + public MacAppImageBuilder(Map params, Path imageOutDir) throws IOException { - super(config, imageOutDir.resolve(APP_NAME.fetchFrom(config) + super(params, imageOutDir.resolve(APP_NAME.fetchFrom(params) + ".app/Contents/runtime/Contents/Home")); Objects.requireNonNull(imageOutDir); - this.params = config; this.root = imageOutDir.resolve(APP_NAME.fetchFrom(params) + ".app"); this.contentsDir = root.resolve("Contents"); this.javaDir = contentsDir.resolve("Java"); @@ -186,13 +183,12 @@ Files.createDirectories(runtimeDir); } - public MacAppImageBuilder(Map config, String jreName, + public MacAppImageBuilder(Map params, String jreName, Path imageOutDir) throws IOException { super(null, imageOutDir.resolve(jreName + "/Contents/Home")); Objects.requireNonNull(imageOutDir); - this.params = config; this.root = imageOutDir.resolve(jreName ); this.contentsDir = root.resolve("Contents"); this.javaDir = null; @@ -275,7 +271,8 @@ } @Override - public void prepareApplicationFiles() throws IOException { + public void prepareApplicationFiles(Map params) + throws IOException { Map originalParams = new HashMap<>(params); // Generate PkgInfo File pkgInfoFile = new File(contentsDir.toFile(), "PkgInfo"); @@ -317,7 +314,7 @@ } // Copy class path entries to Java folder - copyClassPathEntries(javaDir); + copyClassPathEntries(javaDir, params); /*********** Take care of "config" files *******/ File icon = ICON_ICNS.fetchFrom(params); @@ -345,14 +342,15 @@ } } - copyRuntimeFiles(); - sign(); + copyRuntimeFiles(params); + sign(params); } @Override - public void prepareJreFiles() throws IOException { - copyRuntimeFiles(); - sign(); + public void prepareJreFiles(Map params) + throws IOException { + copyRuntimeFiles(params); + sign(params); } @Override @@ -361,13 +359,14 @@ return (home.exists() ? home : runtimeImageTop); } - private void copyRuntimeFiles() throws IOException { + private void copyRuntimeFiles(Map params) + throws IOException { // Generate Info.plist - writeInfoPlist(contentsDir.resolve("Info.plist").toFile()); + writeInfoPlist(contentsDir.resolve("Info.plist").toFile(), params); // generate java runtime info.plist writeRuntimeInfoPlist( - runtimeDir.resolve("Contents/Info.plist").toFile()); + runtimeDir.resolve("Contents/Info.plist").toFile(), params); // copy library Path runtimeMacOSDir = Files.createDirectories( @@ -382,7 +381,7 @@ Files.copy(jli, runtimeMacOSDir.resolve("libjli.dylib")); } - private void sign() throws IOException { + private void sign(Map params) throws IOException { if (Optional.ofNullable( SIGN_BUNDLE.fetchFrom(params)).orElse(Boolean.TRUE)) { try { @@ -413,7 +412,8 @@ return "Contents/Java/" + APP_NAME.fetchFrom(params) + ".cfg"; } - private void copyClassPathEntries(Path javaDirectory) throws IOException { + private void copyClassPathEntries(Path javaDirectory, + Map params) throws IOException { List resourcesList = APP_RESOURCES_LIST.fetchFrom(params); if (resourcesList == null) { @@ -449,7 +449,8 @@ } } - private void writeRuntimeInfoPlist(File file) throws IOException { + private void writeRuntimeInfoPlist(File file, + Map params) throws IOException { Map data = new HashMap<>(); String identifier = StandardBundlerParam.isRuntimeInstaller(params) ? MAC_CF_BUNDLE_IDENTIFIER.fetchFrom(params) : @@ -471,7 +472,8 @@ } } - private void writeInfoPlist(File file) throws IOException { + private void writeInfoPlist(File file, Map params) + throws IOException { Log.verbose(MessageFormat.format(I18N.getString( "message.preparing-info-plist"), file.getAbsolutePath()));