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-file-saver/dist/angular-file-saver.bundle.min.js',
26 'bower_components/angular-location-update/angular-location-update.min.js',
27 'bower_components/angular-tree-control/angular-tree-control.js',
28 'bower_components/ngtoast/dist/ngToast.min.js',
29 'bower_components/jquery/dist/jquery.min.js',
41 'bower_components/angular-hotkeys/build/hotkeys.min.css',
42 'bower_components/bootstrap/dist/css/bootstrap.min.css',
43 'bower_components/ngtoast/dist/ngToast.min.css',
44 'bower_components/ngtoast/dist/ngToast-animations.min.css',
45 'bower_components/angular-tree-control/css/tree-control.css',
46 'bower_components/angular-tree-control/css/tree-control-attribute.css',
53 dest : 'build/fonts/',
58 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot',
59 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg',
60 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf',
61 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff'
67 // combine our CSS deps
68 // note: minification also supported, but not required (yet).
72 'build/css/evergreen-staff-client-deps.<%= pkg.version %>.min.css' : [
73 'build/css/hotkeys.min.css',
74 'build/css/bootstrap.min.css',
75 'build/css/ngToast.min.css',
76 'build/css/ngToast-animations.min.css',
77 'build/css/tree-control.css',
78 'build/css/tree-control-attribute.css',
84 // concatenation + minification
87 banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
91 // These are concatenated in order in the final build file.
92 // The order is important.
93 'build/js/jquery.min.js',
94 'build/js/angular.min.js',
95 'build/js/angular-route.min.js',
96 'build/js/ui-bootstrap.min.js',
97 'build/js/ui-bootstrap-tpls.min.js',
98 'build/js/hotkeys.min.js',
99 'build/js/angular-tree-control.js',
100 'build/js/ngToast.min.js',
101 // NOTE: OpenSRF must be installed
102 '/openils/lib/javascript/JSON_v1.js',
103 '/openils/lib/javascript/opensrf.js',
104 '/openils/lib/javascript/opensrf_ws.js',
106 'services/strings.js',
114 'services/startup.js',
117 'services/coresvc.js',
118 'services/navbar.js',
119 'services/statusbar.js',
123 dest: 'build/js/<%= pkg.name %>.<%= pkg.version %>.min.js'
127 // bare concat operation; useful for testing concat w/o minification
128 // to more easily detect if concat order is incorrect
137 // Generate test/data/IDL2js.js for unit tests.
138 // note: the output of this script is *not* part of the final build.
140 command : 'cd test/data && perl idl2js.pl',
143 // Remove the unit test IDL2js.js file. We don't need it after testing
145 command : 'rm test/data/IDL2js.js',
149 // unit tests configuration
152 configFile: 'test/karma.conf.js',
153 //background: true // for now, visually babysit unit tests
158 // tell concat about our uglify build options (instead of repeating them)
159 config.concat.build = config.uglify.build;
161 // apply our configuration
162 grunt.initConfig(config);
165 grunt.loadNpmTasks('grunt-contrib-uglify');
166 grunt.loadNpmTasks('grunt-contrib-concat');
167 grunt.loadNpmTasks('grunt-contrib-copy');
168 grunt.loadNpmTasks('grunt-contrib-cssmin');
169 grunt.loadNpmTasks('grunt-karma');
170 grunt.loadNpmTasks('grunt-exec');
172 // note: "grunt concat" is not requried
173 grunt.registerTask('build', ['copy', 'cssmin', 'uglify']);
175 // test only, no minification
176 grunt.registerTask('test', ['copy', 'exec:idl2js', 'karma:unit', 'exec:rmidl2js']);
178 // note: "grunt concat" is not requried
179 grunt.registerTask('all', ['test', 'cssmin', 'uglify']);
183 // vim: ts=2:sw=2:softtabstop=2