Merge branch 'grunt' into develop
This commit is contained in:
commit
a0a697d3e2
5 changed files with 104 additions and 40 deletions
21
.editorconfig
Normal file
21
.editorconfig
Normal file
|
@ -0,0 +1,21 @@
|
|||
# EditorConfig helps developers define and maintain consistent
|
||||
# coding styles between different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
|
||||
[*]
|
||||
|
||||
# Change these settings to your own preference
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
# We recommend you to keep these unchanged
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,3 +3,4 @@ bower_components
|
|||
node_modules
|
||||
/.tmp
|
||||
/.ssh
|
||||
/coverage
|
||||
|
|
106
Gruntfile.js
106
Gruntfile.js
|
@ -9,8 +9,12 @@
|
|||
|
||||
module.exports = function (grunt) {
|
||||
|
||||
// Load grunt tasks automatically
|
||||
require('load-grunt-tasks')(grunt);
|
||||
// Lazy-load grunt tasks automatically
|
||||
require('jit-grunt')(grunt, {
|
||||
useminPrepare: 'grunt-usemin',
|
||||
sshexec: 'grunt-ssh',
|
||||
sftp: 'grunt-ssh'
|
||||
});
|
||||
|
||||
// Time how long tasks take. Can help when optimizing build times
|
||||
require('time-grunt')(grunt);
|
||||
|
@ -86,18 +90,26 @@ module.exports = function (grunt) {
|
|||
}
|
||||
},
|
||||
test: {
|
||||
options: {
|
||||
port: 9001,
|
||||
middleware: function (connect) {
|
||||
return [
|
||||
connect().use(
|
||||
'/bower_components',
|
||||
connect.static('./bower_components')
|
||||
),
|
||||
connect.static(appConfig.app)
|
||||
];
|
||||
options: {
|
||||
port: 9001,
|
||||
middleware: function (connect) {
|
||||
return [
|
||||
connect().use(
|
||||
'/bower_components',
|
||||
connect.static('./bower_components')
|
||||
),
|
||||
connect.static(appConfig.app)
|
||||
];
|
||||
}
|
||||
}
|
||||
},
|
||||
coverage: {
|
||||
options: {
|
||||
open: true,
|
||||
port: 9003,
|
||||
keepalive: true,
|
||||
base: './coverage/'
|
||||
}
|
||||
}
|
||||
},
|
||||
dist: {
|
||||
options: {
|
||||
|
@ -115,12 +127,14 @@ module.exports = function (grunt) {
|
|||
},
|
||||
unit: {
|
||||
singleRun: true,
|
||||
browsers: ['Chrome']
|
||||
browsers: ['Chrome'],
|
||||
reporters: ['notify', 'coverage']
|
||||
},
|
||||
continuous: {
|
||||
singleRun: false,
|
||||
background: true,
|
||||
browsers: ['PhantomJS']
|
||||
browsers: ['Chrome'],
|
||||
reporters: ['progress', 'notify']
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -346,11 +360,19 @@ module.exports = function (grunt) {
|
|||
createDirectories: true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Display notfifications when builds complete using Growl
|
||||
notify: {
|
||||
deploy: {
|
||||
options: {
|
||||
message: 'Jamstash deployed to test server'
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
grunt.registerTask('serve', 'Compile then start a connect web server', function (target) {
|
||||
grunt.registerTask('serve', 'Compile then start a connect web server', function(target) {
|
||||
if (target === 'dist') {
|
||||
return grunt.task.run(['build', 'connect:dist:keepalive']);
|
||||
}
|
||||
|
@ -363,31 +385,43 @@ module.exports = function (grunt) {
|
|||
]);
|
||||
});
|
||||
|
||||
grunt.registerTask('test', [
|
||||
'karma:unit',
|
||||
'jshint'
|
||||
]);
|
||||
grunt.registerTask('test', 'Run unit tests and jshint', function() {
|
||||
return grunt.task.run([
|
||||
'karma:unit',
|
||||
'jshint'
|
||||
]);
|
||||
});
|
||||
|
||||
grunt.registerTask('build', [
|
||||
'clean:dist',
|
||||
'wiredep:app',
|
||||
'useminPrepare',
|
||||
'concat:generated',
|
||||
'copy:dist',
|
||||
'imagemin',
|
||||
//'ngAnnotate',
|
||||
'cssmin',
|
||||
'uglify:generated',
|
||||
'filerev',
|
||||
'usemin',
|
||||
'htmlmin'
|
||||
]);
|
||||
grunt.registerTask('coverage', 'Run unit tests and display test coverage results on browser', function() {
|
||||
return grunt.task.run([
|
||||
'karma:unit',
|
||||
'connect:coverage'
|
||||
]);
|
||||
});
|
||||
|
||||
grunt.registerTask('build', 'Concatenate all JS files, minify all JS, CSS, HTML and image files and version all static assets', function() {
|
||||
return grunt.task.run([
|
||||
'clean:dist',
|
||||
'wiredep:app',
|
||||
'useminPrepare',
|
||||
'concat:generated',
|
||||
'copy:dist',
|
||||
'imagemin',
|
||||
//'ngAnnotate',
|
||||
'cssmin',
|
||||
'uglify:generated',
|
||||
'filerev',
|
||||
'usemin',
|
||||
'htmlmin'
|
||||
]);
|
||||
});
|
||||
|
||||
grunt.registerTask('deploy', 'Build and deploy to test server', function() {
|
||||
return grunt.task.run([
|
||||
'build',
|
||||
'sshexec:cleanTest',
|
||||
'sftp:test'
|
||||
'sftp:test',
|
||||
'notify:deploy'
|
||||
]);
|
||||
});
|
||||
|
||||
|
|
|
@ -42,6 +42,10 @@ module.exports = function(config) {
|
|||
// list of files / patterns to exclude
|
||||
exclude: ['app/vendor/**/*.js'],
|
||||
|
||||
preprocessors: {
|
||||
'app/**/!(*_test).js': ['coverage']
|
||||
},
|
||||
|
||||
// web server port
|
||||
port: 8080,
|
||||
|
||||
|
@ -54,14 +58,16 @@ module.exports = function(config) {
|
|||
// - PhantomJS
|
||||
// - IE (only Windows)
|
||||
browsers: [
|
||||
'Chrome'
|
||||
'PhantomJS'
|
||||
],
|
||||
|
||||
// Which plugins to enable
|
||||
plugins: [
|
||||
'karma-chrome-launcher',
|
||||
'karma-phantomjs-launcher',
|
||||
'karma-jasmine'
|
||||
'karma-jasmine',
|
||||
'karma-coverage',
|
||||
'karma-notify-reporter'
|
||||
],
|
||||
|
||||
// Continuous Integration mode
|
||||
|
|
|
@ -42,16 +42,18 @@
|
|||
"grunt-filerev": "^2.1.1",
|
||||
"grunt-karma": "^0.9.0",
|
||||
"grunt-ng-annotate": "^0.5.0",
|
||||
"grunt-notify": "^0.4.1",
|
||||
"grunt-ssh": "^0.12.0",
|
||||
"grunt-usemin": "^2.6.0",
|
||||
"grunt-wiredep": "^1.9.0",
|
||||
"jit-grunt": "^0.9.0",
|
||||
"jshint-stylish": "^1.0.0",
|
||||
"karma": "^0.12.25",
|
||||
"karma-chrome-launcher": "^0.1.5",
|
||||
"karma-coverage": "^0.2.6",
|
||||
"karma-jasmine": "^0.3.0",
|
||||
"karma-notify-reporter": "^0.1.1",
|
||||
"karma-phantomjs-launcher": "^0.1.4",
|
||||
"load-grunt-tasks": "^1.0.0",
|
||||
"sellout": "0.0.1",
|
||||
"time-grunt": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue