Skip to content

Commit 9211b77

Browse files
Don't create app image file on macOS when not needed
1 parent 40ba4da commit 9211b77

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,11 @@ private void writeEntry(InputStream in, Path dstFile) throws IOException {
266266
Files.copy(in, dstFile);
267267
}
268268

269+
@Override
270+
protected boolean withAppImageFile(Map<String, ? super Object> params) {
271+
return !withPackageFile;
272+
}
273+
269274
@Override
270275
public void prepareApplicationFiles(Map<String, ? super Object> params)
271276
throws IOException {

src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractAppImageBuilder.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ public InputStream getResourceAsStream(String name) {
6666
public abstract void prepareApplicationFiles(
6767
Map<String, ? super Object> params) throws IOException;
6868

69+
protected boolean withAppImageFile(Map<String, ? super Object> params) {
70+
return true;
71+
}
72+
6973
protected void writeCfgFile(Map<String, ? super Object> params) throws
7074
IOException {
7175
new CfgFile().initFromParams(params).create(root);
@@ -96,7 +100,9 @@ protected void copyApplication(Map<String, ? super Object> params)
96100
appLayout.appDirectory().toAbsolutePath(), excludes);
97101
}
98102

99-
AppImageFile.save(root, params);
103+
if (withAppImageFile(params)) {
104+
AppImageFile.save(root, params);
105+
}
100106

101107
List<String> items = APP_CONTENT.fetchFrom(params);
102108
for (String item : items) {

0 commit comments

Comments
 (0)