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-22 02:36:49 +00:00
|
|
|
fs = require( 'fs' ),
|
|
|
|
$ = require( 'gulp-load-plugins' )( { 'pattern': '*' } );
|
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',
|
2014-08-15 22:04:51 +00:00
|
|
|
}
|
|
|
|
|
2014-08-23 07:05:22 +00:00
|
|
|
function stylus( src, dest ) {
|
2014-08-16 16:43:48 +00:00
|
|
|
|
2014-08-23 07:05:22 +00:00
|
|
|
gulp.src( src )
|
2014-08-21 17:20:06 +00:00
|
|
|
.pipe( $.stylus( { use: [ $.nib() ] } ) )
|
2014-08-23 07:05:22 +00:00
|
|
|
.pipe( gulp.dest( dest ) );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
gulp.task( 'css', function() {
|
|
|
|
|
|
|
|
stylus( paths.css, '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-23 07:05:22 +00:00
|
|
|
gulp.task( 'docs', function() {
|
2014-08-22 02:36:49 +00:00
|
|
|
|
2014-08-23 07:05:22 +00:00
|
|
|
stylus( 'docs/*.styl', 'docs' );
|
2014-08-22 02:36:49 +00:00
|
|
|
|
|
|
|
var content = {
|
|
|
|
readme: $.marked( fs.readFileSync( 'README.md', 'utf8' ) )
|
|
|
|
}
|
|
|
|
|
|
|
|
gulp.src( 'docs/template.html' )
|
|
|
|
.pipe( $.plates( content ) )
|
|
|
|
.pipe( $.rename( 'index.html' ) )
|
|
|
|
.pipe( gulp.dest( './' ) );
|
2014-08-21 17:20:06 +00:00
|
|
|
|
|
|
|
} );
|
|
|
|
|
|
|
|
gulp.task( 'test', function() {
|
2014-08-16 16:43:48 +00:00
|
|
|
|
|
|
|
} );
|
|
|
|
|
2014-08-23 07:05:22 +00:00
|
|
|
gulp.task( 'build', [ 'css', 'vulcanize', 'test', 'docs' ] );
|
2014-08-21 17:20:06 +00:00
|
|
|
|
|
|
|
gulp.task( 'default', function() {
|
|
|
|
|
2014-08-23 07:05:22 +00:00
|
|
|
gulp.task( 'build' );
|
|
|
|
|
2014-08-21 17:20:06 +00:00
|
|
|
gulp.watch( [ paths.css ], [ 'css', 'vulcanize' ] );
|
|
|
|
gulp.watch( [ paths.js, paths.main, paths.html ], [ 'vulcanize', 'test' ] );
|
2014-08-23 07:05:22 +00:00
|
|
|
gulp.watch( [ 'README.md', 'docs/*' ], [ 'docs' ] );
|
2014-08-21 17:20:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
} );
|
|
|
|
|
|
|
|
|
2014-08-16 16:43:48 +00:00
|
|
|
|