-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGruntfile.js
More file actions
138 lines (122 loc) · 2.99 KB
/
Gruntfile.js
File metadata and controls
138 lines (122 loc) · 2.99 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
buildcontrol: {
options: {
dir: 'docs',
commit: true,
push: true,
message: 'Built %sourceName% from commit %sourceCommit% on branch %sourceBranch%'
},
github: {
options: {
remote: 'git@github.com:yllieth/predicsis_ml_sdk-javascript.git',
branch: 'gh-pages'
}
}
},
bump: {
options: {
filepaths: ['package.json', 'bower.json'],
commit: true,
tag: false
}
},
// remove previous builds
clean: {
dist: ['dist'],
docs: ['docs/.git'],
plato: ['docs/plato']
},
// build all model files into a single js file
concat: {
dist: {
src: ['lib/predicsis-jsSDK.js', 'lib/model/*.js', 'lib/helper/*.js'],
dest: 'dist/predicsis-jsSDK.js'
}
},
connect: {
server: {
options: {
keepalive: true,
port: 8100,
hostname: '*'
}
}
},
// generate documentation of MLStudio source code
ngdocs: {
options: {
dest: 'docs/',
title: 'jsSDK: Documentation',
//scripts: ['vendor/angular/angular.js'],
styles: ['docs/ngdoc.css'],
html5Mode: false,
startPage: '/api',
titleLink: '/api',
bestMatch: true,
navTemplate: 'docs/header.html',
analytics: {
account: 'UA-63397194-1',
domainName: 'http://yllieth.github.io/predicsis_ml_sdk-javascript'
},
discussions: {
shortName: 'predicsismlsdkjavascript',
url: 'https://predicsismlsdkjavascript.disqus.com',
dev: false
}
},
api: {
src: ['lib/model/*.js', 'lib/helper/*.js']
}
},
// code maintainability reports
plato: {
lib: {
options: {
jshint: grunt.file.readJSON('.jshintrc'),
title: "PredicSis ML SDK - angularJS",
recurse: true
},
files: {
'docs/plato': ['lib/']
}
}
},
// remove comments
uglify: {
options: {
mangle: false,
sourceMap: true
},
dist: {
files: {
'dist/predicsis-jsSDK.min.js': ['dist/predicsis-jsSDK.js']
}
}
},
karma: {
unit: {
configFile: 'test/configure.js',
singleRun: true
}
},
watch: {
all: {
files: ['lib/predicsis-jsSDK.js', 'lib/**/*.js'],
tasks: ['build']
}
}
});
grunt.registerTask('build', ['clean:dist', 'concat', 'uglify']);
grunt.registerTask('doc', function(target) {
if (target === 'deploy') {
grunt.task.run(['buildcontrol:github', 'clean:docs']);
} else {
grunt.task.run(['ngdocs', 'plato']);
}
});
grunt.registerTask('update', ['build', 'doc:deploy', 'bump:patch'])
};