< prev index next >

src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java

Print this page

        

@@ -74,11 +74,10 @@
 
     private final Path root;
     private final Path contentsDir;
     private final Path javaDir;
     private final Path javaModsDir;
-    private final String relativeModsDir;
     private final Path resourcesDir;
     private final Path macOSDir;
     private final Path runtimeDir;
     private final Path runtimeRoot;
     private final Path mdir;

@@ -174,11 +173,10 @@
         this.params = config;
         this.root = imageOutDir.resolve(APP_NAME.fetchFrom(params) + ".app");
         this.contentsDir = root.resolve("Contents");
         this.javaDir = contentsDir.resolve("Java");
         this.javaModsDir = javaDir.resolve("mods");
-        this.relativeModsDir = "Java/mods";
         this.resourcesDir = contentsDir.resolve("Resources");
         this.macOSDir = contentsDir.resolve("MacOS");
         this.runtimeDir = contentsDir.resolve("runtime");
         this.runtimeRoot = runtimeDir.resolve("Contents/Home");
         this.mdir = runtimeRoot.resolve("lib");

@@ -197,11 +195,10 @@
         this.params = config;
         this.root = imageOutDir.resolve(jreName );
         this.contentsDir = root.resolve("Contents");
         this.javaDir = null;
         this.javaModsDir = null;
-        this.relativeModsDir = null;
         this.resourcesDir = null;
         this.macOSDir = null;
         this.runtimeDir = this.root;
         this.runtimeRoot = runtimeDir.resolve("Contents/Home");
         this.mdir = runtimeRoot.resolve("lib");

@@ -276,15 +273,10 @@
     public Path getAppModsDir() {
         return javaModsDir;
     }
 
     @Override
-    public String getRelativeModsDir() {
-        return relativeModsDir;
-    }
-
-    @Override
     public void prepareApplicationFiles() throws IOException {
         Map<String, ? super Object> originalParams = new HashMap<>(params);
         // Generate PkgInfo
         File pkgInfoFile = new File(contentsDir.toFile(), "PkgInfo");
         pkgInfoFile.createNewFile();

@@ -301,11 +293,11 @@
             writeEntry(is_lib, macOSDir.resolve(LIBRARY_NAME));
         }
         executable.toFile().setExecutable(true, false);
         // generate main app launcher config file
         File cfg = new File(root.toFile(), getLauncherCfgName(params));
-        writeCfgFile(params, cfg, "$APPDIR/runtime");
+        writeCfgFile(params, cfg);
 
         // create additional app launcher(s) and config file(s)
         List<Map<String, ? super Object>> entryPoints =
                 StandardBundlerParam.ADD_LAUNCHERS.fetchFrom(params);
         for (Map<String, ? super Object> entryPoint : entryPoints) {

@@ -319,11 +311,11 @@
             }
             addExecutable.toFile().setExecutable(true, false);
 
             // add config file for add launcher
             cfg = new File(root.toFile(), getLauncherCfgName(tmp));
-            writeCfgFile(tmp, cfg, "$APPDIR/runtime");
+            writeCfgFile(tmp, cfg);
         }
 
         // Copy class path entries to Java folder
         copyClassPathEntries(javaDir);
 

@@ -487,11 +479,11 @@
                 getBundleName(params));
         data.put("DEPLOY_BUNDLE_COPYRIGHT",
                 COPYRIGHT.fetchFrom(params) != null ?
                 COPYRIGHT.fetchFrom(params) : "Unknown");
         data.put("DEPLOY_LAUNCHER_NAME", getLauncherName(params));
-        data.put("DEPLOY_JAVA_RUNTIME_NAME", "$APPDIR/runtime");
+        data.put("DEPLOY_JAVA_RUNTIME_NAME", getCfgRuntimeDir());
         data.put("DEPLOY_BUNDLE_SHORT_VERSION",
                 VERSION.fetchFrom(params) != null ?
                 VERSION.fetchFrom(params) : "1.0.0");
         data.put("DEPLOY_BUNDLE_CFBUNDLE_VERSION",
                 MAC_CF_BUNDLE_VERSION.fetchFrom(params) != null ?

@@ -537,18 +529,12 @@
 
         newline = "";
 
         data.put("DEPLOY_LAUNCHER_CLASS", MAIN_CLASS.fetchFrom(params));
 
-        StringBuilder macroedPath = new StringBuilder();
-        for (String s : CLASSPATH.fetchFrom(params).split("[ ;:]+")) {
-            macroedPath.append(s);
-            macroedPath.append(":");
-        }
-        macroedPath.deleteCharAt(macroedPath.length() - 1);
-
-        data.put("DEPLOY_APP_CLASSPATH", macroedPath.toString());
+        data.put("DEPLOY_APP_CLASSPATH",
+                  getCfgClassPath(CLASSPATH.fetchFrom(params)));
 
         StringBuilder bundleDocumentTypes = new StringBuilder();
         StringBuilder exportedTypes = new StringBuilder();
         for (Map<String, ? super Object>
                 fileAssociation : FILE_ASSOCIATIONS.fetchFrom(params)) {
< prev index next >