1313
1414const gulp = require ( 'gulp' ) ;
1515const gulpif = require ( 'gulp-if' ) ;
16- const runseq = require ( 'run-sequence' ) ;
1716const del = require ( 'del' ) ;
1817const eslint = require ( 'gulp-eslint' ) ;
1918const fs = require ( 'fs-extra' ) ;
@@ -31,8 +30,7 @@ const replace = require('gulp-replace');
3130const DIST_DIR = 'dist' ;
3231const BUNDLED_DIR = path . join ( DIST_DIR , 'bundled' ) ;
3332const COMPILED_DIR = path . join ( DIST_DIR , 'compiled' ) ;
34- const POLYMER_LEGACY = 'polymer.html' ;
35- const POLYMER_ELEMENT = 'polymer-element.html' ;
33+ const POLYMER_LEGACY = 'polymer-legacy.js' ;
3634
3735const { PolymerProject, HtmlSplitter} = require ( 'polymer-build' ) ;
3836
@@ -64,8 +62,6 @@ class BackfillStream extends Transform {
6462 }
6563}
6664
67- let CLOSURE_LINT_ONLY = false ;
68-
6965let firstImportFinder = dom5 . predicates . AND (
7066 dom5 . predicates . hasTagName ( 'link' ) , dom5 . predicates . hasAttrValue ( 'rel' , 'import' )
7167) ;
@@ -129,8 +125,7 @@ gulp.task('generate-typescript', async () => {
129125 }
130126} ) ;
131127
132- gulp . task ( 'closure' , gulp . series ( 'generate-externs' , ( ) => {
133-
128+ const runClosureOnly = ( { lintOnly} ) => ( ) => {
134129 let entry , splitRx , joinRx , addClosureTypes ;
135130
136131 function config ( path ) {
@@ -164,7 +159,7 @@ gulp.task('closure', gulp.series('generate-externs', () => {
164159
165160 let closurePluginOptions ;
166161
167- if ( CLOSURE_LINT_ONLY ) {
162+ if ( lintOnly ) {
168163 closurePluginOptions = {
169164 logger : closureLintLogger
170165 } ;
@@ -179,7 +174,7 @@ gulp.task('closure', gulp.series('generate-externs', () => {
179174 assume_function_wrapper : true ,
180175 rewrite_polyfills : false ,
181176 new_type_inf : true ,
182- checks_only : CLOSURE_LINT_ONLY ,
177+ checks_only : lintOnly ,
183178 polymer_version : 2 ,
184179 externs : [
185180 'bower_components/shadycss/externs/shadycss-externs.js' ,
@@ -219,12 +214,15 @@ gulp.task('closure', gulp.series('generate-externs', () => {
219214 . pipe ( gulpif ( joinRx , minimalDocument ( ) ) )
220215 . pipe ( gulpif ( joinRx , size ( { title : 'closure size' , gzip : true , showTotal : false , showFiles : true } ) ) )
221216 . pipe ( gulp . dest ( COMPILED_DIR ) ) ;
222- } ) ) ;
217+ } ;
223218
224- gulp . task ( 'lint-closure' , ( done ) => {
225- CLOSURE_LINT_ONLY = true ;
226- runseq ( 'closure' , done ) ;
227- } ) ;
219+ gulp . task ( 'closure' , gulp . series ( 'generate-externs' , runClosureOnly ( {
220+ lintOnly : false
221+ } ) ) ) ;
222+
223+ gulp . task ( 'lint-closure' , runClosureOnly ( {
224+ lintOnly : true
225+ } ) ) ;
228226
229227gulp . task ( 'estimate-size' , gulp . series ( 'clean' , ( ) => {
230228
@@ -272,13 +270,11 @@ gulp.task('lint-eslint', function() {
272270 . pipe ( eslint . failAfterError ( ) ) ;
273271} ) ;
274272
275- gulp . task ( 'lint' , ( done ) => {
276- runseq ( 'lint-eslint' , 'lint-closure' , done ) ;
277- } ) ;
273+ // TODO(timvdlippe): Add back `, 'lint-closure'` once closure lint works again
274+ gulp . task ( 'lint' , gulp . series ( 'lint-eslint' ) ) ;
278275
279- gulp . task ( 'update-types' , ( done ) => {
280- runseq ( 'generate-externs' , 'generate-typescript' , done ) ;
281- } ) ;
276+ // TODO(timvdlippe): Add back `'generate-externs',` once we can generate externs again
277+ gulp . task ( 'generate-types' , gulp . series ( 'generate-typescript' ) ) ;
282278
283279gulp . task ( 'update-version' , ( ) => {
284280 return gulp . src ( 'lib/utils/boot.js' )
0 commit comments