@@ -37,7 +37,7 @@ var TEMP_PATH = './_temp';
37
37
var DOCS_PATH = path . join ( PUBLIC_PATH , 'docs' ) ;
38
38
39
39
var EXAMPLES_PATH = path . join ( DOCS_PATH , '_examples' ) ;
40
- var EXAMPLES_PROTRACTOR_PATH = path . join ( EXAMPLES_PATH , '_protractor ' ) ;
40
+ var BOILERPLATE_PATH = path . join ( EXAMPLES_PATH , '_boilerplate ' ) ;
41
41
var EXAMPLES_TESTING_PATH = path . join ( EXAMPLES_PATH , 'testing/ts' ) ;
42
42
var NOT_API_DOCS_GLOB = path . join ( PUBLIC_PATH , './{docs/*/latest/!(api),!(docs)}/**/*.*' ) ;
43
43
var RESOURCES_PATH = path . join ( PUBLIC_PATH , 'resources' ) ;
@@ -92,22 +92,16 @@ var _excludeMatchers = _excludePatterns.map(function(excludePattern){
92
92
} ) ;
93
93
94
94
var _exampleBoilerplateFiles = [
95
- '.editorconfig' ,
96
95
'a2docs.css' ,
97
96
'package.json' ,
98
97
'styles.css' ,
99
98
'systemjs.config.js' ,
100
99
'tsconfig.json' ,
101
- 'tslint.json' ,
102
- 'typings.json'
100
+ 'tslint.json'
103
101
] ;
104
102
105
103
var _exampleDartWebBoilerPlateFiles = [ 'a2docs.css' , 'styles.css' ] ;
106
104
107
- var _exampleProtractorBoilerplateFiles = [
108
- 'tsconfig.json'
109
- ] ;
110
-
111
105
var _exampleUnitTestingBoilerplateFiles = [
112
106
'karma-test-shim.js' ,
113
107
'karma.conf.js'
@@ -205,18 +199,13 @@ function runE2e() {
205
199
});
206
200
*/
207
201
// Not 'fast'; do full setup
208
- gutil . log ( 'runE2e: install _protractor stuff' ) ;
209
- var spawnInfo = spawnExt ( 'npm' , [ 'install' ] , { cwd : EXAMPLES_PROTRACTOR_PATH } ) ;
202
+ gutil . log ( 'runE2e: install _examples stuff' ) ;
203
+ var spawnInfo = spawnExt ( 'npm' , [ 'install' ] , { cwd : EXAMPLES_PATH } ) ;
210
204
promise = spawnInfo . promise
211
- . then ( function ( ) {
212
- gutil . log ( 'runE2e: install _examples stuff' ) ;
213
- spawnInfo = spawnExt ( 'npm' , [ 'install' ] , { cwd : EXAMPLES_PATH } )
214
- return spawnInfo . promise ;
215
- } )
216
205
. then ( function ( ) {
217
206
buildStyles ( copyExampleBoilerplate , _ . noop ) ;
218
207
gutil . log ( 'runE2e: update webdriver' ) ;
219
- spawnInfo = spawnExt ( 'npm' , [ 'run' , 'webdriver:update' ] , { cwd : EXAMPLES_PROTRACTOR_PATH } ) ;
208
+ spawnInfo = spawnExt ( 'npm' , [ 'run' , 'webdriver:update' ] , { cwd : EXAMPLES_PATH } ) ;
220
209
return spawnInfo . promise ;
221
210
} ) ;
222
211
} ;
@@ -251,11 +240,10 @@ function findAndRunE2eTests(filter, outputFile) {
251
240
fs . writeFileSync ( outputFile , header ) ;
252
241
253
242
// create an array of combos where each
254
- // combo consists of { examplePath: ... , protractorConfigFilename: ... }
243
+ // combo consists of { examplePath: ... }
255
244
var examplePaths = [ ] ;
256
245
var e2eSpecPaths = getE2eSpecPaths ( EXAMPLES_PATH ) ;
257
246
e2eSpecPaths . forEach ( function ( specPath ) {
258
- var destConfig = path . join ( specPath , 'protractor.config.js' ) ;
259
247
// get all of the examples under each dir where a pcFilename is found
260
248
localExamplePaths = getExamplePaths ( specPath , true ) ;
261
249
// Filter by language
@@ -326,7 +314,7 @@ function runProtractor(prepPromise, appDir, appRunSpawnInfo, outputFile) {
326
314
// start protractor
327
315
328
316
var spawnInfo = spawnExt ( 'npm' , [ 'run' , 'protractor' , '--' , 'protractor.config.js' ,
329
- `--specs=${ specFilename } ` , '--params.appDir=' + appDir , '--params.outputFile=' + outputFile ] , { cwd : EXAMPLES_PROTRACTOR_PATH } ) ;
317
+ `--specs=${ specFilename } ` , '--params.appDir=' + appDir , '--params.outputFile=' + outputFile ] , { cwd : EXAMPLES_PATH } ) ;
330
318
331
319
spawnInfo . proc . stderr . on ( 'data' , function ( data ) {
332
320
transpileError = transpileError || / n p m E R R ! E x i t s t a t u s 1 0 0 / . test ( data . toString ( ) ) ;
@@ -477,7 +465,7 @@ gulp.task('_copy-example-boilerplate', function (done) {
477
465
function buildStyles ( cb , done ) {
478
466
gulp . src ( path . join ( STYLES_SOURCE_PATH , _styleLessName ) )
479
467
. pipe ( less ( ) )
480
- . pipe ( gulp . dest ( EXAMPLES_PATH ) ) . on ( 'end' , function ( ) {
468
+ . pipe ( gulp . dest ( BOILERPLATE_PATH ) ) . on ( 'end' , function ( ) {
481
469
cb ( ) . then ( function ( ) { done ( ) ; } ) ;
482
470
} ) ;
483
471
}
@@ -488,12 +476,12 @@ function buildStyles(cb, done){
488
476
function copyExampleBoilerplate ( ) {
489
477
gutil . log ( 'Copying example boilerplate files' ) ;
490
478
var sourceFiles = _exampleBoilerplateFiles . map ( function ( fn ) {
491
- return path . join ( EXAMPLES_PATH , fn ) ;
479
+ return path . join ( BOILERPLATE_PATH , fn ) ;
492
480
} ) ;
493
481
var examplePaths = excludeDartPaths ( getExamplePaths ( EXAMPLES_PATH ) ) ;
494
482
495
483
var dartWebSourceFiles = _exampleDartWebBoilerPlateFiles . map ( function ( fn ) {
496
- return path . join ( EXAMPLES_PATH , fn ) ;
484
+ return path . join ( BOILERPLATE_PATH , fn ) ;
497
485
} ) ;
498
486
var dartExampleWebPaths = getDartExampleWebPaths ( EXAMPLES_PATH ) ;
499
487
@@ -503,21 +491,17 @@ function copyExampleBoilerplate() {
503
491
. then ( function ( ) {
504
492
return copyFiles ( dartWebSourceFiles , dartExampleWebPaths , destFileMode ) ;
505
493
} )
506
- // copy certain files from _examples/_protractor dir to each subdir that contains an e2e-spec file.
507
- . then ( function ( ) {
508
- var protractorSourceFiles =
509
- _exampleProtractorBoilerplateFiles
510
- . map ( function ( name ) { return path . join ( EXAMPLES_PROTRACTOR_PATH , name ) ; } ) ;
511
- var e2eSpecPaths = getE2eSpecPaths ( EXAMPLES_PATH ) ;
512
- return copyFiles ( protractorSourceFiles , e2eSpecPaths , destFileMode ) ;
513
- } )
514
494
// copy the unit test boilerplate
515
495
. then ( function ( ) {
516
496
var unittestSourceFiles =
517
497
_exampleUnitTestingBoilerplateFiles
518
498
. map ( function ( name ) { return path . join ( EXAMPLES_TESTING_PATH , name ) ; } ) ;
519
499
var unittestPaths = getUnitTestingPaths ( EXAMPLES_PATH ) ;
520
500
return copyFiles ( unittestSourceFiles , unittestPaths , destFileMode ) ;
501
+ } )
502
+ . catch ( function ( err ) {
503
+ gutil . log ( err ) ;
504
+ throw err ;
521
505
} ) ;
522
506
}
523
507
@@ -596,11 +580,6 @@ function deleteExampleBoilerPlate() {
596
580
return deleteFiles ( _exampleBoilerplateFiles , examplePaths )
597
581
. then ( function ( ) {
598
582
return deleteFiles ( _exampleDartWebBoilerPlateFiles , dartExampleWebPaths ) ;
599
- } )
600
- . then ( function ( ) {
601
- var protractorFiles = _exampleProtractorBoilerplateFiles ;
602
- var e2eSpecPaths = getE2eSpecPaths ( EXAMPLES_PATH ) ;
603
- return deleteFiles ( protractorFiles , e2eSpecPaths ) ;
604
583
} ) ;
605
584
}
606
585
@@ -820,7 +799,7 @@ gulp.task('_harp-compile', function() {
820
799
821
800
gulp . task ( '_shred-devguide-examples' , [ '_shred-clean-devguide' , '_copy-example-boilerplate' ] , function ( ) {
822
801
// Split big shredding task into partials 2016-06-14
823
- var examplePaths = globby . sync ( EXAMPLES_PATH + '/*/' , { ignore : [ '/node_modules' , 'typings/' , '_protractor/' ] } ) ;
802
+ var examplePaths = globby . sync ( EXAMPLES_PATH + '/*/' , { ignore : [ '/node_modules' , 'typings/' ] } ) ;
824
803
var promise = Promise . resolve ( true ) ;
825
804
examplePaths . forEach ( function ( examplePath ) {
826
805
promise = promise . then ( ( ) => docShredder . shredSingleExampleDir ( _devguideShredOptions , examplePath ) ) ;
@@ -879,7 +858,6 @@ gulp.task('lint', function() {
879
858
'!./public/docs/_examples/**/ts-snippets/*.ts' ,
880
859
'!./public/docs/_examples/style-guide/ts/**/*.avoid.ts' ,
881
860
'!./public/docs/_examples/**/node_modules/**/*' ,
882
- '!./public/docs/_examples/_protractor/**/*' ,
883
861
'!./public/docs/_examples/**/typings/**/*' ,
884
862
'!./public/docs/_examples/**/typings-ng1/**/*' ,
885
863
'!./public/docs/_examples/**/build/**/*' ,
@@ -1152,7 +1130,7 @@ function getTypingsPaths(basePath) {
1152
1130
1153
1131
function getExamplePaths ( basePath , includeBase ) {
1154
1132
// includeBase defaults to false
1155
- return getPaths ( basePath , _exampleConfigFilename , includeBase )
1133
+ return getPaths ( basePath , _exampleConfigFilename , includeBase ) ;
1156
1134
}
1157
1135
1158
1136
function getDartExampleWebPaths ( basePath ) {
@@ -1183,6 +1161,8 @@ function getFilenames(basePath, filename, includeBase) {
1183
1161
// ignore (skip) the top level version.
1184
1162
includePatterns . push ( "!" + path . join ( basePath , "/" + filename ) ) ;
1185
1163
}
1164
+ // ignore (skip) the files in BOILERPLATE_PATH.
1165
+ includePatterns . push ( "!" + path . join ( BOILERPLATE_PATH , "/" + filename ) ) ;
1186
1166
var nmPattern = path . join ( basePath , "**/node_modules/**" ) ;
1187
1167
var filenames = globby . sync ( includePatterns , { ignore : [ nmPattern ] } ) ;
1188
1168
return filenames ;
0 commit comments