Changeset 464 for Dev/trunk/Gruntfile.js
- Timestamp:
- 06/23/13 21:46:11 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/Gruntfile.js
r463 r464 1 /*************************************** 2 * This Gruntfile is organized with two phases, 3 * compile and build. Compile will lint HTML, 4 * JavaScript and compile LESS. The build phase 5 * creates an optimized stand-alone build that 6 * can be distributed. 1 /** Gruntfile - control build and deploy tasks 7 2 */ 8 3 9 4 module.exports = function(grunt) { 10 5 6 var srcDir = 'src/'; 11 7 var buildDir = 'build/'; 12 var srcDir = 'src/'; 8 var developmentDir = buildDir+'development/'; 9 var productionDir = buildDir+'production/'; 13 10 14 11 grunt.initConfig({ 15 12 clean: { 16 build: { 17 src: [buildDir] 13 development: { 14 src: [developmentDir] 15 }, 16 production: { 17 src: [productionDir] 18 18 } 19 19 }, … … 27 27 cwd: srcDir, 28 28 src: ['client/qed-client/**/*.coffee', 'server/**/*.coffee'], 29 dest: buildDir,29 dest: developmentDir, 30 30 ext: '.js' 31 31 }] … … 33 33 }, 34 34 copy: { 35 'client-deps': { 36 files: [{ 37 expand: true, 38 cwd: srcDir, 39 src: ['client/dojo/**', 'client/dijit/**', 'client/dojox/**', 'client/util/**'], 40 dest: developmentDir 41 }] 42 }, 43 'server-deps': { 44 files: [{ 45 expand: true, 46 cwd: srcDir, 47 src: ['node_modules/**'], 48 dest: developmentDir 49 }] 50 }, 35 51 compile: { 36 52 files: [{ 37 src: [srcDir+'**', '!**/*.coffee' ], 38 dest: buildDir 53 expand: true, 54 cwd: srcDir, 55 src: ['**', '!**/*.coffee', '!**/*.less', '!node_modules/**', '!client/dojo/**', '!client/dijit/**', '!client/dojox/**', '!client/util/**' ], 56 dest: developmentDir 57 }] 58 }, 59 deploy: { 60 files: [{ 61 expand: true, 62 cwd: developmentDir, 63 src: ['**', '!client/*/**' ], 64 dest: productionDir 39 65 }] 40 66 } 41 67 }, 42 68 dojo: { 43 options: { 44 dojo: srcDir+'client/dojo/dojo.js' 45 }, 46 build: { 69 deploy: { 47 70 options: { 48 profile: srcDir+'client/client.profile.js', 49 releaseDir: buildDir 71 dojo: developmentDir+'client/dojo/dojo.js', 72 profile: developmentDir+'client/client.profile.js', 73 releaseDir: '../../../'+productionDir 50 74 } 51 75 } … … 85 109 cwd: srcDir, 86 110 src: ['client/qed-client/css/qed.less'], 87 dest: buildDir,111 dest: developmentDir, 88 112 ext: '.css' 89 113 }] … … 97 121 grunt.loadNpmTasks('grunt-contrib-jshint'); 98 122 grunt.loadNpmTasks('grunt-contrib-less'); 99 grunt.loadNpmTasks('grunt-curl');100 123 grunt.loadNpmTasks('grunt-dojo'); 101 124 grunt.loadNpmTasks('grunt-htmlhint'); 102 grunt.loadNpmTasks('grunt-zip');103 125 126 // development tasks 127 grunt.registerTask('install-deps', ['copy:server-deps', 'copy:client-deps']); 104 128 grunt.registerTask('compile', ['less:compile', 'jshint:compile', 'htmlhint:compile', 'coffee:compile', 'copy:compile']); 105 grunt.registerTask('build', ['clean:build', 'compile', 'dojo:build']); 106 grunt.registerTask('deploy', []); 129 grunt.registerTask('build', ['clean:development', 'install-deps', 'compile']); 130 131 // production tasks 132 grunt.registerTask('deploy', ['clean:production', 'copy:deploy', 'dojo:deploy']); 133 134 // default task is quick compile 107 135 grunt.registerTask('default', ['compile']); 108 136
Note: See TracChangeset
for help on using the changeset viewer.