forked from flowjs/ng-flow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
83 lines (79 loc) · 2.22 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= pkg.version %> */\n'
},
'ng-flow': {
src: ['dist/ng-flow.js'],
dest: 'dist/ng-flow.min.js'
},
'ng-flow-standalone': {
src: ['dist/ng-flow-standalone.js'],
dest: 'dist/ng-flow-standalone.min.js'
}
},
concat: {
flow: {
files: {
'dist/ng-flow.js': [
'src/provider.js',
'src/directives/init.js',
'src/directives/*.js',
'src/*.js'
],
'dist/ng-flow-standalone.js': [
'bower_components/flow.js/dist/flow.js',
'src/provider.js',
'src/directives/init.js',
'src/directives/*.js',
'src/*.js'
]
}
}
},
karma: {
options: {
configFile: 'karma.conf.js'
},
watch: {
},
continuous: {
singleRun: true
}
},
clean: {
release: ["dist/ng*"]
},
bump: {
options: {
files: ['package.json', 'bower.json'],
updateConfigs: ['pkg'],
commit: true,
commitMessage: 'Release v%VERSION%',
commitFiles: ['-a'], // '-a' for all files
createTag: true,
tagName: 'v%VERSION%',
tagMessage: 'Version %VERSION%',
push: true,
pushTo: 'origin',
gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d' // options to use with '$ git describe'
}
}
});
// Loading dependencies
for (var key in grunt.file.readJSON("package.json").devDependencies) {
if (key !== "grunt" && key.indexOf("grunt") === 0) grunt.loadNpmTasks(key);
}
grunt.registerTask('build', ['concat', 'uglify']);
grunt.registerTask('test', ['karma:continuous']);
grunt.registerTask('watch', ['karma:watch']);
grunt.registerTask('release', function(type) {
type = type ? type : 'patch';
grunt.task.run('bump-only:' + type);
grunt.task.run('clean', 'build');
grunt.task.run('bump-commit');
});
};