Skip to content

Commit

Permalink
Merged PR 448189: Prepare the build script
Browse files Browse the repository at this point in the history
  • Loading branch information
jdneo committed Mar 22, 2019
1 parent ef4e04f commit 221c192
Show file tree
Hide file tree
Showing 6 changed files with 3,516 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ bin/
**/lib/
maven-wrapper.jar
cmd/repository/
cmd/workspace/
cmd/workspace/
*.tgz
4 changes: 4 additions & 0 deletions cmd/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
workspace/
gulpfile.js
*.tgz
2 changes: 2 additions & 0 deletions cmd/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
registry=https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/
always-auth=true
35 changes: 35 additions & 0 deletions cmd/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const gulp = require('gulp');
const cp = require('child_process');
const path = require('path');
const fs = require('fs');
const glob = require('glob');
const rimraf = require("rimraf");

const rootPath = path.join(__dirname, '..');

gulp.task('clean', (done) => {
rimraf.sync(path.join(__dirname, 'repository'));
rimraf.sync(path.join(__dirname, 'workspace'));
const packages = glob.sync('*.tgz');
for (const package of packages) {
fs.unlinkSync(package);
}
done();
});

gulp.task('build-indexer', (done) => {
cp.execSync(`${mvnw()} clean verify`, { cwd: rootPath, stdio: [0, 1, 2] });
gulp.src(path.join(rootPath, 'com.microsoft.java.lsif.product', 'target', 'repository', '**/*'))
.pipe(gulp.dest(path.join(rootPath, 'cmd', 'repository')));
done();
});

gulp.task('build', gulp.series('clean', 'build-indexer'));

function isWin() {
return /^win/.test(process.platform);
}

function mvnw() {
return isWin() ? 'mvnw.cmd' : './mvnw';
}
Loading

0 comments on commit 221c192

Please sign in to comment.