Changeset 463 for Dev/trunk/Gruntfile.js


Ignore:
Timestamp:
06/23/13 13:59:15 (12 years ago)
Author:
hendrikvanantwerpen
Message:

Working towards Heroku deployment, restructuring for that and to allow coffee builds.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • Dev/trunk/Gruntfile.js

    r462 r463  
    66 * can be distributed.
    77 */
    8 var fs = require('fs');
    9 var path = require('path');
    108
    119module.exports = function(grunt) {
    1210
    13     var buildDir = '../build/';
    14     var binDir = buildDir+'bin/';
    15     var distDir = '../dist/';
     11    var buildDir = 'build/';
     12    var srcDir   = 'src/';
    1613
    1714    grunt.initConfig({
    1815        clean: {
    1916            build: {
    20                 options: {
    21                     force: true
    22                 },
    23                 src: [buildDir],
     17                src: [buildDir]
     18            }
     19        },
     20        coffee: {
     21            options: {
     22                bare: true
     23            },
     24            compile: {
     25                files: [{
     26                    expand: true,
     27                    cwd: srcDir,
     28                    src: ['client/qed-client/**/*.coffee', 'server/**/*.coffee'],
     29                    dest: buildDir,
     30                    ext: '.js'
     31                }]
    2432            }
    2533        },
    2634        copy: {
    27             build: {
    28                 files: [
    29                     {src: ['client/*.html'], dest: buildDir},
    30                     {src: ['server/**', '!**/node_modules/**'], dest: buildDir},
    31                     {src: ['qed-server.key', 'qed-server.pem'], dest: buildDir},
    32                 ]
    33             },
    34             dist: {
    35                 files: [
    36                     {src: ['client/bin/'], dest: binDir},
    37                     {src: ['server/**', '!**/node_modules/**'], dest: buildDir},
    38                     {src: ['qed-server.key', 'qed-server.pem'], dest: buildDir},
    39                 ]
    40             }
    41         },
    42         'curl-dir': {
    43             dist: {
    44                 src: [
    45                     'http://apache.xl-mirror.nl/couchdb/binary/win/1.3.0/setup-couchdb-1.3.0_R15B03-1.exe',
    46                     'http://nodejs.org/dist/v0.10.10/node-v0.10.10-x86.msi'
    47                 ],
    48                 dest: binDir
     35            compile: {
     36                files: [{
     37                    src: [srcDir+'**', '!**/*.coffee' ],
     38                    dest: buildDir
     39                }]
    4940            }
    5041        },
    5142        dojo: {
    5243            options: {
    53                 dojo: 'client/dojo/dojo.js',
     44                dojo: srcDir+'client/dojo/dojo.js'
    5445            },
    5546            build: {
    5647                options: {
    57                     profile: 'client/client.profile.js'
     48                    profile: srcDir+'client/client.profile.js',
     49                    releaseDir: buildDir
    5850                }
    5951            }
     
    6153        htmlhint: {
    6254            options: {
    63                 htmlhintrc: ".htmlhintrc"
     55                htmlhintrc: srcDir+".htmlhintrc"
    6456            },
    6557            compile: {
    66                 files: {
    67                     src: ['client/*.html', 'client/qed-client/**.html']
    68                 }
     58                files: [{
     59                    expand: true,
     60                    cwd: srcDir,
     61                    src: ['client/*.html', 'client/qed-client/**/*.html']
     62                }]
    6963            }
    7064        },
    7165        jshint: {
    7266            options: {
    73                 jshintrc: ".jshintrc"
     67                jshintrc: srcDir+".jshintrc"
    7468            },
    7569            compile: {
    76                 files: {
    77                     src: ['client/qed-client/**/*.js', 'server/**.js', '!**/node_modules/**']
    78                 }
     70                files: [{
     71                    expand: true,
     72                    cwd: srcDir,
     73                    src: ['client/qed-client/**/*.js', 'server/**.js']
     74                }]
    7975            }
    8076        },
     
    8581            },
    8682            compile: {
    87                 files: {
    88                     'client/qed-client/css/qed.css': 'client/qed-client/css/qed.less'
    89                 }
    90             }
    91         },
    92         zip: {
    93             dist: {
    94                 cwd: buildDir,
    95                 src: [buildDir+'**'],
    96                 dest: distDir+'qed-'+(new Date().toISOString())+'-x86.zip'
     83                files: [{
     84                    expand: true,
     85                    cwd: srcDir,
     86                    src: ['client/qed-client/css/qed.less'],
     87                    dest: buildDir,
     88                    ext: '.css'
     89                }]
    9790            }
    9891        }
     
    10093
    10194    grunt.loadNpmTasks('grunt-contrib-clean');
     95    grunt.loadNpmTasks('grunt-contrib-coffee');
    10296    grunt.loadNpmTasks('grunt-contrib-copy');
    10397    grunt.loadNpmTasks('grunt-contrib-jshint');
     
    108102    grunt.loadNpmTasks('grunt-zip');
    109103
    110     grunt.registerTask('compile', ['less:compile', 'jshint:compile', 'htmlhint:compile']);
    111     grunt.registerTask('build', ['clean:build', 'compile', 'dojo:build', 'copy:build']);
    112     grunt.registerTask('dist', ['build', 'copy:dist', 'curl-dir:dist', 'zip:dist']);
     104    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', []);
    113107    grunt.registerTask('default', ['compile']);
    114108
Note: See TracChangeset for help on using the changeset viewer.