diff --git a/Gruntfile.js b/Gruntfile.js index 9483bd7..627f152 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -63,6 +63,17 @@ module.exports = function(grunt) { unit: { configFile: "karma.config.js", background: true + }, + produnit: { + configFile: "ci-karma.config.js" + } + }, + uglify: { + prod: { + files: { + "prod_static/js/app.min.js": JS_SOURCES, + "prod_static/js/login.min.js": LOGIN_JS + } } }, watch: { @@ -70,12 +81,14 @@ module.exports = function(grunt) { files: ALL_JS_SOURCES, tasks: ["karma:unit:run", "jshint"] } - } + }, }); grunt.loadNpmTasks("grunt-contrib-jshint"); grunt.loadNpmTasks('grunt-karma'); grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.registerTask("default", ["jshint", "karma:unit:start", "watch"]); + grunt.registerTask("prod", ["uglify:prod", "karma:produnit"]) }; \ No newline at end of file diff --git a/scripts/travis/travis.karma.config.js b/ci-karma.config.js similarity index 76% rename from scripts/travis/travis.karma.config.js rename to ci-karma.config.js index c54b21b..9b24911 100644 --- a/scripts/travis/travis.karma.config.js +++ b/ci-karma.config.js @@ -14,16 +14,15 @@ module.exports = function(config) { // list of files / patterns to load in the browser files: [ - '../../static/js/vendor/jquery-1.9.1.min.js', - '../../static/js/foundation.min.js', - '../../static/js/vendor/statusmsg.js', - '../../tests/jstests/testinit.js', // initialize the statusmsg stuff. - '../../static/js/vendor/angular.min.js', - '../../tests/jstests/angular-mocks.js', - '../../static/js/develop/**/*.js', - '../../projecto/apiv1/**/static/js/*.js', - '../../projecto/apiv1/**/jstests/*.js', - '../../tests/jstests/others/**/*.js' + 'static/js/vendor/jquery-1.9.1.min.js', + 'static/js/foundation.min.js', + 'static/js/vendor/statusmsg.js', + 'tests/jstests/testinit.js', // initialize the statusmsg stuff. + 'static/js/vendor/angular.min.js', + 'tests/jstests/angular-mocks.js', + "prod_static/js/app.min.js", + 'projecto/apiv1/**/jstests/*.js', + 'tests/jstests/others/**/*.js' ], diff --git a/package.json b/package.json index bfa3ed5..e24e37d 100644 --- a/package.json +++ b/package.json @@ -2,18 +2,18 @@ "name": "projecto-dev", "version": "0.0.0", "dependencies": { - "karma-cli": "0.0.4", - "grunt-cli": "^0.1.13", "grunt": "^0.4.4", - "grunt-contrib-uglify": "^0.4.0", - "karma": "^0.12.16", - "grunt-contrib-watch": "^0.6.1", + "grunt-cli": "^0.1.13", "grunt-contrib-cssmin": "^0.9.0", "grunt-contrib-jshint": "^0.10.0", - "karma-jasmine": "^0.1.5", + "grunt-contrib-uglify": "^0.4.0", + "grunt-contrib-watch": "^0.6.1", + "grunt-karma": "^0.8.3", + "karma": "^0.12.16", "karma-chrome-launcher": "^0.1.3", + "karma-cli": "0.0.4", "karma-firefox-launcher": "^0.1.3", - "karma-phantomjs-launcher": "^0.1.4", - "grunt-karma": "^0.8.3" + "karma-jasmine": "^0.1.5", + "karma-phantomjs-launcher": "^0.1.4" } } diff --git a/scripts/travis/test.sh b/scripts/travis/test.sh index f1e81ae..42ea8e5 100755 --- a/scripts/travis/test.sh +++ b/scripts/travis/test.sh @@ -7,7 +7,7 @@ if [ $? -ne 0 ]; then fi echo "Running client side tests..." -karma start scripts/travis/travis.karma.config.js +grunt prod if [ $? -ne 0 ]; then exit 1; fi