From f1303424b1c2725ef807bdab246f2a43634f7862 Mon Sep 17 00:00:00 2001 From: Tim Lancina Date: Tue, 21 Jul 2015 13:38:30 -0500 Subject: [PATCH] don't include util/test in ionic bundle --- gulpfile.js | 93 ++++++++++++++--------------------------------------- 1 file changed, 24 insertions(+), 69 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 9915b7badc..c132f4f2c1 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -90,13 +90,21 @@ gulp.task('watch', function() { 'serve', function() { - watch(['ionic/**/*.js', 'ionic/**/*.ts', '!ionic/components/*/test/**/*'], function() { - runSequence( - 'transpile', - 'bundle.js', - 'examples' - ) - }); + watch( + [ + 'ionic/**/*.js', + 'ionic/**/*.ts', + '!ionic/components/*/test/**/*', + '!ionic/util/test/*' + ], + function() { + runSequence( + 'transpile', + 'bundle.js', + 'examples' + ) + } + ); watch('ionic/components/*/test/**/*', function() { gulp.start('examples'); @@ -121,7 +129,15 @@ gulp.task('clean', function(done) { }); gulp.task('transpile', function() { - var stream = gulp.src(['ionic/**/*.ts', 'ionic/**/*.js', '!ionic/components/*/test/**/*', '!ionic/init.js']) + var stream = gulp.src( + [ + 'ionic/**/*.ts', + 'ionic/**/*.js', + '!ionic/components/*/test/**/*', + '!ionic/init.js', + '!ionic/util/test/*' + ] + ) .pipe(cache('transpile', { optimizeMemory: true })) .pipe(tsc(tscOptions, null, tscReporter)) .on('error', function(error) { @@ -323,64 +339,3 @@ gulp.task('karma', function() { gulp.task('karma-watch', function() { return karma.start({ configFile: __dirname + '/scripts/test/karma-watch.conf.js' }) }); - -gulp.task('e2e.old', ['sass'], function() { - var indexContents = _.template( fs.readFileSync('scripts/e2e/index.template.html') )({ - buildConfig: buildConfig - }); - var testTemplate = _.template( fs.readFileSync('scripts/e2e/e2e.template.js') ) - - var platforms = [ - 'android', - 'core', - 'ios', - ]; - - gulp.src(['ionic/**/*.js']) - .pipe(gulp.dest('dist/src')); - - // Get each test folder with gulp.src - return gulp.src(buildConfig.src.e2e) - .pipe(cached('e2e')) - .pipe(rename(function(file) { - file.dirname = file.dirname.replace(path.sep + 'test' + path.sep, path.sep) - })) - .pipe(gulpif(/main.js$/, processMain())) - //.pipe(gulpif(/e2e.js$/, createPlatformTests())) - .pipe(gulp.dest(buildConfig.dist + '/e2e')); - - function processMain() { - return through2.obj(function(file, enc, next) { - var self = this; - self.push(new VinylFile({ - base: file.base, - contents: new Buffer(indexContents), - path: path.join(path.dirname(file.path), 'index.html'), - })); - next(null, file); - }) - } - - function createPlatformTests(file) { - return through2.obj(function(file, enc, next) { - var self = this - var relativePath = path.dirname(file.path.replace(/^.*?ionic(\/|\\)components(\/|\\)/, '')) - var contents = file.contents.toString() - platforms.forEach(function(platform) { - var platformContents = testTemplate({ - contents: contents, - buildConfig: buildConfig, - relativePath: relativePath, - platform: platform - }) - self.push(new VinylFile({ - base: file.base, - contents: new Buffer(platformContents), - path: file.path.replace(/e2e.js$/, platform + '.e2e.js') - })) - }) - next() - }) - } - -});