diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..c0b9200 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,60 @@ +// Utilities +var fs = require('fs'); + +// Gulp +var gulp = require('gulp'); + +// Gulp plugins +var gutil = require('gulp-util'); +var concat = require('gulp-concat'); + +// Misc/global vars +var pkg = JSON.parse(fs.readFileSync('package.json')); +var banner = [ + '/*!', + ' * <%= name %> -<%= homepage %>', + ' * Version - <%= version %>', + ' * Licensed under the MIT license - http://opensource.org/licenses/MIT', + ' *', + ' * Copyright (c) <%= new Date().getFullYear() %> <%= author.name %>', + ' */', +].join('\n'); + +// Read the config file and return an array of the animations to be activated +var activatedAnimations = function () { + var categories = JSON.parse(fs.readFileSync('animate-config.json')), + category, files, file, + target = [ 'source/_base.css' ], + count = 0; + + for (category in categories) { + if (categories.hasOwnProperty(category)) { + files = categories[category]; + + for (file in files) { + if (files.hasOwnProperty(file) && files[file]) { + target.push('source/' + category + '/' + file + '.css'); + count += 1; + } + } + } + } + + if (!count) { + gutil.log('No animations activated.'); + } else { + gutil.log(count + (count > 1 ? ' animations' : ' animation') + ' activated.'); + } + + return target; +}; + +gulp.task('default', function() { + +}); + +gulp.task('concatCSS', function() { + return gulp.src(activatedAnimations) + .pipe(concat('animate.css')) + .pipe(gulp.dest('./')); +}); diff --git a/package.json b/package.json index 8738486..aa53f26 100644 --- a/package.json +++ b/package.json @@ -20,15 +20,13 @@ } }, "devDependencies": { - "grunt": "~0.4.1", - "grunt-autoprefixer": "~0.4.0", - "grunt-contrib-watch": "~0.5.3", - "grunt-banner": "~0.6.0", - "grunt-contrib-concat": "~0.3.0", - "grunt-contrib-cssmin": "~0.8.0", - "load-grunt-tasks": "~0.2.0" + "gulp": "^3.9.0", + "gulp-concat": "^2.6.0" }, "spm": { "main": "./animate.css" + }, + "dependencies": { + "gulp-header": "^1.7.1" } }