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.min.js',
23 'bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js',
24 'bower_components/angular-hotkeys/build/hotkeys.min.js',
25 'bower_components/angular-location-update/angular-location-update.min.js',
26 'bower_components/jquery/dist/jquery.min.js',
38 'bower_components/angular-hotkeys/build/hotkeys.min.css',
39 'bower_components/bootstrap/dist/css/bootstrap.min.css'
46 dest : 'build/fonts/',
51 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot',
52 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg',
53 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf',
54 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff'
60 // combine our CSS deps
61 // note: minification also supported, but not required (yet).
65 'build/css/evergreen-staff-client-deps.<%= pkg.version %>.min.css' : [
66 'build/css/hotkeys.min.css',
67 'build/css/bootstrap.min.css'
73 // concatenation + minification
76 banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
80 // These are concatenated in order in the final build file.
81 // The order is important.
82 'build/js/jquery.min.js',
83 'build/js/angular.min.js',
84 'build/js/angular-route.min.js',
85 'build/js/ui-bootstrap.min.js',
86 'build/js/ui-bootstrap-tpls.min.js',
87 'build/js/hotkeys.min.js',
88 // NOTE: OpenSRF must be installed
89 '/openils/lib/javascript/JSON_v1.js',
90 '/openils/lib/javascript/opensrf.js',
91 '/openils/lib/javascript/opensrf_ws.js',
93 'services/strings.js',
101 'services/startup.js',
104 'services/coresvc.js',
105 'services/navbar.js',
106 'services/statusbar.js',
110 dest: 'build/js/<%= pkg.name %>.<%= pkg.version %>.min.js'
114 // bare concat operation; useful for testing concat w/o minification
115 // to more easily detect if concat order is incorrect
124 // Generate test/data/IDL2js.js for unit tests.
125 // note: the output of this script is *not* part of the final build.
127 command : 'cd test/data && perl idl2js.pl',
130 // Remove the unit test IDL2js.js file. We don't need it after testing
132 command : 'rm test/data/IDL2js.js',
136 // unit tests configuration
139 configFile: 'test/karma.conf.js',
140 //background: true // for now, visually babysit unit tests
145 // tell concat about our uglify build options (instead of repeating them)
146 config.concat.build = config.uglify.build;
148 // apply our configuration
149 grunt.initConfig(config);
152 grunt.loadNpmTasks('grunt-contrib-uglify');
153 grunt.loadNpmTasks('grunt-contrib-concat');
154 grunt.loadNpmTasks('grunt-contrib-copy');
155 grunt.loadNpmTasks('grunt-contrib-cssmin');
156 grunt.loadNpmTasks('grunt-karma');
157 grunt.loadNpmTasks('grunt-exec');
159 // note: "grunt concat" is not requried
160 grunt.registerTask('build', ['copy', 'cssmin', 'uglify']);
162 // test only, no minification
163 grunt.registerTask('test', ['copy', 'exec:idl2js', 'karma:unit', 'exec:rmidl2js']);
165 // note: "grunt concat" is not requried
166 grunt.registerTask('all', ['test', 'cssmin', 'uglify']);
170 // vim: ts=2:sw=2:softtabstop=2