Last active
August 29, 2015 14:16
-
-
Save insin/70de34eaaafb30823049 to your computer and use it in GitHub Desktop.
Regular Gulp 3.* implementation of http://davidwalsh.name/gulp-run-sequence - tasks can specify their own dependencies, but the secret is to *always* return the stream (or accept and call a callback function argument if the work isn't being done by a stream) so Gulp can figure out when a task has completed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gulp.task('copy-js-dir', function() { | |
return ... | |
}) | |
gulp.task('copy-php-files', function() { | |
return ... | |
}) | |
gulp.task('copy-image-files', function() { | |
return ... | |
}) | |
gulp.task('compile-stylus', function() { | |
return ... | |
}) | |
gulp.task('clone-prism', ['copy-js-dir', 'copy-php-files', 'copy-image-files', 'compile-stylus'], function() { | |
return ... | |
}) | |
gulp.task('minify-css', ['clone-prism'], function() { | |
return ... | |
}) | |
gulp.task('minify-js', ['clone-prism'], function() { | |
return ... | |
}) | |
gulp.task('replace-build-ids', ['minify-css', 'minify-js'], function() { | |
return ... | |
}) | |
gulp.task('create-backup-zip', ['replace-build-ids'], function() { | |
return ... | |
}) | |
gulp.task('move-to-wordpress', ['create-backup-zip'], function() { | |
return ... | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp') | |
var WAIT_TIME = 3000 | |
gulp.task('copy-js-dir', function(cb) { | |
setTimeout(cb, WAIT_TIME) | |
}) | |
gulp.task('copy-php-files', function(cb) { | |
setTimeout(cb, WAIT_TIME) | |
}) | |
gulp.task('copy-image-files', function(cb) { | |
setTimeout(cb, WAIT_TIME) | |
}) | |
gulp.task('compile-stylus', function(cb) { | |
setTimeout(cb, WAIT_TIME) | |
}) | |
gulp.task('clone-prism', ['copy-js-dir', 'copy-php-files', 'copy-image-files', 'compile-stylus'], function(cb) { | |
setTimeout(cb, WAIT_TIME) | |
}) | |
gulp.task('minify-css', ['clone-prism'], function(cb) { | |
setTimeout(cb, WAIT_TIME) | |
}) | |
gulp.task('minify-js', ['clone-prism'], function(cb) { | |
setTimeout(cb, WAIT_TIME) | |
}) | |
gulp.task('replace-build-ids', ['minify-css', 'minify-js'], function(cb) { | |
setTimeout(cb, WAIT_TIME) | |
}) | |
gulp.task('create-backup-zip', ['replace-build-ids'], function(cb) { | |
setTimeout(cb, WAIT_TIME) | |
}) | |
gulp.task('move-to-wordpress', ['create-backup-zip'], function(cb) { | |
setTimeout(cb, WAIT_TIME) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[15:05:23] Starting 'copy-js-dir'... | |
[15:05:23] Starting 'copy-php-files'... | |
[15:05:23] Starting 'copy-image-files'... | |
[15:05:23] Starting 'compile-stylus'... | |
[15:05:26] Finished 'copy-js-dir' after 3 s | |
[15:05:26] Finished 'copy-php-files' after 3 s | |
[15:05:26] Finished 'copy-image-files' after 3 s | |
[15:05:26] Finished 'compile-stylus' after 3 s | |
[15:05:26] Starting 'clone-prism'... | |
[15:05:29] Finished 'clone-prism' after 3 s | |
[15:05:29] Starting 'minify-css'... | |
[15:05:29] Starting 'minify-js'... | |
[15:05:32] Finished 'minify-css' after 3.02 s | |
[15:05:32] Finished 'minify-js' after 3.02 s | |
[15:05:32] Starting 'replace-build-ids'... | |
[15:05:35] Finished 'replace-build-ids' after 3 s | |
[15:05:35] Starting 'create-backup-zip'... | |
[15:05:38] Finished 'create-backup-zip' after 3.01 s | |
[15:05:38] Starting 'move-to-wordpress'... | |
[15:05:41] Finished 'move-to-wordpress' after 3 s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment