2014-08-16 16:43:48 +00:00
|
|
|
/*
|
|
|
|
|
2014-08-21 17:20:06 +00:00
|
|
|
[ ] build without platform bundled
|
2014-08-16 16:43:48 +00:00
|
|
|
|
|
|
|
*/
|
|
|
|
|
2014-08-15 22:04:51 +00:00
|
|
|
var gulp = require( 'gulp' ),
|
2014-08-21 17:20:06 +00:00
|
|
|
$ = require( 'gulp-load-plugins' )( { 'pattern': '*' } ); // need the star for nib ...
|
2014-08-15 16:32:49 +00:00
|
|
|
|
2014-08-21 17:20:06 +00:00
|
|
|
var paths = {
|
|
|
|
main: 'gui.html',
|
|
|
|
css: 'elements/**/*.styl',
|
|
|
|
html: 'elements/**/*.html',
|
|
|
|
js: 'elements/**/*.js',
|
|
|
|
tests: 'tests/*'
|
2014-08-15 22:04:51 +00:00
|
|
|
}
|
|
|
|
|
2014-08-21 17:20:06 +00:00
|
|
|
gulp.task( 'css', function() {
|
2014-08-16 16:43:48 +00:00
|
|
|
|
2014-08-21 17:20:06 +00:00
|
|
|
gulp.src( paths.css )
|
|
|
|
.pipe( $.stylus( { use: [ $.nib() ] } ) )
|
|
|
|
.pipe( gulp.dest( 'elements' ) );
|
2014-08-15 22:04:51 +00:00
|
|
|
|
2014-08-16 16:43:48 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
gulp.task( 'vulcanize', function() {
|
|
|
|
|
2014-08-21 17:20:06 +00:00
|
|
|
gulp.src( paths.main )
|
|
|
|
.pipe( $.vulcanize( {
|
2014-08-15 22:04:51 +00:00
|
|
|
dest: 'build',
|
2014-08-21 17:20:06 +00:00
|
|
|
inline: true
|
|
|
|
// strip: true
|
2014-08-15 22:04:51 +00:00
|
|
|
} ) );
|
|
|
|
|
|
|
|
} );
|
|
|
|
|
2014-08-21 17:20:06 +00:00
|
|
|
gulp.task( 'readme', function() {
|
|
|
|
|
|
|
|
gulp.src( 'README.md' ).pipe( $.markdown() ).pipe( gulp.dest( './' ) );
|
|
|
|
|
|
|
|
} );
|
|
|
|
|
|
|
|
gulp.task( 'test', function() {
|
2014-08-16 16:43:48 +00:00
|
|
|
|
2014-08-21 17:20:06 +00:00
|
|
|
return gulp.src( 'tests/legacy.html' ).pipe( $.qunit() );
|
2014-08-16 16:43:48 +00:00
|
|
|
|
|
|
|
} );
|
|
|
|
|
2014-08-21 17:20:06 +00:00
|
|
|
gulp.task( 'build', [ 'css', 'vulcanize', 'test' ] );
|
|
|
|
|
|
|
|
gulp.task( 'default', function() {
|
|
|
|
|
|
|
|
gulp.watch( [ paths.css ], [ 'css', 'vulcanize' ] );
|
|
|
|
gulp.watch( [ paths.js, paths.main, paths.html ], [ 'vulcanize', 'test' ] );
|
|
|
|
|
|
|
|
// gulp.watch( [ paths.tests, 'test' ] ); // not working?
|
|
|
|
|
|
|
|
gulp.watch( [ 'README.md' ], [ 'readme' ] );
|
|
|
|
|
|
|
|
|
|
|
|
} );
|
|
|
|
|
|
|
|
|
2014-08-16 16:43:48 +00:00
|
|
|
|