Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8261839: Error creating runtime package on macos without mac-package-…
…identifier

Reviewed-by: asemenyuk, almatvee, kizune
  • Loading branch information
Andy Herrick committed Mar 1, 2021
1 parent 682e120 commit 642f45f9dcaea6675e0c3215f2d486356aacce49
@@ -110,11 +110,13 @@ public class MacAppImageBuilder extends AbstractAppImageBuilder {
// Get identifier from app image if user provided
// app image and did not provide the identifier via CLI.
String identifier = extractBundleIdentifier(params);
if (identifier != null) {
return identifier;
if (identifier == null) {
identifier = MacAppBundler.getIdentifier(params);
}

return MacAppBundler.getIdentifier(params);
if (identifier == null) {
identifier = APP_NAME.fetchFrom(params);
}
return identifier;
},
(s, p) -> s);

@@ -723,7 +723,7 @@ JPackageCommand assertAppLayout() {
.filter(path -> path.getFileName().equals(appImageFileName))
.map(Path::toString)
.collect(Collectors.toList());
if (isImagePackageType() || TKit.isOSX()) {
if (isImagePackageType() || (TKit.isOSX() && !isRuntime())) {
List<String> expected = List.of(
AppImageFile.getPathInAppImage(rootDir).toString());
TKit.assertStringListEquals(expected, appImageFiles,
@@ -750,11 +750,11 @@ JPackageCommand assertAppLayout() {
if (!isRuntime()) {
TKit.assertExecutableFileExists(appLauncherPath());
TKit.assertFileExists(appLauncherCfgPath(null));
}

if (TKit.isOSX()) {
TKit.assertFileExists(appRuntimeDirectory().resolve(
"Contents/MacOS/libjli.dylib"));
if (TKit.isOSX()) {
TKit.assertFileExists(appRuntimeDirectory().resolve(
"Contents/MacOS/libjli.dylib"));
}
}

return this;
@@ -62,7 +62,8 @@ public static void withExplodedDmg(JPackageCommand cmd,

final Path mountPoint = Path.of(plist.queryValue("mount-point"));
try {
Path dmgImage = mountPoint.resolve(cmd.name() + ".app");
Path dmgImage = mountPoint.resolve(cmd.name() +
(cmd.isRuntime() ? "" : ".app"));
TKit.trace(String.format("Exploded [%s] in [%s] directory",
cmd.outputBundle(), dmgImage));
ThrowingConsumer.toConsumer(consumer).accept(dmgImage);
@@ -215,7 +216,7 @@ static String getBundleName(JPackageCommand cmd) {
static Path getInstallationDirectory(JPackageCommand cmd) {
cmd.verifyIsOfType(PackageType.MAC);
return Path.of(cmd.getArgumentValue("--install-dir", () -> "/Applications"))
.resolve(cmd.name() + ".app");
.resolve(cmd.name() + (cmd.isRuntime() ? "" : ".app"));
}

private static String getPackageName(JPackageCommand cmd) {
@@ -53,8 +53,6 @@
* @library ../helpers
* @key jpackagePlatformPackage
* @build jdk.jpackage.test.*
* @comment Temporary disable for OSX until functionality implemented
* @requires (os.family != "mac")
* @requires (jpackage.test.SQETest == null)
* @modules jdk.jpackage/jdk.jpackage.internal
* @compile RuntimePackageTest.java
@@ -68,8 +66,6 @@
* @library ../helpers
* @key jpackagePlatformPackage
* @build jdk.jpackage.test.*
* @comment Temporary disable for OSX until functionality implemented
* @requires (os.family != "mac")
* @requires (jpackage.test.SQETest != null)
* @modules jdk.jpackage/jdk.jpackage.internal
* @compile RuntimePackageTest.java
@@ -111,7 +107,11 @@ private static PackageTest init(Set<PackageType> types) {
})
.addInstallVerifier(cmd -> {
Set<Path> srcRuntime = listFiles(Path.of(cmd.getArgumentValue("--runtime-image")));
Set<Path> dstRuntime = listFiles(cmd.appRuntimeDirectory());
Path dest = cmd.appRuntimeDirectory();
if (TKit.isOSX()) {
dest = dest.resolve("Contents/Home");
}
Set<Path> dstRuntime = listFiles(dest);

Set<Path> intersection = new HashSet<>(srcRuntime);
intersection.retainAll(dstRuntime);

0 comments on commit 642f45f

Please sign in to comment.