mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
remove examples task
This commit is contained in:
65
gulpfile.js
65
gulpfile.js
@ -57,24 +57,21 @@ gulp.task('clean.build', function() {
|
|||||||
runSequence(
|
runSequence(
|
||||||
'clean',
|
'clean',
|
||||||
'transpile',
|
'transpile',
|
||||||
//'bundle.deps',
|
|
||||||
'bundle.js',
|
'bundle.js',
|
||||||
'examples',
|
'e2e',
|
||||||
'sass',
|
'sass',
|
||||||
'fonts',
|
'fonts',
|
||||||
'vendor',
|
'vendor');
|
||||||
'copy-scripts');
|
|
||||||
})
|
})
|
||||||
|
|
||||||
gulp.task('build', function() {
|
gulp.task('build', function() {
|
||||||
runSequence(
|
runSequence(
|
||||||
'transpile',
|
'transpile',
|
||||||
'bundle.js',
|
'bundle.js',
|
||||||
'examples',
|
'e2e',
|
||||||
'sass',
|
'sass',
|
||||||
'fonts',
|
'fonts',
|
||||||
'vendor',
|
'vendor');
|
||||||
'copy-scripts');
|
|
||||||
})
|
})
|
||||||
|
|
||||||
gulp.task('watch', function() {
|
gulp.task('watch', function() {
|
||||||
@ -82,11 +79,10 @@ gulp.task('watch', function() {
|
|||||||
runSequence(
|
runSequence(
|
||||||
'transpile',
|
'transpile',
|
||||||
'bundle.js',
|
'bundle.js',
|
||||||
'examples',
|
'e2e',
|
||||||
'sass',
|
'sass',
|
||||||
'fonts',
|
'fonts',
|
||||||
'vendor',
|
'vendor',
|
||||||
'copy-scripts',
|
|
||||||
'serve',
|
'serve',
|
||||||
|
|
||||||
function() {
|
function() {
|
||||||
@ -101,13 +97,13 @@ gulp.task('watch', function() {
|
|||||||
runSequence(
|
runSequence(
|
||||||
'transpile',
|
'transpile',
|
||||||
'bundle.js',
|
'bundle.js',
|
||||||
'examples'
|
'e2e'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
watch('ionic/components/*/test/**/*', function() {
|
watch('ionic/components/*/test/**/*', function() {
|
||||||
gulp.start('examples');
|
gulp.start('e2e');
|
||||||
});
|
});
|
||||||
|
|
||||||
watch('ionic/**/*.scss', function() {
|
watch('ionic/**/*.scss', function() {
|
||||||
@ -170,53 +166,6 @@ gulp.task('tests', function() {
|
|||||||
.pipe(gulp.dest('dist/tests'))
|
.pipe(gulp.dest('dist/tests'))
|
||||||
})
|
})
|
||||||
|
|
||||||
gulp.task('examples', function() {
|
|
||||||
var buildTest = lazypipe()
|
|
||||||
.pipe(tsc, tscOptions, null, tscReporter)
|
|
||||||
.pipe(babel, getBabelOptions('examples'))
|
|
||||||
|
|
||||||
// Get each test folder with gulp.src
|
|
||||||
return gulp.src(['ionic/components/*/test/*/**/*', '!ionic/components/*/test/*/**/*.spec.ts'])
|
|
||||||
.pipe(cache('examples', { optimizeMemory: true }))
|
|
||||||
.pipe(gulpif(/.ts$/, buildTest()))
|
|
||||||
.on('error', function (err) {
|
|
||||||
console.log("ERROR: " + err.message);
|
|
||||||
this.emit('end');
|
|
||||||
})
|
|
||||||
.pipe(gulpif(/index.js$/, createIndexHTML())) //TSC changes .ts to .js
|
|
||||||
.pipe(rename(function(file) {
|
|
||||||
file.dirname = file.dirname.replace(path.sep + 'test' + path.sep, path.sep)
|
|
||||||
}))
|
|
||||||
.pipe(gulp.dest('dist/examples/'))
|
|
||||||
|
|
||||||
function createIndexHTML() {
|
|
||||||
var template = _.template(
|
|
||||||
fs.readFileSync('scripts/e2e/example.template.html')
|
|
||||||
)({
|
|
||||||
buildConfig: buildConfig
|
|
||||||
});
|
|
||||||
|
|
||||||
return through2.obj(function(file, enc, next) {
|
|
||||||
var self = this;
|
|
||||||
|
|
||||||
var module = path.dirname(file.path)
|
|
||||||
.replace(__dirname, '')
|
|
||||||
.replace('/ionic/components/', 'examples/')
|
|
||||||
.replace('/test/', '/') +
|
|
||||||
'/index';
|
|
||||||
|
|
||||||
var indexContents = template.replace('{{MODULE}}', module);
|
|
||||||
|
|
||||||
self.push(new VinylFile({
|
|
||||||
base: file.base,
|
|
||||||
contents: new Buffer(indexContents),
|
|
||||||
path: path.join(path.dirname(file.path), 'index.html'),
|
|
||||||
}));
|
|
||||||
next(null, file);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('copy-scripts', function(){
|
gulp.task('copy-scripts', function(){
|
||||||
gulp.src(['scripts/resources/*.js', 'config.js', 'dist/js/ionic.bundle.js',
|
gulp.src(['scripts/resources/*.js', 'config.js', 'dist/js/ionic.bundle.js',
|
||||||
'dist/vendor/web-animations-js/web-animations.min.js'])
|
'dist/vendor/web-animations-js/web-animations.min.js'])
|
||||||
|
@ -1,57 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<!-- https://www.chromium.org/developers/design-documents/chromium-graphics/how-to-get-gpu-rasterization -->
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
|
||||||
|
|
||||||
<link href="/css/ionic.css" rel="stylesheet">
|
|
||||||
|
|
||||||
<style>
|
|
||||||
/* hack to create tall scrollable areas for testing using <f></f> */
|
|
||||||
f {
|
|
||||||
display: block;
|
|
||||||
margin: 15px auto;
|
|
||||||
max-width: 150px;
|
|
||||||
height: 150px;
|
|
||||||
background: blue;
|
|
||||||
}
|
|
||||||
f:last-of-type {
|
|
||||||
background: red;
|
|
||||||
}
|
|
||||||
ion-tab:nth-of-type(2) f,
|
|
||||||
.green f {
|
|
||||||
background: green;
|
|
||||||
max-width: 250px;
|
|
||||||
height: 100px;
|
|
||||||
}
|
|
||||||
ion-tab:nth-of-type(3) f,
|
|
||||||
.yellow f {
|
|
||||||
background: yellow;
|
|
||||||
width: 100px;
|
|
||||||
height: 50px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<ion-app module="{{MODULE}}">
|
|
||||||
<ion-loading-icon></ion-loading-icon>
|
|
||||||
</ion-app>
|
|
||||||
|
|
||||||
<!-- SystemJS Loader -->
|
|
||||||
<script src="/lib/traceur-runtime.js"></script>
|
|
||||||
<script src="/lib/system.js"></script>
|
|
||||||
<script src="/lib/config.js"></script>
|
|
||||||
|
|
||||||
<!-- Angular bundle -->
|
|
||||||
<script src="/lib/angular2.dev.js"></script>
|
|
||||||
|
|
||||||
<!-- ionic bundle -->
|
|
||||||
<script src="/js/ionic.bundle.js"></script>
|
|
||||||
|
|
||||||
<!-- web animations polyfill for non-chrome browsers -->
|
|
||||||
<script src="/lib/web-animations.min.js"></script>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Reference in New Issue
Block a user