Skip to content

Commit 917c438

Browse files
committed
Merge pull request angular-ui#61 from PascalPrecht/grunt-0.4.0
Updated ui-router to grunt 0.4.0
2 parents c7d93ce + 3b6e5e1 commit 917c438

File tree

3 files changed

+25
-13
lines changed

3 files changed

+25
-13
lines changed

grunt.js renamed to Gruntfile.js

+16-12
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@ var testacular = require('testacular');
33
/*global module:false*/
44
module.exports = function (grunt) {
55

6+
grunt.loadNpmTasks('grunt-contrib-concat');
7+
grunt.loadNpmTasks('grunt-contrib-uglify');
8+
grunt.loadNpmTasks('grunt-contrib-jshint');
9+
grunt.loadNpmTasks('grunt-contrib-watch');
10+
611
// Project configuration.
712
grunt.initConfig({
813
builddir: 'build',
9-
pkg: '<json:package.json>',
14+
pkg: grunt.file.readJSON('package.json'),
1015
meta: {
1116
banner: '/**\n' + ' * <%= pkg.description %>\n' +
1217
' * @version v<%= pkg.version %> - ' + '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
@@ -32,16 +37,15 @@ module.exports = function (grunt) {
3237
dest: '<%= builddir %>/<%= pkg.name %>.js'
3338
}
3439
},
35-
min: {
40+
uglify: {
3641
build: {
37-
src: ['<banner:meta.banner>', '<config:concat.build.dest>'],
38-
dest: '<%= builddir %>/<%= pkg.name %>.min.js'
42+
files: {
43+
'<%= builddir %>/<%= pkg.name %>.min.js': ['<banner:meta.banner>', '<%= concat.build.dest %>']
44+
}
3945
}
4046
},
41-
lint: {
42-
files: ['grunt.js', 'src/*.js', '<%= builddir %>/<%= pkg.name %>.js']
43-
},
4447
jshint: {
48+
all: ['Gruntfile.js', 'src/*.js', '<%= builddir %>/<%= pkg.name %>.js'],
4549
options: {
4650
eqnull: true
4751
}
@@ -53,9 +57,9 @@ module.exports = function (grunt) {
5357
});
5458

5559
// Default task.
56-
grunt.registerTask('build', 'concat min');
57-
grunt.registerTask('dist', 'build jsdoc');
58-
grunt.registerTask('default', 'build lint test');
60+
grunt.registerTask('build', ['concat', 'uglify']);
61+
grunt.registerTask('dist', ['build', 'jsdoc']);
62+
grunt.registerTask('default', ['build', 'jshint', 'test']);
5963

6064
grunt.registerTask('test-server', 'Start testacular server', function () {
6165
//Mark the task as async but never call done, so the server stays up
@@ -65,7 +69,7 @@ module.exports = function (grunt) {
6569

6670
grunt.registerTask('test', 'Run tests (make sure test-server task is run first)', function () {
6771
var done = this.async();
68-
grunt.utils.spawn({
72+
grunt.util.spawn({
6973
cmd: process.platform === 'win32' ? 'testacular.cmd' : 'testacular',
7074
args: process.env.TRAVIS ? ['start', 'test/test-config.js', '--single-run', '--no-auto-watch', '--reporter=dots', '--browsers=Firefox'] : ['run']
7175
}, function (error, result, code) {
@@ -86,7 +90,7 @@ module.exports = function (grunt) {
8690

8791
grunt.registerTask('jsdoc', 'Generate documentation', function () {
8892
var done = this.async();
89-
grunt.utils.spawn({
93+
grunt.util.spawn({
9094
cmd: 'node_modules/jsdoc/jsdoc',
9195
args: [ '-c', 'jsdoc-conf.json', '-d', grunt.config('builddir') + '/doc', 'src' ]
9296
}, function (error, result, code) {

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# UI-Router
22

3+
**Attention**: UI-Router uses <code>grunt >= 0.4.x</code> make sure to upgrade your environment and read the
4+
[Migration Guide](http://gruntjs.com/upgrading-from-0.3-to-0.4).
5+
36
Finally a de-facto solution to nested views and routing.
47

58

package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
"dependencies": {},
66
"devDependencies": {
77
"testacular": "~0.4.0",
8-
"jsdoc": "git://github.com/jsdoc3/jsdoc.git#v3.1.0"
8+
"jsdoc": "git://github.com/jsdoc3/jsdoc.git#v3.1.0",
9+
"grunt": "~0.4.1",
10+
"grunt-contrib-concat": "~0.1.3",
11+
"grunt-contrib-uglify": "~0.2.0",
12+
"grunt-contrib-jshint": "~0.3.0",
13+
"grunt-contrib-watch": "~0.3.1"
914
}
1015
}

0 commit comments

Comments
 (0)