Skip to content
Browse files

switched Makefile to grunt for js and css build targets, fixed image …

…copy :-1:
  • Loading branch information...
1 parent ea4d50f commit 5fe3f99cc0891301755d92f8470523ea800a5a27 @johnbender committed May 11, 2012
Showing with 20 additions and 13 deletions.
  1. +8 −8 Makefile
  2. +12 −5 build/tasks/css.js
View
16 Makefile
@@ -16,16 +16,22 @@ clean:
# Create the output directory.
init:
+ @@npm install
@@mkdir -p ${OUTPUT}
# Build and minify the CSS files
css: init
- @@${ARGS} bash build/bin/css.sh
+ @@node node_modules/.bin/grunt css
# Build and minify the JS files
js: init
- @@${ARGS} bash build/bin/js.sh
+ @@node node_modules/.bin/grunt js
+# -------------------------------------------------
+#
+# For jQuery Team Use Only
+#
+# -------------------------------------------------
docs: init js css
@@${ARGS} bash build/bin/docs.sh
@@ -38,12 +44,6 @@ notify: init
zip: init css js
@@${ARGS} bash build/bin/zip.sh
-# -------------------------------------------------
-#
-# For jQuery Team Use Only
-#
-# -------------------------------------------------
-# NOTE the clean (which removes previous build output) has been removed to prevent a gap in service
build_latest: css docs js zip
@@${ARGS} bash build/bin/build_latest.sh
View
17 build/tasks/css.js
@@ -1,7 +1,8 @@
var requirejs = require( 'requirejs' ),
path = require( 'path' ),
fs = require( 'fs' ),
- sqwish = require ( 'sqwish' );
+ sqwish = require ( 'sqwish' ),
+ util = require( 'util' );
module.exports = function( grunt ) {
var config = grunt.config.get( 'global' ),
@@ -95,13 +96,19 @@ module.exports = function( grunt ) {
fs.unlink( require.structure.out );
// copy images directory
- var imagesPath = path.join( config.dirs.output, 'images' );
+ var imagesPath = path.join( config.dirs.output, 'images' ), fileCount = 0;
+
grunt.file.mkdir( imagesPath );
grunt.file.recurse( path.join('css', 'themes', theme, 'images'), function( full, root, sub, filename ) {
- grunt.file.write(path.join(imagesPath, filename), grunt.file.read( full ));
- });
- done();
+ fileCount++;
+ var is = fs.createReadStream( full );
+ var os = fs.createWriteStream( path.join(imagesPath, filename) );
+ util.pump(is, os, function() {
+ fileCount--;
+ if( fileCount == 0 ) { done(); }
+ });
+ });
});
});

0 comments on commit 5fe3f99

Please sign in to comment.
Something went wrong with that request. Please try again.