forked from Hypercubed/angular-marked
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.js
executable file
·108 lines (94 loc) · 2.53 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
module.exports = function(grunt){
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('bower.json'),
jshint: {
options: { jshintrc: true, force: true },
all: ['gruntfile.js', '<%= pkg.name %>.js']
},
bump: {
options: {
files: ['bower.json','package.json'],
commit: true,
commitMessage: 'release %VERSION%',
commitFiles: ['package.json','bower.json','<%= pkg.name %>.min.js'],
pushTo: 'origin',
}
},
uglify: {
options: {
banner: '/*\n * <%= pkg.title || pkg.name %> <%= pkg.version %>\n' +
' * (c) <%= grunt.template.today("yyyy") %> <%= pkg.authors.join(" ") %>\n' +
' * Licensed <%= pkg.license %>\n */\n'
},
src: {
files: {
'<%= pkg.name %>.min.js': '<%= pkg.name %>.js'
}
}
},
karma: {
unit: {
configFile: 'karma.conf.js'
},
once: {
configFile: 'karma.conf.js',
singleRun: true,
browsers: ['PhantomJS']
},
server: {
configFile: 'karma.conf.js',
singleRun: false,
autoWatch: true,
browsers: ['PhantomJS']
}
},
'gh-pages': {
options: {
base: 'docs'
},
src: ['**']
},
ngdocs: {
options: {
html5Mode: false,
titleLink: "#/api",
navTemplate: './docs-template/nav.html',
scripts: [
'angular.js',
'./bower_components/marked/lib/marked.js',
'./<%= pkg.name %>.js',
'./docs-template/script.js',
],
discussions: {
shortName: 'hypercubedgithub',
url: 'http://hypercubed.github.io/angular-marked/',
dev: false
}
},
all: ['<%= pkg.name %>.js']
},
connect: {
server: {
options: {
port: 9001,
base: 'docs',
hostname: 'localhost',
open: true
}
}
},
watch: {
parser: {
files: ['<%= pkg.name %>.js','./docs-template/*.*'],
tasks: ['build']
}
}
});
require('load-grunt-tasks')(grunt);
grunt.registerTask('serve', ['build','connect','watch']);
grunt.registerTask('default', ['test', 'build']);
grunt.registerTask('build', ['jshint', 'uglify', 'ngdocs']);
grunt.registerTask('test', ['karma:once']);
grunt.registerTask('publish', ['test','bump-only','uglify','bump-commit','gh-pages']);
};