forked from Automattic/wp-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
builder.js
66 lines (61 loc) · 1.56 KB
/
builder.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
* External Dependencies
*/
var packager = require( 'electron-packager' );
var fs = require( 'fs' );
var path = require( 'path' );
/**
* Internal dependencies
*/
var builder = require( './resource/lib/tools' );
var config = require( './resource/lib/config' );
var pkg = require( './package.json' );
/**
* Module variables
*/
var electronVersion = pkg.devDependencies['electron-prebuilt'].replace( '^', '' );
var key;
var opts = {
dir: './build',
name: config.name,
author: config.author,
platform: builder.getPlatform( process.argv ),
arch: builder.getArch( process.argv ),
version: electronVersion,
appVersion: config.version,
appSign: 'Developer ID Application: ' + config.author,
out: './release',
icon: builder.getIconFile( process.argv ),
'app-bundle-id': config.bundleId,
'helper-bundle-id': config.bundleId,
'app-category-type': 'public.app-category.social-networking',
'app-version': config.version,
'build-version': config.version,
overwrite: true,
ignore: [ 'desktop-test.js' ],
asar: false,
prune: true,
sign: false,
'version-string': {
CompanyName: config.author,
LegalCopyright: config.copyright,
ProductName: config.name,
InternalName: config.name,
FileDescription: config.name,
OriginalFilename: config.name,
FileVersion: config.version,
ProductVersion: config.version
}
};
builder.beforeBuild( __dirname, opts, function( error ) {
if ( error ) {
throw error;
}
packager( opts, function( err ) {
if ( err ) {
console.log( error );
} else {
builder.cleanUp( path.join( __dirname, 'release' ), opts );
}
} );
} )