Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 893b5b9

Browse files
wardbellFoxandxss
authored andcommitted
chore(styles): instrument gulpfile to reveal file copy race condition
See PR comment: #1897 (comment) DO NOT KEEP THIS COMMIT
1 parent 5cc95ae commit 893b5b9

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

gulpfile.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ var _excludeMatchers = _excludePatterns.map(function(excludePattern){
8787
});
8888

8989
var _exampleBoilerplateFiles = [
90-
'a2docs.css',
9190
'.editorconfig',
91+
'a2docs.css',
9292
'karma.conf.js',
9393
'karma-test-shim.js',
9494
'package.json',
@@ -100,7 +100,7 @@ var _exampleBoilerplateFiles = [
100100
'wallaby.js'
101101
];
102102

103-
var _exampleDartWebBoilerPlateFiles = ['styles.css'];
103+
var _exampleDartWebBoilerPlateFiles = ['a2docs.css', 'styles.css'];
104104

105105
var _exampleProtractorBoilerplateFiles = [
106106
'tsconfig.json'
@@ -121,7 +121,7 @@ var _styleLessName = 'a2docs.less';
121121
var lang, langs, buildDartApiDocs = false;
122122
function configLangs(langOption) {
123123
const fullSiteBuildTasks = ['build-compile', 'check-serve', 'check-deploy'];
124-
const buildAllDocs = argv['_'] &&
124+
const buildAllDocs = argv['_'] &&
125125
fullSiteBuildTasks.some((task) => argv['_'].indexOf(task) >= 0);
126126
const langDefault = buildAllDocs ? 'all' : '(ts|js)';
127127
lang = (langOption || langDefault).toLowerCase();
@@ -442,18 +442,18 @@ gulp.task('add-example-boilerplate', function() {
442442
// copies boilerplate files to locations
443443
// where an example app is found
444444
gulp.task('_copy-example-boilerplate', function () {
445-
if (!argv.fast) buildStyles(copyExampleBoilerplate);
445+
if (!argv.fast) return buildStyles(copyExampleBoilerplate);
446446
});
447447

448448
//Builds Angular 2 Docs CSS file from Bootstrap npm LESS source
449449
//and copies the result to the _examples folder to be included as
450450
//part of the example boilerplate.
451451
function buildStyles(cb){
452-
gulp.src(path.join(STYLES_SOURCE_PATH, _styleLessName))
452+
return gulp.src(path.join(STYLES_SOURCE_PATH, _styleLessName))
453453
.pipe(less())
454454
.pipe(gulp.dest(EXAMPLES_PATH)).on('finish', function(){
455455
return cb();
456-
});
456+
});
457457
}
458458

459459
// copies boilerplate files to locations
@@ -473,8 +473,10 @@ function copyExampleBoilerplate() {
473473

474474
// Make boilerplate files read-only to avoid that they be edited by mistake.
475475
var destFileMode = '444';
476+
gutil.log('*** example files copied')
476477
return copyFiles(sourceFiles, examplePaths, destFileMode)
477478
.then(function() {
479+
gutil.log('*** example files copied')
478480
return copyFiles(dartWebSourceFiles, dartExampleWebPaths, destFileMode);
479481
})
480482
// copy certain files from _examples/_protractor dir to each subdir that contains an e2e-spec file.
@@ -596,6 +598,7 @@ gulp.task('build-dart-api-docs', ['_shred-api-examples', 'dartdoc'], function()
596598
});
597599

598600
gulp.task('build-plunkers', ['_copy-example-boilerplate'], function() {
601+
gutil.log('**** Building Plunkers')
599602
return plunkerBuilder.buildPlunkers(EXAMPLES_PATH, LIVE_EXAMPLES_PATH, { errFn: gutil.log });
600603
});
601604

0 commit comments

Comments
 (0)