Fix a couple of gulpfile issues, don't create some links for now

This commit is contained in:
murgatroid99 2017-10-13 13:22:39 -07:00
parent 27d2f1e8cb
commit 1f976921ed
7 changed files with 51 additions and 35 deletions

View File

@ -21,6 +21,8 @@ const help = require('gulp-help');
// gulp-help monkeypatches tasks to have an additional description parameter
const gulp = help(_gulp);
var runSequence = require('run-sequence');
require('./packages/grpc-health-check/gulpfile');
require('./packages/grpc-js/gulpfile');
require('./packages/grpc-js-core/gulpfile');
@ -32,34 +34,44 @@ require('./test/gulpfile');
const root = __dirname;
gulp.task('install.all', 'Install dependencies for all subdirectory packages',
['js.core.install', 'native.core.install', 'health-check.install', 'internal.test.install',
'js.install', 'native.install']);
['js.core.install', 'native.core.install', 'health-check.install', 'internal.test.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', 'internal.test.install',
'js.install', 'native.install']);
['js.core.install', 'native.core.install.windows', 'health-check.install', 'internal.test.install']);
gulp.task('lint', 'Emit linting errors in source and test files',
['js.core.lint', 'native.core.lint']);
gulp.task('build', 'Build packages', ['js.core.compile', 'native.core.build']);
gulp.task('link.create', 'Initialize npm links',
['native.core.link.create', 'js.core.link.create', 'surface.link.create',
'js.link.create', 'native.link.create']);
gulp.task('core.link.create', 'Initialize npm links to core packages',
['native.core.link.create', 'js.core.link.create', 'surface.link.create']);
gulp.task('link.only', 'Link packages without rebuilding',
['js.link.add', 'native.link.add', 'health-check.link.add', 'internal.test.link.add']);
gulp.task('core.link', 'Add links to core packages without rebuilding',
['js.link.add', 'native.link.add']);
gulp.task('link', 'Link together packages', ['link.create'], () => {
gulp.start('link.only');
gulp.task('surface.link.create', 'Create links to surface packages',
['js.link.create', 'native.link.create']);
gulp.task('surface.link', 'Link to surface packages',
['health-check.link.add', 'internal.test.link.add']);
gulp.task('link', 'Link together packages', (callback) => {
/* Currently, the target 'surface.link.create' doesn't work properly, and it
* is also not needed for the existing tests. The comment indicates where it
* belongs in the sequence. See npm/npm#18835 for the primary problem with it.
* This also means that 'core.link' is not needed, and the item
* 'native.core.link.create' should actually be 'core.link.create'
*/
runSequence('native.core.link.create', /* 'core.link', 'surface.link.create', */ 'surface.link',
callback);
});
gulp.task('setup', 'One-time setup for a clean repository', ['install.all'], () => {
gulp.start('link');
gulp.task('setup', 'One-time setup for a clean repository', (callback) => {
runSequence('install.all', 'link', callback);
});
gulp.task('setup.windows', 'One-time setup for a clean repository for MS Windows', ['install.all.windows'], () => {
gulp.start('link');
gulp.task('setup.windows', 'One-time setup for a clean repository for MS Windows', (callback) => {
runSequence('install.all.windows', 'link', callback);
});
gulp.task('clean', 'Delete generated files', ['js.core.clean', 'native.core.clean']);
@ -71,15 +83,15 @@ gulp.task('clean.all', 'Delete all files created by tasks',
gulp.task('native.test.only', 'Run tests of native code without rebuilding anything',
['native.core.test', 'internal.test.test', 'health-check.test']);
gulp.task('native.test', 'Run tests of native code', ['build'], () => {
gulp.start('native.test.only');
gulp.task('native.test', 'Run tests of native code', (callback) => {
runSequence('build', 'native.test.only', callback);
});
gulp.task('test.only', 'Run tests without rebuilding anything',
['js.core.test', 'native.test.only']);
gulp.task('test', 'Run all tests', ['build'], () => {
gulp.start('test.only');
gulp.task('test', 'Run all tests', (callback) => {
runSequence('build', 'test.only', callback);
});
gulp.task('doc.gen', 'Generate documentation', ['native.core.doc.gen']);

View File

@ -35,5 +35,9 @@
{
"name": "Google Inc."
}
]
],
"dependencies": {
"run-sequence": "^2.2.0",
"symlink": "^2.1.0"
}
}

View File

@ -15,9 +15,9 @@
}
],
"dependencies": {
"google-protobuf": "^3.0.0",
"google-protobuf": "^3.4.0",
"grpc": "^1.6.0",
"lodash": "^3.9.3"
"lodash": "^3.10.1"
},
"files": [
"LICENSE",

View File

@ -14,10 +14,10 @@
"types": "src/index.ts",
"license": "Apache-2.0",
"devDependencies": {
"@types/lodash": "^4.14.73",
"@types/mocha": "^2.2.42",
"@types/node": "^8.0.25",
"clang-format": "^1.0.53",
"@types/lodash": "^4.14.77",
"@types/mocha": "^2.2.43",
"@types/node": "^8.0.34",
"clang-format": "^1.0.55",
"google-ts-style": "^0.2.0"
},
"contributors": [

View File

@ -29,15 +29,15 @@
],
"dependencies": {
"arguejs": "^0.2.3",
"lodash": "^4.15.0",
"nan": "^2.0.0",
"node-pre-gyp": "^0.6.35",
"protobufjs": "^5.0.0"
"lodash": "^4.17.4",
"nan": "^2.7.0",
"node-pre-gyp": "^0.6.38",
"protobufjs": "^5.0.2"
},
"devDependencies": {
"electron-mocha": "^3.1.1",
"google-protobuf": "^3.0.0",
"istanbul": "^0.4.4"
"electron-mocha": "^3.5.0",
"google-protobuf": "^3.4.0",
"istanbul": "^0.4.5"
},
"engines": {
"node": ">=4"

View File

@ -28,7 +28,7 @@ const del = require('del');
const nativeDir = __dirname;
gulp.task('native.clean.links', 'Delete npm links', () => {
return del([path.resolve(nativeDir, 'node_modules/@grpc/native-core'),
return del([path.resolve(nativeDir, 'node_modules/grpc'),
path.resolve(nativeDir, 'node_modules/@grpc/surface')]);
});

View File

@ -17,6 +17,6 @@
},
"dependencies": {
"lodash": "^4.17.4",
"protobufjs": "~6.8.0"
"protobufjs": "^6.8.0"
}
}