Skip to content

Commit 0fa0d57

Browse files
committed
Merge branch 'issue-99'
2 parents 0bc52d9 + af50658 commit 0fa0d57

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

docs/macosx-specific-properties.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<!-- signing properties -->
1414
<developerId>singning identity</developerId>
1515
<entitlements>path/to/entitlements.plist</entitlements>
16+
<codesignApp>true|false</codesignApp>
1617

1718
<!-- properties used in DMG disk image generation -->
1819
<backgroundImage>path/to/png</backgroundImage>
@@ -41,6 +42,7 @@
4142
| `appId` | :x: | `${mainClass}` | App unique identifier. |
4243
| `developerId` | :x: | `null` | Signing identity. |
4344
| `entitlements` | :x: | `null` | Path to [entitlements](https://developer.apple.com/documentation/bundleresources/entitlements) file. |
45+
| `codesignApp` | :x: | `true` | If it is set to `false`, generated app will not be codesigned. |
4446

4547
## DMG generation properties
4648

src/main/java/io/github/fvarrui/javapackager/model/MacConfig.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public class MacConfig implements Serializable {
3333
private String appId;
3434
private String developerId = "-";
3535
private File entitlements;
36+
private boolean codesignApp = true;
3637

3738
public File getIcnsFile() {
3839
return icnsFile;
@@ -194,6 +195,14 @@ public void setEntitlements(File entitlements) {
194195
this.entitlements = entitlements;
195196
}
196197

198+
public boolean isCodesignApp() {
199+
return codesignApp;
200+
}
201+
202+
public void setCodesignApp(boolean codesignApp) {
203+
this.codesignApp = codesignApp;
204+
}
205+
197206
@Override
198207
public String toString() {
199208
return "MacConfig [icnsFile=" + icnsFile + ", backgroundImage=" + backgroundImage + ", windowWidth="
@@ -202,7 +211,7 @@ public String toString() {
202211
+ ", appsLinkIconX=" + appsLinkIconX + ", appsLinkIconY=" + appsLinkIconY + ", volumeIcon=" + volumeIcon
203212
+ ", volumeName=" + volumeName + ", generateDmg=" + generateDmg + ", generatePkg=" + generatePkg
204213
+ ", relocateJar=" + relocateJar + ", appId=" + appId + ", developerId=" + developerId
205-
+ ", entitlements=" + entitlements + "]";
214+
+ ", entitlements=" + entitlements + ", codesignApp=" + codesignApp + "]";
206215
}
207216

208217
/**

src/main/java/io/github/fvarrui/javapackager/packagers/MacPackager.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,12 @@ public File doCreateApp() throws Exception {
138138
Logger.info("Info.plist file created in " + infoPlistFile.getAbsolutePath());
139139

140140
// codesigns app folder
141-
if (Platform.mac.isCurrentPlatform()) {
142-
codesign(this.macConfig.getDeveloperId(), this.macConfig.getEntitlements(), this.appFile);
143-
} else {
141+
if (!Platform.mac.isCurrentPlatform()) {
144142
Logger.warn("Generated app could not be signed due to current platform is " + Platform.getCurrentPlatform());
143+
} else if (!getMacConfig().isCodesignApp()) {
144+
Logger.warn("App codesigning disabled");
145+
} else {
146+
codesign(this.macConfig.getDeveloperId(), this.macConfig.getEntitlements(), this.appFile);
145147
}
146148

147149
return appFile;

0 commit comments

Comments
 (0)