nwjs-builder-phoenix
Version:
A possible solution to build and package a ready for distribution NW.js app for Windows, macOS and Linux.
62 lines • 2.9 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var path_1 = require("path");
var WinConfig_1 = require("./WinConfig");
var MacConfig_1 = require("./MacConfig");
var LinuxConfig_1 = require("./LinuxConfig");
var NsisConfig_1 = require("./NsisConfig");
var BuildConfig = (function () {
function BuildConfig(pkg) {
if (pkg === void 0) { pkg = {}; }
var _this = this;
this.nwVersion = 'lts';
this.nwFlavor = 'normal';
this.output = './dist/';
this.packed = false;
this.targets = [];
this.files = ['**/*'];
this.excludes = [];
this.win = new WinConfig_1.WinConfig();
this.mac = new MacConfig_1.MacConfig();
this.linux = new LinuxConfig_1.LinuxConfig();
this.nsis = new NsisConfig_1.NsisConfig();
this.appId = undefined;
this.ffmpegIntegration = false;
this.strippedProperties = ['scripts', 'devDependencies', 'build'];
var options = pkg.build ? pkg.build : {};
Object.keys(this).map(function (key) {
if (options[key] !== undefined) {
switch (key) {
case 'win':
_this.win = new WinConfig_1.WinConfig(options.win);
break;
case 'mac':
_this.mac = new MacConfig_1.MacConfig(options.mac);
break;
case 'linux':
_this.linux = new LinuxConfig_1.LinuxConfig(options.linux);
break;
case 'nsis':
_this.nsis = new NsisConfig_1.NsisConfig(options.nsis);
break;
default:
_this[key] = options[key];
break;
}
}
});
this.output = path_1.normalize(this.output);
this.appId = "io.github.nwjs." + pkg.name;
this.win.versionStrings.ProductName = this.win.versionStrings.ProductName ? this.win.versionStrings.ProductName : pkg.name;
this.win.versionStrings.FileDescription = this.win.versionStrings.FileDescription ? this.win.versionStrings.FileDescription : pkg.description;
this.win.productVersion = this.win.productVersion ? this.win.productVersion : pkg.version;
this.win.fileVersion = this.win.fileVersion ? this.win.fileVersion : this.win.productVersion;
this.mac.name = this.mac.name ? this.mac.name : pkg.name;
this.mac.displayName = this.mac.displayName ? this.mac.displayName : this.mac.name;
this.mac.version = this.mac.version ? this.mac.version : pkg.version;
this.mac.description = this.mac.description ? this.mac.description : pkg.description;
}
return BuildConfig;
}());
exports.BuildConfig = BuildConfig;
//# sourceMappingURL=BuildConfig.js.map