Skip to content

Commit

Permalink
feat(mac): The extra entries for Info.plist
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Feb 15, 2017
1 parent f5e735d commit 1a33a34
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/Options.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ On Windows works only if [nsis.perMachine](https://github.com/electron-userland/
| bundleVersion | <a name="MacOptions-bundleVersion"></a>The `CFBundleVersion`. Do not use it unless [you need to](see (https://github.com/electron-userland/electron-builder/issues/565#issuecomment-230678643)).
| helperBundleId | <a name="MacOptions-helperBundleId"></a>The bundle identifier to use in the application helper's plist. Defaults to `${appBundleIdentifier}.helper`.
| type | <a name="MacOptions-type"></a>Whether to sign app for development or for distribution. One of `development`, `distribution`. Defaults to `distribution`.
| extendInfo | <a name="MacOptions-extendInfo"></a>The extra entries for `Info.plist`.

<a name="MasBuildOptions"></a>
### `mas` MAS (Mac Application Store) Specific Options
Expand Down
1 change: 1 addition & 0 deletions packages/electron-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"out",
"templates",
"vendor",
"scheme.json",
"certs/root_certs.keychain"
],
"bin": {
Expand Down
5 changes: 5 additions & 0 deletions packages/electron-builder/src/options/macOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ export interface MacOptions extends PlatformSpecificBuildOptions {
Whether to sign app for development or for distribution. One of `development`, `distribution`. Defaults to `distribution`.
*/
readonly type?: "distribution" | "development" | null

/**
The extra entries for `Info.plist`.
*/
readonly extendInfo?: any
}

/**
Expand Down
5 changes: 5 additions & 0 deletions packages/electron-builder/src/packager/mac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ export async function createApp(packager: PlatformPackager<any>, appOutDir: stri
Object.assign(appPlist, parsePlist(fileContents[4]))
}

const macOptions = buildMetadata.mac
if (macOptions != null && macOptions.extendInfo != null) {
Object.assign(appPlist, macOptions.extendInfo)
}

const appBundleIdentifier = filterCFBundleIdentifier(appInfo.id)

const oldHelperBundleId = (<any>buildMetadata)["helper-bundle-id"]
Expand Down
1 change: 1 addition & 0 deletions test/out/mac/__snapshots__/macPackagerTest.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Object {
"DTXcodeBuild": "8C1002",
"LSApplicationCategoryType": "your.app.category.type",
"LSMinimumSystemVersion": "10.9.0",
"LSUIElement": true,
"NSHighResolutionCapable": true,
"NSMainNibFile": "MainMenu",
"NSPrincipalClass": "AtomApplication",
Expand Down
3 changes: 3 additions & 0 deletions test/src/mac/macPackagerTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ test.ifMac("one-package", app({
url: "https://develar.s3.amazonaws.com/test/${os}/${arch}",
},
mac: {
extendInfo: {
LSUIElement: true,
},
fileAssociations: [
{
ext: "foo",
Expand Down

0 comments on commit 1a33a34

Please sign in to comment.