Automatic zip creating Grunt

This commit is contained in:
Mahdi Dibaiee 2014-02-21 16:45:17 +03:30
parent 2a99139364
commit 4bf38eb66a
6 changed files with 22 additions and 5 deletions

View File

@ -3,6 +3,7 @@ module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
manifest: grunt.file.readJSON('Mobile/manifest.webapp'),
uglify: {
main: {
files: [
@ -93,6 +94,23 @@ module.exports = function(grunt) {
}
},
zip: {
mobile: {
router: function(path) {
return /build\/mobile\/(.*)/.exec(path)[1];
},
src: 'build/mobile/**',
dest: 'build/sketchy-mobile-<%= manifest.version %>.zip'
},
web: {
router: function(path) {
return /build\/web\/(.*)/.exec(path)[1];
},
src: 'build/web/**',
dest: 'build/sketchy-web-<%= manifest.version %>.zip'
}
},
watch: {
js: {
files: ['Shared/js/**', 'Mobile/js/**', 'Web/js/**'],
@ -122,6 +140,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['uglify','copy', 'less'])
grunt.loadNpmTasks('grunt-zip');
grunt.registerTask('default', ['uglify','copy', 'less', 'zip'])
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -15,7 +15,8 @@
"grunt-contrib-less": "~0.9.0",
"grunt-contrib-uglify": "~0.2.2",
"grunt-contrib-copy": "~0.5.0",
"grunt-contrib-watch": "~0.5.3"
"grunt-contrib-watch": "~0.5.3",
"grunt-zip": "~0.12.0"
},
"keywords": [
"Sketch",
@ -24,7 +25,4 @@
],
"author": "Mahdi Dibaiee",
"license": "GPL V2",
"devDependencies": {
"grunt": "~0.4.2"
}
}