forked from netconstructor/conductor.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
58 lines (48 loc) · 1.84 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
module.exports = function(grunt) {
require('matchdep').
filterDev('grunt-*').
filter(function(name){ return name !== 'grunt-cli'; }).
forEach(grunt.loadNpmTasks);
grunt.loadTasks('tasks');
// Alias tasks for the most common sets of tasks.
// Most of the time, you will use these.
// By default, (i.e., if you invoke `grunt` without arguments), do
// a new build.
this.registerTask('default', ['build']);
// Build a new version of the library
this.registerTask('build', "Builds a distributable version of Conductor.js", [
'clean',
'jshint',
'copy:lib', // reorganize folder
'jst',
'transpile', // convert conductor files to amd modules
'concat:amd', // generate conductor.amd.js
'concat:browser',
'jsframe:conductor' // create polyglot
]);
// Run a server. This is ideal for running the QUnit tests in the browser.
this.registerTask('server', ['prepare_test', 'connect', 'watch']);
function config(configFileName) {
return require('./configurations/' + configFileName);
}
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: ["dist/*", "tmp/*"],
concat: config('concat'),
connect: config('connect'),
copy: config('copy'),
jshint: config('jshint'),
'saucelabs-qunit': config('saucelabs-qunit'),
transpile: config('transpile'),
watch: config('watch'),
jsframe: {
conductor: {
src: ['tmp/browser/<%= pkg.name %>-<%= pkg.version %>.js'],
dest: 'dist'
}
},
});
grunt.registerTask('test', "Run full test suite", ['prepare_test', 'connect', 'saucelabs-qunit:all']);
grunt.registerTask('test:ie', "Run tests suite in IE", ['prepare_test', 'connect', 'saucelabs-qunit:ie']);
grunt.registerTask('prepare_test', "Setup the test environment", ['build', 'concat:tests', 'copy:tests']);
};