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/jquery/dist/jquery.min.js',
39 'bower_components/angular-hotkeys/build/hotkeys.min.css',
40 'bower_components/bootstrap/dist/css/bootstrap.min.css'
47 dest : 'build/fonts/',
52 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot',
53 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg',
54 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf',
55 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff'
61 // combine our CSS deps
62 // note: minification also supported, but not required (yet).
66 'build/css/evergreen-staff-client-deps.<%= pkg.version %>.min.css' : [
67 'build/css/hotkeys.min.css',
68 'build/css/bootstrap.min.css'
74 // concatenation + minification
77 banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
81 // These are concatenated in order in the final build file.
82 // The order is important.
83 'build/js/jquery.min.js',
84 'build/js/angular.min.js',
85 'build/js/angular-route.min.js',
86 'build/js/ui-bootstrap.min.js',
87 'build/js/ui-bootstrap-tpls.min.js',
88 'build/js/hotkeys.min.js',
89 // NOTE: OpenSRF must be installed
90 '/openils/lib/javascript/JSON_v1.js',
91 '/openils/lib/javascript/opensrf.js',
92 '/openils/lib/javascript/opensrf_ws.js',
94 'services/strings.js',
102 'services/startup.js',
105 'services/coresvc.js',
106 'services/navbar.js',
107 'services/statusbar.js',
111 dest: 'build/js/<%= pkg.name %>.<%= pkg.version %>.min.js'
115 // bare concat operation; useful for testing concat w/o minification
116 // to more easily detect if concat order is incorrect
125 // Generate test/data/IDL2js.js for unit tests.
126 // note: the output of this script is *not* part of the final build.
128 command : 'cd test/data && perl idl2js.pl',
131 // Remove the unit test IDL2js.js file. We don't need it after testing
133 command : 'rm test/data/IDL2js.js',
137 // unit tests configuration
140 configFile: 'test/karma.conf.js',
141 //background: true // for now, visually babysit unit tests
146 // tell concat about our uglify build options (instead of repeating them)
147 config.concat.build = config.uglify.build;
149 // apply our configuration
150 grunt.initConfig(config);
153 grunt.loadNpmTasks('grunt-contrib-uglify');
154 grunt.loadNpmTasks('grunt-contrib-concat');
155 grunt.loadNpmTasks('grunt-contrib-copy');
156 grunt.loadNpmTasks('grunt-contrib-cssmin');
157 grunt.loadNpmTasks('grunt-karma');
158 grunt.loadNpmTasks('grunt-exec');
160 // note: "grunt concat" is not requried
161 grunt.registerTask('build', ['copy', 'cssmin', 'uglify']);
163 // test only, no minification
164 grunt.registerTask('test', ['copy', 'exec:idl2js', 'karma:unit', 'exec:rmidl2js']);
166 // note: "grunt concat" is not requried
167 grunt.registerTask('all', ['test', 'cssmin', 'uglify']);
171 // vim: ts=2:sw=2:softtabstop=2