Tying it all together.

This commit is contained in:
Nicolas Noble 2017-09-21 13:51:20 -07:00 committed by Nicolas "Pixel" Noble
parent 6b446c3164
commit 311010712f
4 changed files with 36 additions and 10 deletions

View File

@ -14,6 +14,9 @@ const root = __dirname;
gulp.task('install.all', 'Install dependencies for all subdirectory packages',
['js.core.install', 'native.core.install', 'health-check.install']);
gulp.task('install.all.windows', 'Install dependencies for all subdirectory packages for MS Windows',
['js.core.install', 'native.core.install.windows', 'health-check.install']);
gulp.task('lint', 'Emit linting errors in source and test files',
['js.core.lint', 'native.core.lint']);
@ -30,7 +33,12 @@ gulp.task('link', 'Link local packages together after building',
gulp.start('link.only');
});
gulp.task('setup', 'One-time setup for a clean repository', ['install.all', 'link']);
gulp.task('setup', 'One-time setup for a clean repository', ['install.all'], () => {
gulp.start('link');
});
gulp.task('setup.windows', 'One-time setup for a clean repository for MS Windows', ['install.all.windows'], () => {
gulp.start('link');
});
gulp.task('clean', 'Delete generated files', ['js.core.clean', 'native.core.clean']);

View File

@ -30,7 +30,16 @@ gulp.task('native.core.install', 'Install native core dependencies', () => {
{cwd: nativeCoreDir, stdio: 'inherit'});
});
gulp.task('native.core.link.create', 'Create npm link', ['native.core.install'], () => {
gulp.task('native.core.install.windows', 'Install native core dependencies for MS Windows', () => {
return execa('npm', ['install', '--build-from-source'],
{cwd: nativeCoreDir, stdio: 'inherit'}).catch(() =>
del(path.resolve(process.env.USERPROFILE, '.node-gyp', process.versions.node, 'include/node/openssl'), { force: true }).then(() =>
execa('npm', ['install', '--build-from-source'],
{cwd: nativeCoreDir, stdio: 'inherit'})
))
});
gulp.task('native.core.link.create', 'Create npm link', () => {
return execa('npm', ['link'], {cwd: nativeCoreDir, stdio: 'inherit'});
});
@ -41,7 +50,7 @@ gulp.task('native.core.lint', 'Emits linting errors', () => {
});
gulp.task('native.core.build', 'Build native package', () => {
return execa('node-pre-gyp', ['build'], {cwd: nativeCoreDir, stdio: 'inherit'});
return execa('npm', ['run', 'build'], {cwd: nativeCoreDir, stdio: 'inherit'});
});
gulp.task('native.core.test', 'Run all tests', ['native.core.build'], () => {

View File

@ -21,6 +21,7 @@
"scripts": {
"lint": "node ./node_modules/jshint/bin/jshint src test index.js --exclude-path=.jshintignore",
"test": "./node_modules/.bin/mocha test && npm run-script lint",
"build": "./node_modules/.bin/node-pre-gyp build",
"electron-build": "./node_modules/.bin/node-pre-gyp configure build --runtime=electron --disturl=https://atom.io/download/atom-shell",
"gen_docs": "./node_modules/.bin/jsdoc -c jsdoc_conf.json",
"coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha test",

View File

@ -25,14 +25,22 @@ nvm version
nvm install 8.5.0
nvm use 8.5.0
node -e console.log(process.versions)
call npm install --build-from-source
call npm install || goto :error
@rem delete the redundant openssl headers
for /f "delims=v" %%v in ('node --version') do (
rmdir "%USERPROFILE%\.node-gyp\%%v\include\node\openssl" /S /Q
for %%v in (4.8.4 6.11.3 7.9.0 8.5.0) do (
nvm install %%v
nvm use %%v
node -e "console.log(process.versions)"
call .\node_modules\.bin\gulp clean.all || goto :error
call .\node_modules\.bin\gulp setup.windows || goto :error
call .\node_modules\.bin\gulp native.test || goto :error
)
@rem rebuild, because it probably failed the first time
call npm install --build-from-source %*
if %errorlevel% neq 0 exit /b %errorlevel%
goto :EOF
:error
exit /b 1