Skip to content

Commit

Permalink
FLUID-5120: implemented packaging of infusion.
Browse files Browse the repository at this point in the history
Will package up the concatenated and individual files into a zip package for either source or minified builds.
  • Loading branch information
jobara committed Aug 29, 2013
1 parent edc92aa commit 18112de
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
21 changes: 19 additions & 2 deletions Gruntfile.js
Expand Up @@ -5,7 +5,8 @@ module.exports = function(grunt) {
// Project package file destination.
pkg: grunt.file.readJSON("package.json"),
clean: {
build: "build"
build: "build",
products: "products"
},
copy: {
src: {
Expand Down Expand Up @@ -47,6 +48,19 @@ module.exports = function(grunt) {
src: ['./build/src/lib/**/*.js', './build/src/framework/**/*.js', './build/src/components/**/*.js'],
dest: './build/infusionAll.js'
}
},
compress: {
all: {
options: {
archive: "products/infusionAll.zip"
},
files: [{
expand: true, // Enable dynamic expansion.
cwd: './build/', // Src matches are relative to this path.
src: ['**/*'], // Actual pattern(s) to match.
dest: './infusion' // Destination path prefix in the zip package
}]
}
}
});

Expand All @@ -55,9 +69,12 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-compress');

// Custom task(s):
grunt.registerTask("source", ["clean", "copy", "concat"]);
grunt.registerTask("minify", ["clean", "copy", "uglify", "concat"]);
grunt.registerTask("default", ["minify"]);
grunt.registerTask("srczip", ["source", "compress", "clean:build"]);
grunt.registerTask("minzip", ["minify", "compress", "clean:build"]);
grunt.registerTask("default", ["minzip"]);
};
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -39,6 +39,7 @@
"grunt-contrib-uglify": "~0.2.2",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-concat": "~0.3.0"
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-compress": "~0.5.2"
}
}

0 comments on commit 18112de

Please sign in to comment.