Skip to content

Commit

Permalink
fixed build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Dresser committed Sep 8, 2016
1 parent 4bca91d commit 9e46d54
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
],
"tasks": [
{
"taskName": "build-all",
"taskName": "build",
"args": [],
"isBuildCommand": true,
"isWatching": false,
Expand Down
26 changes: 19 additions & 7 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function nugetRestore(options) {
});
};

gulp.task('ext:tslint', () => {
gulp.task('ext:lint', () => {
return gulp.src([
config.paths.project.root + '/src/**/*.ts',
'!' + config.paths.project.root + '/src/views/htmlcontent/**/*',
Expand All @@ -89,14 +89,20 @@ gulp.task('ext:tslint', () => {
.pipe(tslint.report());
});

gulp.task('ext:compile-src', () => {
gulp.task('ext:compile-src', (done) => {
return gulp.src([
config.paths.project.root + '/src/**/*.ts',
config.paths.project.root + '/src/**/*.js',
config.paths.project.root + '/typings/**/*.ts',
'!' + config.paths.project.root + '/src/views/htmlcontent/**/*'])
.pipe(srcmap.init())
.pipe(ts(tsProject))
.on('error', function() {
if (process.env.BUILDMACHINE) {
done('Extension Tests failed to build. See Above.');
process.exit(1);
}
})
.pipe(srcmap.write('.', {
sourceRootfunction(file){ return file.cwd + '/src'; }
}))
Expand Down Expand Up @@ -124,12 +130,18 @@ gulp.task('ext:nuget-restore', function() {
.pipe(nugetRestore(options));
});

gulp.task('ext:compile-tests', () => {
gulp.task('ext:compile-tests', (done) => {
return gulp.src([
config.paths.project.root + '/test/**/*.ts',
config.paths.project.root + '/typings/**/*.ts'])
.pipe(srcmap.init())
.pipe(ts(tsProject))
.on('error', function() {
if (process.env.BUILDMACHINE) {
done('Extension Tests failed to build. See Above.');
process.exit(1);
}
})
.pipe(srcmap.write('.', {
           sourceRootfunction(file){ return file.cwd + '/test'; }
       }))
Expand Down Expand Up @@ -161,19 +173,19 @@ gulp.task('ext:copy', gulp.series('ext:copy-tests', 'ext:copy-packages', 'ext:co

gulp.task('ext:build', gulp.series('ext:nuget-download', 'ext:nuget-restore', 'ext:compile', 'ext:copy'));

gulp.task('ext:build', gulp.series('ext:lint', 'ext:build'));

gulp.task('clean', function (done) {
return del('out', done);
});

gulp.task('build-extension', gulp.series('ext:tslint', 'ext:build'));

gulp.task('build-all', gulp.series('clean', 'build-html', 'build-extension'));
gulp.task('build', gulp.series('clean', 'html:build', 'ext:build'));

gulp.task('install', function(){
return gulp.src(['./package.json', './src/views/htmlcontent/package.json'])
.pipe(install());
});

gulp.task('watch', function(){
return gulp.watch(config.paths.project.root + '/src/**/*', gulp.series('build-all'))
return gulp.watch(config.paths.project.root + '/src/**/*', gulp.series('build'))
});
22 changes: 14 additions & 8 deletions tasks/htmltasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var config = require('./config')
var less = require('gulp-less');
var tsProject = ts.createProject(config.paths.html.root + '/tsconfig.json');

gulp.task('html:tslint', () => {
gulp.task('html:lint', () => {
return gulp.src([
config.paths.html.root + '/src/**/*.ts'
])
Expand All @@ -17,11 +17,17 @@ gulp.task('html:tslint', () => {
.pipe(tslint.report());
});

gulp.task('html:compile-ts', () => {
gulp.task('html:compile-src', (done) => {
return gulp.src([
config.paths.html.root + '/src/**/*.ts',
config.paths.html.root + '/typings/**/*.d.ts'])
.pipe(ts(tsProject))
.on('error', function() {
if (process.env.BUILDMACHINE) {
done('Extension Tests failed to build. See Above.');
process.exit(1);
}
})
.pipe(gulp.dest(config.paths.project.root + '/out/src/views/htmlcontent/src/'))
});

Expand All @@ -31,14 +37,14 @@ gulp.task('html:compile-css', () => {
.pipe(gulp.dest(config.paths.html.root) + '/out/')
})

gulp.task('html:compile', gulp.series('html:compile-ts'))
gulp.task('html:compile', gulp.series('html:compile-src'))

gulp.task('html:copy_node_modules', () => {
gulp.task('html:copy-node-modules', () => {
return gulp.src(config.includes.html.node_modules, {base: config.paths.html.root + '/node_modules/'})
.pipe(gulp.dest(config.paths.project.root + '/out/src/views/htmlcontent/src/node_modules/'))
})

gulp.task('html:copy_src', () => {
gulp.task('html:copy-src', () => {
return gulp.src([
config.paths.html.root + '/src/**/*.html',
config.paths.html.root + '/src/**/*.ejs',
Expand All @@ -49,16 +55,16 @@ gulp.task('html:copy_src', () => {
.pipe(gulp.dest(config.paths.project.root + '/out/src/views/htmlcontent/src/'))
})

gulp.task('html:copy', gulp.series('html:copy_src','html:copy_node_modules'));
gulp.task('html:copy', gulp.series('html:copy-src','html:copy-node-modules'));

gulp.task('html:build', gulp.series('html:compile'));

gulp.task('html:clean', () => {
return del(config.paths.html.root + '/out');
});

gulp.task('build-html', gulp.series('html:tslint', 'html:build', 'html:copy'));
gulp.task('html:build', gulp.series('html:lint', 'html:build', 'html:copy'));

gulp.task('html:watch', function(){
return gulp.watch(config.paths.html.root + '/src/**/*', gulp.series('html:tslint'))
return gulp.watch(config.paths.html.root + '/src/**/*', gulp.series('html:lint'))
})
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"watch": false,
"noLib": true,
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"rootDir": "."
},
"exclude": [
Expand Down

0 comments on commit 9e46d54

Please sign in to comment.