Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
feat(Builder): allow custom plist strings
Browse files Browse the repository at this point in the history
  • Loading branch information
evshiron committed May 6, 2017
1 parent bc5f68e commit 66f1464
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
8 changes: 6 additions & 2 deletions assets/project/package.json
Expand Up @@ -12,7 +12,7 @@
"build": {
"appId": "io.github.evshiron.nwjs-builder-phoenix.project",
"nwVersion": "lts",
"packed": false,
"packed": true,
"targets": [
"zip",
"nsis7z"
Expand All @@ -31,7 +31,11 @@
"mac": {
"displayName": "Project",
"copyright": "copyright",
"icon": "./assets/pd.icns"
"icon": "./assets/pd.icns",
"plistStrings": {
"CFBundleIdentifier": "io.github.evshiron.nwjs-builder-phoenix.project.modified",
"CFBundleDocumentTypes": []
}
},
"nsis": {
"installDirectory": "$PROGRAMFILES\\${_COMPANYNAME}\\${_APPNAME}",
Expand Down
1 change: 1 addition & 0 deletions docs/Options.md
Expand Up @@ -37,6 +37,7 @@ version | string | Version in `Info.plist`. Defaults to `${ version }`.
description | string | Description in `InfoPlist.strings`. Defaults to `${ description }`.
copyright | string | Copyright in `InfoPlist.strings`. Defaults to `""`.
icon | string | .icns icon file relative to the project root. Defaults to `undefined`.
plistStrings | { [key: string]: string } | `plist` strings. Defaults to `{}`.

## build.linux <- [LinuxConfig](../src/lib/config/LinuxConfig.ts)

Expand Down
6 changes: 6 additions & 0 deletions src/lib/Builder.ts
Expand Up @@ -220,6 +220,12 @@ export class Builder {
plist.CFBundleVersion = config.mac.version;
plist.CFBundleShortVersionString = config.mac.version;

for(const key in config.mac.plistStrings) {
if(config.mac.plistStrings.hasOwnProperty(key)) {
plist[key] = config.mac.plistStrings[key];
}
}

await this.writePlist(path, plist);

}
Expand Down
1 change: 1 addition & 0 deletions src/lib/config/MacConfig.ts
Expand Up @@ -7,6 +7,7 @@ export class MacConfig {
public description: string = '';
public copyright: string = '';
public icon: string = undefined;
public plistStrings: any = {};

constructor(options: any = {}) {

Expand Down

0 comments on commit 66f1464

Please sign in to comment.