-
Notifications
You must be signed in to change notification settings - Fork 9
/
Gruntfile.js
101 lines (95 loc) · 3.09 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
/// <binding />
module.exports = function (grunt) {
grunt.initConfig({
dirs: {
project: "src/Angara.SerializationJS",
src: "<%=dirs.project%>/src"
},
bower: {
install: {
options: {
targetDir: './lib',
//layout: 'byType',
install: true,
verbose: false,
cleanTargetDir: false,
cleanBowerDir: false,
bowerOptions: {}
}
}
},
concat: {
"umd": {
dest: "dist/Angara.Serialization.umd.js",
src: [
"<%=dirs.src%>/header.txt",
"<%=dirs.src%>/Angara.InfoSet.js",
"<%=dirs.src%>/footer.txt"
]
},
"umdTs": {
dest: "dist/Angara.Serialization.umd.d.ts",
src: [ "src/Angara.SerializationJS/src/Angara.InfoSet.d.ts"],
options: {
footer: "export = Angara;"
}
}
},
jasmine: {
options: {
keepRunner: true,
vendor: [ "dist/Angara.Serialization.js" ]
},
src: ['src/Angara.SerializationJS/test/**/*.js']
},
copy: {
main: {
files: [
{ src: "<%=dirs.src%>/Angara.InfoSet.d.ts", dest: "dist/Angara.Serialization.d.ts"},
{ src: "<%=dirs.src%>/Angara.InfoSet.js", dest: "dist/Angara.Serialization.js"},
]
}
},
ts: {
"infoSet": {
options: {
target: 'es5',
sourceMap: false,
declaration: true
},
src: ["src/Angara.SerializationJS/src/Angara.InfoSet.ts"]
},
"test": {
options: {
target: 'es5',
sourceMap: false,
},
src: ["src/Angara.SerializationJS/test/*.ts"]
}
},
tsd: {
refresh: {
options: {
// execute a command
command: 'reinstall',
//optional: always get from HEAD
latest: true,
// specify config file
config: 'tsd.json',
// experimental: options to pass to tsd.API
opts: {
// props from tsd.Options
}
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-bower-task');
grunt.loadNpmTasks("grunt-ts");
grunt.loadNpmTasks('grunt-tsd');
grunt.registerTask('build', ['ts:infoSet', 'concat', 'copy', 'ts:test', 'jasmine' ]);
grunt.registerTask('default', ['bower', 'tsd', 'build']);
};