-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGruntfile.js
52 lines (46 loc) · 1.71 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
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-bumpup');
grunt.loadNpmTasks('grunt-build-number');
var semver = require('semver');
var pkgJson = grunt.file.readJSON('packages/core/package.json');
grunt.initConfig({
bumpup: {
// setters: {
// version: function (oldVersion, releaseType, options, buildMeta) {
// if (releaseType === "build") {
// return semver.valid(oldVersion) + (buildMeta ? '-build.' + buildMeta : "");
// }
// console.log(oldVersion, releaseType)
// return semver.inc(oldVersion, releaseType) + (buildMeta ? '-build.' + buildMeta : "");
// },
// date: function (oldDate, releaseType, options, buildMeta) {
// return moment.utc().format(options.dateformat);
// }
// },
files: ['packages/core/package.json', 'packages/angular/package.json', 'packages/angular/projects/anywhere-ui/package.json', 'packages/react/package.json', 'packages/vue/package.json']
},
buildnumber: {
options: {
field: 'buildnum',
},
files: ['packages/core/package.json', 'packages/angular/package.json', 'packages/angular/projects/anywhere-ui//package.json', 'packages/react/package.json', 'packages/vue/package.json']
}
});
// Alias task for release with buildmeta suffix support
grunt.registerTask('release', function (type, build) {
var bumpParts = ['bumpup'];
if (type) {
bumpParts.push(type);
}
if (build) {
if (build === "auto") {
bumpParts.push(pkgJson.buildnum++);
} else {
bumpParts.push(build);
}
}
// else {
// }
grunt.task.run(bumpParts.join(':'));
});
};