var config = {
pkg: grunt.file.readJSON('package.json'),
- // copy the JS files we care about from node-fetched dependencies
+ // copy the files we care about from bower-fetched dependencies
// into our build directory
copy: {
- main: {
+
+ js : {
files: [{
- dest: 'build/',
+ dest: 'build/js/',
flatten: true,
filter: 'isFile',
expand : true,
src: [
- 'node_modules/angular/lib/angular.min.js',
- 'node_modules/angular-route/angular-route.min.js',
- 'node_modules/angular-bootstrap/ui-bootstrap.js',
- 'node_modules/angular-hotkeys/build/hotkeys.min.js'
+ 'bower_components/angular/angular.min.js',
+ 'bower_components/angular-route/angular-route.min.js',
+ 'bower_components/angular-bootstrap/ui-bootstrap.min.js',
+ 'bower_components/angular-hotkeys/build/hotkeys.min.js',
+ ]
+ }]
+ },
+
+ css : {
+ files : [{
+ dest : 'build/css/',
+ flatten : true,
+ filter : 'isFile',
+ expand : true,
+ src : [
+ 'bower_components/angular-hotkeys/build/hotkeys.min.css',
+ 'bower_components/bootstrap/dist/css/bootstrap.min.css'
+ ]
+ }]
+ },
+
+ fonts : {
+ files : [{
+ dest : 'build/fonts/',
+ flatten : true,
+ filter : 'isFile',
+ expand : true,
+ src : [
+ 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot',
+ 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg',
+ 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf',
+ 'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff'
]
}]
}
},
- // confiure minification
+ // combine our CSS deps
+ // note: minification also supported, but not required (yet).
+ cssmin: {
+ combine: {
+ files: {
+ 'build/css/evergreen-staff-client-deps.<%= pkg.version %>.css' : [
+ 'build/css/hotkeys.min.css',
+ 'build/css/bootstrap.min.css'
+ ]
+ }
+ }
+ },
+
+ // concatenation + minification
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
src: [
// These are concatenated in order in the final build file.
// The order is important.
- 'build/angular.min.js',
- 'build/angular-route.min.js',
- 'build/ui-bootstrap.js',
- 'build/hotkeys.min.js',
+ 'build/js/angular.min.js',
+ 'build/js/angular-route.min.js',
+ 'build/js/ui-bootstrap.min.js',
+ 'build/js/hotkeys.min.js',
// NOTE: OpenSRF must be installed
'/openils/lib/javascript/JSON_v1.js',
'/openils/lib/javascript/opensrf.js',
'services/startup.js',
'services/hatch.js',
'services/coresvc.js',
+ 'services/navbar.js',
'services/statusbar.js',
'services/ui.js',
- 'navbar.js'
],
- dest: 'build/<%= pkg.name %>.<%= pkg.version %>.min.js'
+ dest: 'build/js/<%= pkg.name %>.<%= pkg.version %>.min.js'
}
},
// bare concat operation; useful for testing concat w/o minification
- // to more easily detect when concat order is incorrect
+ // to more easily detect if concat order is incorrect
concat: {
options: {
separator: ';',
}
},
+ // generate test/data/IDL2js.js
+ exec : {
+ idl2js : {
+ command : 'cd test/data && perl idl2js.pl',
+ stdout : true
+ }
+ },
+
// unit tests configuration
karma : {
unit: {
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
+ grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-karma');
+ grunt.loadNpmTasks('grunt-exec');
// note: "grunt concat" is not requried
- grunt.registerTask('all', ['copy', 'karma:unit', 'uglify']);
+ grunt.registerTask('all', ['copy', 'exec', 'karma:unit', 'cssmin', 'uglify']);
// test only, no minification
- grunt.registerTask('test', ['copy', 'karma:unit']);
-
+ grunt.registerTask('test', ['copy', 'exec', 'karma:unit']);
};
+
+// vim: ts=2:sw=2:softtabstop=2
"license": "GPL",
"homepage": "http://evergreen-ils.org/",
"devDependencies": {
- "angular": "^1.2.16",
- "angular-bootstrap": "0.0.4",
- "angular-hotkeys": "^1.2.0",
+ "bower": "^1.3.3",
"grunt": "~0.4.4",
"grunt-cli": "^0.1.13",
"grunt-contrib-concat": "^0.4.0",
"grunt-contrib-copy": "^0.5.0",
+ "grunt-contrib-cssmin": "^0.9.0",
"grunt-contrib-jasmine": "^0.6.4",
"grunt-contrib-uglify": "^0.4.0",
+ "grunt-exec": "^0.4.5",
"grunt-karma": "^0.8.3",
"karma": "^0.12.14",
"karma-jasmine": "^0.1.5",
"karma-phantomjs-launcher": "^0.1.4",
"karma-script-launcher": "~0.1.0",
- "karma-story-reporter": "^0.2.2",
- "napa": "^0.4.1"
- },
- "napa": {
- "angular-route": "angular/bower-angular-route",
- "angular-mocks": "angular/bower-angular-mocks"
+ "karma-story-reporter": "^0.2.2"
},
"scripts": {
- "install": "napa",
"test": "grunt test"
}
}
logLevel: config.LOG_INFO,
files : [
- 'build/angular.min.js',
- 'build/angular-route.min.js',
- 'node_modules/angular-mocks/angular-mocks.js', // testing only
- 'build/ui-bootstrap.js',
- 'build/hotkeys.min.js',
+ 'build/js/angular.min.js',
+ 'build/js/angular-route.min.js',
+ 'bower_components/angular-mocks/angular-mocks.js', // testing only
+ 'build/js/ui-bootstrap.min.js',
+ 'build/js/hotkeys.min.js',
/* OpenSRF must be installed first */
'/openils/lib/javascript/md5.js',
'/openils/lib/javascript/JSON_v1.js',