Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make build tool independent #7

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,18 @@ function run (cmd, cwd, env, cb) {

function build (target, runtime, opts, cb) {
var args = [
'rebuild',
'--target=' + target
'install',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we consider npm run install instead of npm install? The latter will slow builds down (doing unnecessary work), especially with prebuildify-cross

'--target=' + target,
'--abi=' + abi.getAbi(target, runtime)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might need to add --build-from-source, if the install script is node-gyp-build.

]

if (opts.arch) {
args.push('--target_arch=' + opts.arch)
args.push('--arch=' + opts.arch)
}

if (runtime === 'electron') {
args.push('--runtime=electron')
args.push('--dist-url=https://atom.io/download/electron')
args.push('--disturl=https://atom.io/download/electron')
}

if (opts.debug) {
Expand All @@ -122,7 +123,7 @@ function build (target, runtime, opts, cb) {
args.push('--release')
}

var child = proc.spawn(os.platform() === 'win32' ? 'node-gyp.cmd' : 'node-gyp', args, {
var child = proc.spawn(os.platform() === 'win32' ? 'npm.cmd' : 'npm', args, {
cwd: opts.cwd,
env: opts.env,
stdio: opts.quiet ? 'ignore' : 'inherit'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@
"url": "https://github.com/mafintosh/prebuildify/issues"
},
"homepage": "https://github.com/mafintosh/prebuildify"
}
}