source: Dev/trunk/Gruntfile.js @ 465

Last change on this file since 465 was 464, checked in by hendrikvanantwerpen, 12 years ago

Working deployment to Heroku.

File size: 4.2 KB
RevLine 
[464]1/** Gruntfile - control build and deploy tasks
[453]2 */
[443]3
4module.exports = function(grunt) {
5
[464]6    var srcDir   = 'src/';
[463]7    var buildDir = 'build/';
[464]8    var developmentDir = buildDir+'development/';
9    var productionDir = buildDir+'production/';
[453]10
[443]11    grunt.initConfig({
[458]12        clean: {
[464]13            development: {
14                src: [developmentDir]
15            },
16            production: {
17                src: [productionDir]
[462]18            }
[458]19        },
[463]20        coffee: {
21            options: {
22                bare: true
[458]23            },
[463]24            compile: {
25                files: [{
26                    expand: true,
27                    cwd: srcDir,
28                    src: ['client/qed-client/**/*.coffee', 'server/**/*.coffee'],
[464]29                    dest: developmentDir,
[463]30                    ext: '.js'
31                }]
[453]32            }
33        },
[463]34        copy: {
[464]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            },
[463]51            compile: {
52                files: [{
[464]53                    expand: true,
54                    cwd: srcDir,
55                    src: ['**', '!**/*.coffee', '!**/*.less', '!node_modules/**', '!client/dojo/**', '!client/dijit/**', '!client/dojox/**', '!client/util/**' ],
56                    dest: developmentDir
[463]57                }]
[464]58            },
59            deploy: {
60                files: [{
61                    expand: true,
62                    cwd: developmentDir,
63                    src: ['**', '!client/*/**' ],
64                    dest: productionDir
65                }]
[458]66            }
67        },
[453]68        dojo: {
[464]69            deploy: {
[453]70                options: {
[464]71                    dojo: developmentDir+'client/dojo/dojo.js',
72                    profile: developmentDir+'client/client.profile.js',
73                    releaseDir: '../../../'+productionDir
[453]74                }
75            }
76        },
77        htmlhint: {
78            options: {
[463]79                htmlhintrc: srcDir+".htmlhintrc"
[453]80            },
81            compile: {
[463]82                files: [{
83                    expand: true,
84                    cwd: srcDir,
85                    src: ['client/*.html', 'client/qed-client/**/*.html']
86                }]
[443]87            }
88        },
89        jshint: {
90            options: {
[463]91                jshintrc: srcDir+".jshintrc"
[443]92            },
[453]93            compile: {
[463]94                files: [{
95                    expand: true,
96                    cwd: srcDir,
97                    src: ['client/qed-client/**/*.js', 'server/**.js']
98                }]
[443]99            }
100        },
[453]101        less: {
[443]102            options: {
[453]103                strictImports: false,
104                dumpLineNumbers: "all"
[443]105            },
[453]106            compile: {
[463]107                files: [{
108                    expand: true,
109                    cwd: srcDir,
110                    src: ['client/qed-client/css/qed.less'],
[464]111                    dest: developmentDir,
[463]112                    ext: '.css'
113                }]
[443]114            }
115        }
116    });
117
[458]118    grunt.loadNpmTasks('grunt-contrib-clean');
[463]119    grunt.loadNpmTasks('grunt-contrib-coffee');
[453]120    grunt.loadNpmTasks('grunt-contrib-copy');
121    grunt.loadNpmTasks('grunt-contrib-jshint');
[443]122    grunt.loadNpmTasks('grunt-contrib-less');
[453]123    grunt.loadNpmTasks('grunt-dojo');
[443]124    grunt.loadNpmTasks('grunt-htmlhint');
125
[464]126    // development tasks
127    grunt.registerTask('install-deps', ['copy:server-deps', 'copy:client-deps']);
[463]128    grunt.registerTask('compile', ['less:compile', 'jshint:compile', 'htmlhint:compile', 'coffee:compile', 'copy:compile']);
[464]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
[453]135    grunt.registerTask('default', ['compile']);
136
[443]137};
Note: See TracBrowser for help on using the repository browser.