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() { ...@@ -28,9 +28,11 @@ function getRuntimeInfo() {
*/ */
function getBinaryIdentifiableName() { function getBinaryIdentifiableName() {
var v8SemVersion = process.versions.v8.split('.').slice(0, 3).join('.');
return [process.platform, '-', return [process.platform, '-',
process.arch, '-', process.arch, '-',
process.versions.v8].join(''); v8SemVersion].join('');
} }
process.runtime = getRuntimeInfo(); process.runtime = getRuntimeInfo();
......
...@@ -43,16 +43,16 @@ ...@@ -43,16 +43,16 @@
"style" "style"
], ],
"dependencies": { "dependencies": {
"chalk": "^0.5.1", "chalk": "^1.0.0",
"cross-spawn": "^0.2.6", "cross-spawn": "^0.2.6",
"gaze": "^0.5.1", "gaze": "^0.5.1",
"get-stdin": "^4.0.1", "get-stdin": "^4.0.1",
"meow": "^3.0.0", "meow": "^3.0.0",
"mkdirp": "^0.5.0", "mkdirp": "^0.5.0",
"mocha": "^2.1.0",
"nan": "^1.6.2", "nan": "^1.6.2",
"npmconf": "^2.1.1", "npmconf": "^2.1.1",
"object-assign": "^2.0.0", "object-assign": "^2.0.0",
"pangyp": "^2.1.0",
"request": "^2.53.0", "request": "^2.53.0",
"sass-graph": "^1.0.3", "sass-graph": "^1.0.3",
"shelljs": "^0.3.0" "shelljs": "^0.3.0"
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
"coveralls": "^2.11.2", "coveralls": "^2.11.2",
"jscoverage": "^0.5.9", "jscoverage": "^0.5.9",
"jshint": "^2.6.0", "jshint": "^2.6.0",
"mocha-lcov-reporter": "^0.0.1", "mocha": "^2.1.0",
"pangyp": "^2.1.0" "mocha-lcov-reporter": "^0.0.2"
} }
} }
var fs = require('fs'), var eol = require('os').EOL,
path = require('path'), fs = require('fs'),
spawn = require('child_process').spawn,
mkdir = require('mkdirp'), mkdir = require('mkdirp'),
Mocha = require('mocha'); path = require('path'),
spawn = require('child_process').spawn;
require('../lib/extensions'); require('../lib/extensions');
/** /**
...@@ -50,7 +50,7 @@ function afterBuild(options) { ...@@ -50,7 +50,7 @@ function afterBuild(options) {
*/ */
function build(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(' ')); console.log(['Building:', process.runtime.execPath].concat(arguments).join(' '));
...@@ -58,22 +58,14 @@ function build(options) { ...@@ -58,22 +58,14 @@ function build(options) {
stdio: [0, 1, 2] stdio: [0, 1, 2]
}); });
proc.on('exit', function(code) { proc.on('exit', function(errorCode) {
if (code) { if (!errorCode) {
if (code === 127) { afterBuild(options);
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(' '));
return;
}
console.error('Build failed');
return; return;
} }
afterBuild(options); console.error(errorCode === 127 ? 'node-gyp not found!' : 'Build failed');
}); });
} }
...@@ -123,28 +115,19 @@ function testBinary(options) { ...@@ -123,28 +115,19 @@ function testBinary(options) {
return build(options); return build(options);
} }
console.log('`' + process.sassBinaryName + '` exists; testing'); console.log('`' + process.sassBinaryName + '` exists; testing.');
var mocha = new Mocha({ try {
ui: 'bdd', require('../').renderSync({
timeout: 999999, data: 's: { a: ss }'
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'));
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