8231706: change "Java" dir to "app" dir in jpackage app image JDK-8200758-branch
authorherrick
Thu, 03 Oct 2019 11:04:51 -0400
branchJDK-8200758-branch
changeset 58455 0d95b41d0895
parent 58437 a44c029e85db
child 58463 4e71249f291c
8231706: change "Java" dir to "app" dir in jpackage app image Submitted-by: almatvee Reviewed-by: herrick, asemenyuk
src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java
src/jdk.jpackage/macosx/native/libapplauncher/MacPlatform.mm
src/jdk.jpackage/share/classes/jdk/jpackage/internal/ApplicationLayout.java
test/jdk/tools/jpackage/helpers/JPackagePath.java
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java	Tue Oct 01 23:54:39 2019 -0400
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java	Thu Oct 03 11:04:51 2019 -0400
@@ -79,7 +79,7 @@
 
     private final Path root;
     private final Path contentsDir;
-    private final Path javaDir;
+    private final Path appDir;
     private final Path javaModsDir;
     private final Path resourcesDir;
     private final Path macOSDir;
@@ -184,14 +184,14 @@
 
         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.appDir = contentsDir.resolve("app");
+        this.javaModsDir = appDir.resolve("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");
-        Files.createDirectories(javaDir);
+        Files.createDirectories(appDir);
         Files.createDirectories(resourcesDir);
         Files.createDirectories(macOSDir);
         Files.createDirectories(runtimeDir);
@@ -257,7 +257,7 @@
 
     @Override
     public Path getAppDir() {
-        return javaDir;
+        return appDir;
     }
 
     @Override
@@ -309,7 +309,7 @@
         }
 
         // Copy class path entries to Java folder
-        copyClassPathEntries(javaDir, params);
+        copyClassPathEntries(appDir, params);
 
         /*********** Take care of "config" files *******/
         File icon = ICON_ICNS.fetchFrom(params);
@@ -404,7 +404,7 @@
 
     public static String getLauncherCfgName(
             Map<String, ? super Object> params) {
-        return "Contents/Java/" + APP_NAME.fetchFrom(params) + ".cfg";
+        return "Contents/app/" + APP_NAME.fetchFrom(params) + ".cfg";
     }
 
     private void copyClassPathEntries(Path javaDirectory,
--- a/src/jdk.jpackage/macosx/native/libapplauncher/MacPlatform.mm	Tue Oct 01 23:54:39 2019 -0400
+++ b/src/jdk.jpackage/macosx/native/libapplauncher/MacPlatform.mm	Thu Oct 03 11:04:51 2019 -0400
@@ -97,7 +97,7 @@
 
 TString MacPlatform::GetPackageAppDirectory() {
     return FilePath::IncludeTrailingSeparator(
-            GetPackageRootDirectory()) + _T("Java");
+            GetPackageRootDirectory()) + _T("app");
 }
 
 TString MacPlatform::GetPackageLauncherDirectory() {
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ApplicationLayout.java	Tue Oct 01 23:54:39 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ApplicationLayout.java	Thu Oct 03 11:04:51 2019 -0400
@@ -121,11 +121,11 @@
     static ApplicationLayout macAppImage() {
         return new ApplicationLayout(Map.of(
                 PathRole.LAUNCHERS, Path.of("Contents/MacOS"),
-                PathRole.APP, Path.of("Contents/Java"),
+                PathRole.APP, Path.of("Contents/app"),
                 PathRole.RUNTIME, Path.of("Contents/runtime"),
                 PathRole.DESKTOP, Path.of("Contents/Resources"),
                 PathRole.DLLS, Path.of("Contents/MacOS"),
-                PathRole.APP_MODS, Path.of("Contents/Java/mods")
+                PathRole.APP_MODS, Path.of("Contents/app/mods")
         ));
     }
 
--- a/test/jdk/tools/jpackage/helpers/JPackagePath.java	Tue Oct 01 23:54:39 2019 -0400
+++ b/test/jdk/tools/jpackage/helpers/JPackagePath.java	Thu Oct 03 11:04:51 2019 -0400
@@ -95,7 +95,7 @@
             return Path.of("output", name, "app", name + ".cfg").toString();
         } else if (JPackageHelper.isOSX()) {
             return Path.of("output", name + ".app",
-                    "Contents", "Java", name + ".cfg").toString();
+                    "Contents", "app", name + ".cfg").toString();
         } else if (JPackageHelper.isLinux()) {
             return Path.of("output", name, "lib", "app", name + ".cfg").toString();
         } else {