Commit 9bd034c2 by Adeel

Build: Misc. improvements.

* Removes tests from publishing. #683
  * Uses new strategy to validate binary after
    the download.
  * Moves mocha under dev-dependencies in
    package.json.
* Truncates the forth portion from v8 version
  as discussed in #710.
* Moves pangyp from dev to main dependencies in
  package.json.

Issue URLs: #683 and #710.
PR URL: #717.
parent b2d2b9a6
*.log
.DS_Store
.sass-cache
build
lib-cov
node_modules
vendor
test
......@@ -28,9 +28,11 @@ function getRuntimeInfo() {
*/
function getBinaryIdentifiableName() {
var v8SemVersion = process.versions.v8.split('.').slice(0, 3).join('.');
return [process.platform, '-',
process.arch, '-',
process.versions.v8].join('');
v8SemVersion].join('');
}
process.runtime = getRuntimeInfo();
......
......@@ -43,16 +43,16 @@
"style"
],
"dependencies": {
"chalk": "^0.5.1",
"chalk": "^1.0.0",
"cross-spawn": "^0.2.6",
"gaze": "^0.5.1",
"get-stdin": "^4.0.1",
"meow": "^3.0.0",
"mkdirp": "^0.5.0",
"mocha": "^2.1.0",
"nan": "^1.6.2",
"npmconf": "^2.1.1",
"object-assign": "^2.0.0",
"pangyp": "^2.1.0",
"request": "^2.53.0",
"sass-graph": "^1.0.3",
"shelljs": "^0.3.0"
......@@ -61,7 +61,7 @@
"coveralls": "^2.11.2",
"jscoverage": "^0.5.9",
"jshint": "^2.6.0",
"mocha-lcov-reporter": "^0.0.1",
"pangyp": "^2.1.0"
"mocha": "^2.1.0",
"mocha-lcov-reporter": "^0.0.2"
}
}
var fs = require('fs'),
path = require('path'),
spawn = require('child_process').spawn,
var eol = require('os').EOL,
fs = require('fs'),
mkdir = require('mkdirp'),
Mocha = require('mocha');
path = require('path'),
spawn = require('child_process').spawn;
require('../lib/extensions');
/**
......@@ -50,7 +50,7 @@ function afterBuild(options) {
*/
function build(options) {
var arguments = ['node_modules/pangyp/bin/node-gyp', 'rebuild'].concat(options.args);
var arguments = [path.join('node_modules', 'pangyp', 'bin', 'node-gyp'), 'rebuild'].concat(options.args);
console.log(['Building:', process.runtime.execPath].concat(arguments).join(' '));
......@@ -58,22 +58,14 @@ function build(options) {
stdio: [0, 1, 2]
});
proc.on('exit', function(code) {
if (code) {
if (code === 127) {
console.error([
'node-gyp not found! Please upgrade your install of npm!',
'You need at least 1.1.5 (I think) and preferably 1.1.30.'
].join(' '));
proc.on('exit', function(errorCode) {
if (!errorCode) {
afterBuild(options);
return;
}
console.error('Build failed');
return;
}
afterBuild(options);
console.error(errorCode === 127 ? 'node-gyp not found!' : 'Build failed');
});
}
......@@ -123,28 +115,19 @@ function testBinary(options) {
return build(options);
}
console.log('`' + process.sassBinaryName + '` exists; testing');
console.log('`' + process.sassBinaryName + '` exists; testing.');
var mocha = new Mocha({
ui: 'bdd',
timeout: 999999,
reporter: function() {}
});
mocha.addFile(path.resolve(__dirname, '..', 'test', 'api.js'));
mocha.grep(/should compile sass to css with file/).run(function (done) {
if (done !== 0) {
console.log([
'Problem with the binary.',
'Manual build incoming.',
'Please consider contributing the release binary to https://github.com/sass/node-sass-binaries for npm distribution.'
].join('\n'));
try {
require('../').renderSync({
data: 's: { a: ss }'
});
return build(options);
}
console.log('Binary is fine; exiting.');
} catch (e) {
console.log(['Problem with the binary.', 'Manual build incoming.'].join(eol));
console.log('Binary is fine; exiting');
});
return build(options);
}
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment