mirror of https://github.com/grpc/grpc-node.git
				
				
				
			Tying it all together.
This commit is contained in:
		
							parent
							
								
									6b446c3164
								
							
						
					
					
						commit
						311010712f
					
				
							
								
								
									
										10
									
								
								gulpfile.js
								
								
								
								
							
							
						
						
									
										10
									
								
								gulpfile.js
								
								
								
								
							|  | @ -14,6 +14,9 @@ const root = __dirname; | ||||||
| gulp.task('install.all', 'Install dependencies for all subdirectory packages', | gulp.task('install.all', 'Install dependencies for all subdirectory packages', | ||||||
|           ['js.core.install', 'native.core.install', 'health-check.install']); |           ['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', | gulp.task('lint', 'Emit linting errors in source and test files', | ||||||
|           ['js.core.lint', 'native.core.lint']); |           ['js.core.lint', 'native.core.lint']); | ||||||
| 
 | 
 | ||||||
|  | @ -30,7 +33,12 @@ gulp.task('link', 'Link local packages together after building', | ||||||
|             gulp.start('link.only'); |             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']); | gulp.task('clean', 'Delete generated files', ['js.core.clean', 'native.core.clean']); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -30,7 +30,16 @@ gulp.task('native.core.install', 'Install native core dependencies', () => { | ||||||
|                {cwd: nativeCoreDir, stdio: 'inherit'}); |                {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'}); |   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', () => { | 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'], () => { | gulp.task('native.core.test', 'Run all tests', ['native.core.build'], () => { | ||||||
|  |  | ||||||
|  | @ -21,6 +21,7 @@ | ||||||
|   "scripts": { |   "scripts": { | ||||||
|     "lint": "node ./node_modules/jshint/bin/jshint src test index.js --exclude-path=.jshintignore", |     "lint": "node ./node_modules/jshint/bin/jshint src test index.js --exclude-path=.jshintignore", | ||||||
|     "test": "./node_modules/.bin/mocha test && npm run-script lint", |     "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", |     "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", |     "gen_docs": "./node_modules/.bin/jsdoc -c jsdoc_conf.json", | ||||||
|     "coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha test", |     "coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha test", | ||||||
|  |  | ||||||
|  | @ -25,14 +25,22 @@ nvm version | ||||||
| 
 | 
 | ||||||
| nvm install 8.5.0 | nvm install 8.5.0 | ||||||
| nvm use 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 %%v in (4.8.4 6.11.3 7.9.0 8.5.0) do ( | ||||||
| for /f "delims=v" %%v in ('node --version') do ( |   nvm install %%v | ||||||
|   rmdir "%USERPROFILE%\.node-gyp\%%v\include\node\openssl" /S /Q |   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 | if %errorlevel% neq 0 exit /b %errorlevel% | ||||||
| call npm install --build-from-source %* | 
 | ||||||
|  | goto :EOF | ||||||
|  | 
 | ||||||
|  | :error | ||||||
|  | exit /b 1 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue