-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
38 lines (37 loc) · 1.19 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
module.exports = function (grunt) {
grunt.initConfig({
ts: {
default: {
tsconfig: './tsconfig.json'
}
},
watch: {
files: "src/*",
tasks: "default"
}
});
function buildtime() {
var x = new Date();
var y = x.getFullYear().toString();
var m = (x.getMonth() + 1).toString();
var d = x.getDate().toString();
var h = x.getHours().toString();
var mi = x.getMinutes().toString();
var s = x.getSeconds().toString();
(d.length == 1) && (d = '0' + d);
(m.length == 1) && (m = '0' + m);
(h.length == 1) && (h = '0' + h);
(mi.length == 1) && (mi = '0' + mi);
(s.length == 1) && (s = '0' + s);
var yyyymmdd = y + m + d + h + mi + s;
return yyyymmdd;
}
grunt.loadNpmTasks("grunt-ts");
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask("add-build-meta", "adds build metadata", function () {
grunt.file.write("bin/Internal/build.json", JSON.stringify({
"build-meta": buildtime()
}));
});
grunt.registerTask("default", ["ts", "add-build-meta"]);
};