1 module.exports = function(grunt) {
3 // Project configuration.
5 pkg: grunt.file.readJSON('package.json'),
7 // copy the files we care about from bower-fetched dependencies
8 // into our build directory
18 'bower_components/angular/angular.min.js',
19 'bower_components/angular/angular.min.js.map',
20 'bower_components/angular-route/angular-route.min.js',
21 'bower_components/angular-route/angular-route.min.js.map',
22 'bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js',
23 'bower_components/angular-hotkeys/build/hotkeys.min.js',
35 'bower_components/angular-hotkeys/build/hotkeys.min.css',
36 'bower_components/bootstrap/dist/css/bootstrap.min.css'
43 dest : 'build/fonts/',
48 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot',
49 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg',
50 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf',
51 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff'
57 // combine our CSS deps
58 // note: minification also supported, but not required (yet).
62 'build/css/evergreen-staff-client-deps.<%= pkg.version %>.min.css' : [
63 'build/css/hotkeys.min.css',
64 'build/css/bootstrap.min.css'
70 // concatenation + minification
73 banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
77 // These are concatenated in order in the final build file.
78 // The order is important.
79 'build/js/angular.min.js',
80 'build/js/angular-route.min.js',
81 'build/js/ui-bootstrap-tpls.min.js',
82 'build/js/hotkeys.min.js',
83 // NOTE: OpenSRF must be installed
84 '/openils/lib/javascript/JSON_v1.js',
85 '/openils/lib/javascript/opensrf.js',
86 '/openils/lib/javascript/opensrf_ws.js',
88 'services/strings.js',
96 'services/startup.js',
99 'services/coresvc.js',
100 'services/navbar.js',
101 'services/statusbar.js',
104 dest: 'build/js/<%= pkg.name %>.<%= pkg.version %>.min.js'
108 // bare concat operation; useful for testing concat w/o minification
109 // to more easily detect if concat order is incorrect
118 // Generate test/data/IDL2js.js for unit tests.
119 // note: the output of this script is *not* part of the final build.
121 command : 'cd test/data && perl idl2js.pl',
124 // Remove the unit test IDL2js.js file. We don't need it after testing
126 command : 'rm test/data/IDL2js.js',
130 // unit tests configuration
133 configFile: 'test/karma.conf.js',
134 //background: true // for now, visually babysit unit tests
139 // tell concat about our uglify build options (instead of repeating them)
140 config.concat.build = config.uglify.build;
142 // apply our configuration
143 grunt.initConfig(config);
146 grunt.loadNpmTasks('grunt-contrib-uglify');
147 grunt.loadNpmTasks('grunt-contrib-concat');
148 grunt.loadNpmTasks('grunt-contrib-copy');
149 grunt.loadNpmTasks('grunt-contrib-cssmin');
150 grunt.loadNpmTasks('grunt-karma');
151 grunt.loadNpmTasks('grunt-exec');
153 // note: "grunt concat" is not requried
154 grunt.registerTask('build', ['copy', 'cssmin', 'uglify']);
156 // test only, no minification
157 grunt.registerTask('test', ['copy', 'exec:idl2js', 'karma:unit', 'exec:rmidl2js']);
159 // note: "grunt concat" is not requried
160 grunt.registerTask('all', ['test', 'cssmin', 'uglify']);
164 // vim: ts=2:sw=2:softtabstop=2