-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
106 lines (90 loc) · 2.22 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
102
103
104
105
106
module.exports = function(grunt) {
// Run grunt with '--typeCheck no' to not enforce type checking
var ignoreError = typeof grunt.option('ignoreError') !== 'undefined';
var cleaned = false;
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
browserify: {
browser: {
files: {
'build/src/darwin-browser.js': ['build/src/browser/**/*.js']
}
}
},
clean: {
full: ['build'],
cli: ['build/src/cli', 'build/spec/cli'],
browser: ['build/src/browser', 'build/spec/browser'],
common: ['build/src/common']
},
jasmine_node: {
cli: ['build/spec/cli/'],
options: {
forceExit: true
}
},
karma: {
browser: {
configFile: 'karma.conf.js',
singleRun: true,
browsers: ['PhantomJS']
}
},
typescript: {
browser: {
src: ['src/browser/**/*.ts', 'spec/browser/**/*.ts'],
dest: 'build',
options: { module: 'commonjs', ignoreError: ignoreError }
},
cli: {
src: ['src/cli/**/*.ts', 'spec/cli/**/*.ts'],
dest: 'build',
options: { module: 'commonjs', ignoreError: ignoreError }
},
common: {
src: ['src/common/**/*.ts'],
dest: 'build',
options: { module: 'commonjs', ignoreError: ignoreError }
}
},
tslint: {
options: {
configuration: grunt.file.readJSON('tslint.json')
},
all: ['src/**/*.ts', 'spec/**/*.ts']
}
});
// measures the time each task takes
require('time-grunt')(grunt);
// autoload grunt tasks
require('load-grunt-tasks')(grunt);
grunt.registerTask('default', function() {
cleaned = true;
grunt.task.run(
'tslint',
'clean:full',
'typescript:common',
'browser',
'cli'
);
});
grunt.registerTask('browser', function() {
if (cleaned === false) {
grunt.task.run('clean:browser')
}
grunt.task.run(
'typescript:browser',
'browserify:browser',
'karma:browser'
);
});
grunt.registerTask('cli', function() {
if (cleaned === false) {
grunt.task.run('clean:cli')
}
grunt.task.run(
'typescript:cli',
'jasmine_node'
);
});
}