Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #76 from brave/darwin-build-script
Browse files Browse the repository at this point in the history
Build Darwin with app verion
  • Loading branch information
bbondy committed Dec 24, 2015
2 parents decde3f + 7fd344d commit 4bcd2b6
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 2 deletions.
28 changes: 28 additions & 0 deletions build-darwin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
var fs = require('fs')
var exec = require('child_process').exec

// get our version
var pack = JSON.parse(fs.readFileSync('package.json', 'utf-8'))
var version = pack.version

// get the electron version
var electronPrebuiltPack = JSON.parse(fs.readFileSync('./node_modules/electron-prebuilt/package.json', 'utf-8'))
var electronVersion = electronPrebuiltPack.version

console.log('Building version ' + version + ' in Brave-darwin-x64 with Electron ' + electronVersion)

var cmds = [
'rm -rf Brave-darwin-x64',
'NODE_ENV=production ./node_modules/webpack/bin/webpack.js',
'rm -f dist/Brave.dmg',
'./node_modules/electron-packager/cli.js . Brave --overwrite --ignore="electron-download|electron-rebuild|electron-packager|electron-builder|electron-prebuilt|electron-rebuild|babel$|babel-(?!polyfill|regenerator-runtime)" --platform=darwin --arch=x64 --version=' + electronVersion + ' --icon=res/app.icns --app-version=' + version
]

var cmd = cmds.join(' && ')

console.log(cmd)

exec(cmd, function (err, stdout, stderr) {
if (err) console.error(err)
console.log(stdout)
})
28 changes: 28 additions & 0 deletions build-win64.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
var fs = require('fs')
var exec = require('child_process').exec

// get our version
var pack = JSON.parse(fs.readFileSync('package.json', 'utf-8'))
var version = pack.version

// get the electron version
var electronPrebuiltPack = JSON.parse(fs.readFileSync('./node_modules/electron-prebuilt/package.json', 'utf-8'))
var electronVersion = electronPrebuiltPack.version

console.log('Building version ' + version + ' in Brave-win32-x64 with Electron ' + electronVersion)

var cmds = [
'rm -rf Brave-win32-x64',
'NODE_ENV=production ./node_modules/webpack/bin/webpack.js',
'rm -f dist/Brave.dmg',
'./node_modules/electron-packager/cli.js . Brave --overwrite --ignore=\"electron-packager|electron-builder|electron-prebuilt|electron-rebuild|babel$|babel-(?!polyfill|regenerator-runtime)\" --platform=win32 --arch=x64 --version=' + electronVersion + ' --icon=res/app.ico --app-version=' + version
]

var cmd = cmds.join(' && ')

console.log(cmd)

exec(cmd, function (err, stdout, stderr) {
if (err) console.error(err)
console.log(stdout)
})
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"electron-rebuild": "electron-rebuild",
"lint": "standard",
"sign-darwin": "./sign-darwin.sh",
"build-darwin": "NODE_ENV=production webpack && rm -f dist/Brave.dmg && electron-packager . Brave --overwrite --ignore=\"electron-download|electron-rebuild|electron-packager|electron-builder|electron-prebuilt|electron-rebuild|babel$|babel-(?!polyfill|regenerator-runtime)\" --platform=darwin --arch=x64 --version=0.35.1 --icon=res/app.icns",
"build-win64": "set NODE_ENV=production&&webpack && rm -Rf Brave-win32-x64 && electron-packager . Brave --overwrite --ignore=\"electron-packager|electron-builder|electron-prebuilt|electron-rebuild|babel$|babel-(?!polyfill|regenerator-runtime)\" --platform=win32 --arch=x64 --version=0.35.1 --icon=res/app.ico",
"build-darwin": "node ./build-darwin.js",
"build-win64": "node ./build-win64.js",
"installer-darwin": "rm -f dist/Brave.dmg && electron-builder \"Brave-darwin-x64/Brave.app\" --platform=osx --out=\"dist\" --config=builderConfig.json --overwrite",
"installer-win64": "rm -f dist/BraveSetup.exe && electron-builder \"Brave-win32-x64\" --platform=win --out=\"dist\" --config=builderConfig.json --overwrite",
"zip-darwin": "node build-darwin-update.js",
Expand Down

0 comments on commit 4bcd2b6

Please sign in to comment.