-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
85 lines (79 loc) · 3.37 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
/**
* Created by jcabresos on 4/26/2014.
*/
var path = require('path');
module.exports = function(grunt) {
var COVERAGE_DIR = 'codecoverage';
var TEST_DUMMY_DIR = 'test_dummy';
var RELEASE_DIR = 'bin-release';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {
main: [COVERAGE_DIR, TEST_DUMMY_DIR],
release: [RELEASE_DIR]
},
copy: {
test: {
files: [
{expand: true, cwd:"test/dummy", src:['**'], dest: path.join(TEST_DUMMY_DIR, "strip")},
{expand: true, cwd:"test/dummy", src:['**'], dest: path.join(TEST_DUMMY_DIR, "resolve")},
{expand: true, cwd:"test/dummy", src:['**'], dest: path.join(TEST_DUMMY_DIR, "retain")}
]
},
release: {
files: [
{expand: true, src:['src/**/*.js', 'src/**/*.json', 'domercli.js', 'package.json', 'LICENSE', 'README.md'], dest: RELEASE_DIR}
]
}
},
tsd: {
main: {
options: {
// execute a command
command: 'reinstall',
//optional: always get from HEAD
latest: true,
// specify config file
config: 'tsd.json'
}
}
},
ts: {
// use to override the default options, See: http://gruntjs.com/configuring-tasks#options
// these are the default options to the typescript compiler for grunt-ts:
// see `tsc --help` for a list of supported options.
options: {
compile: true, // perform compilation. [true (default) | false]
comments: false, // same as !removeComments. [true | false (default)]
target: 'es3', // target javascript language. [es3 (default) | es5]
module: 'commonjs', // target javascript module style. [amd (default) | commonjs]
sourceMap: true, // generate a source map for every output js file. [true (default) | false]
declaration: false // generate a declaration .d.ts file for every output js file. [true | false (default)]
},
build: {
src: ["src/**/*.ts","test/**/*.ts"]
}
},
mocha_istanbul: {
coveralls: {
src: 'test',
options: {
recursive: true, //include subdirectories
coverage:true,
root: 'src', // define where the cover task should consider the root of libraries that are covered by tests
coverageFolder: COVERAGE_DIR,
reportFormats: ['html','cobertura','lcovonly']
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-mocha-istanbul');
grunt.loadNpmTasks('grunt-tsd');
grunt.loadNpmTasks('grunt-ts');
grunt.registerTask('configure', ['tsd'])
grunt.registerTask('build', ['ts:build']);
grunt.registerTask('release', ['clean:release', 'copy:release']);
grunt.registerTask('test', ['clean', 'copy:test','mocha_istanbul']);
}