Skip to content

Commit

Permalink
feat(mac): Add option to enable hardened-runtime
Browse files Browse the repository at this point in the history
Close #3858
  • Loading branch information
loremattei authored and develar committed May 9, 2019
1 parent 286ef45 commit 7d5f952
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
10 changes: 10 additions & 0 deletions packages/app-builder-lib/scheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -1847,6 +1847,11 @@
"description": "Whether a dark mode is supported. If your app does have a dark mode, you can make your app follow the system-wide dark mode setting.",
"type": "boolean"
},
"hardenedRuntime": {
"default": false,
"description": "Whether your app has to be signed with hardened runtime.",
"type": "boolean"
},
"detectUpdateChannel": {
"default": true,
"description": "Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.",
Expand Down Expand Up @@ -2332,6 +2337,11 @@
"description": "Whether a dark mode is supported. If your app does have a dark mode, you can make your app follow the system-wide dark mode setting.",
"type": "boolean"
},
"hardenedRuntime": {
"default": false,
"description": "Whether your app has to be signed with hardened runtime.",
"type": "boolean"
},
"detectUpdateChannel": {
"default": true,
"description": "Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.",
Expand Down
3 changes: 2 additions & 1 deletion packages/app-builder-lib/src/macPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ export default class MacPackager extends PlatformPackager<MacConfiguration> {
keychain: keychainName || undefined,
binaries: (isMas && masOptions != null ? masOptions.binaries : macOptions.binaries) || undefined,
requirements: isMas || macOptions.requirements == null ? undefined : await this.getResource(macOptions.requirements),
"gatekeeper-assess": appleCertificatePrefixes.find(it => identity!.name.startsWith(it)) != null
"gatekeeper-assess": appleCertificatePrefixes.find(it => identity!.name.startsWith(it)) != null,
"hardened-runtime": macOptions.hardenedRuntime,
}

await this.adjustSignOptions(signOptions, masOptions)
Expand Down
6 changes: 6 additions & 0 deletions packages/app-builder-lib/src/options/macOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ export interface MacConfiguration extends PlatformSpecificBuildOptions {
* Extra files to put in archive. Not applicable for `tar.*`.
*/
readonly extraDistFiles?: Array<string> | string | null

/**
* Whether your app has to be signed with hardened runtime.
* @default false
*/
readonly hardenedRuntime?: boolean
}

export interface DmgOptions extends TargetSpecificOptions {
Expand Down
4 changes: 2 additions & 2 deletions test/out/__snapshots__/BuildTest.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@ Object {
"size": 1069,
},
"index.js": Object {
"size": 4770,
"size": 4826,
},
"package.json": Object {
"size": 524,
Expand Down Expand Up @@ -1231,7 +1231,7 @@ Object {
"size": 1079,
},
"rc.js": Object {
"size": 2339,
"size": 2477,
},
"util.js": Object {
"size": 3034,
Expand Down

0 comments on commit 7d5f952

Please sign in to comment.