forked from mootools/mootools-core
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
74 lines (67 loc) · 2.17 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
'use strict';
module.exports = function(grunt){
require('load-grunt-tasks')(grunt);
var pkg = grunt.file.readYAML('package.yml');
var config = {
environment: {
dir: {
dist: 'dist',
build: 'build'
},
build: {
compat: {
name: 'mootools-core-compat',
sources: pkg.sources,
specs: 'Specs/**/*.js'
},
nocompat: {
name: 'mootools-core',
sources: pkg.sources,
strip: ['.*compat'],
specs: 'Specs/**/*.js'
},
server: {
name: 'mootools-core-server',
sources: pkg.sources,
components: ['Core/Core', 'Core/Array', 'Core/String', 'Core/Number', 'Core/Function', 'Core/Object', 'Core/Class', 'Core/Class.Extras', 'Core/Class.Thenable', 'Core/JSON'],
strip: ['1.2compat', '1.3compat', '1.4compat', '*compat', 'IE', 'ltIE8', 'ltIE9', '!ES5', '!ES5-bind', 'webkit', 'ltFF4'],
specs: ['Specs/Core/*.js', 'Specs/Class/*.js', 'Specs/Types/*.js', 'Specs/Utilities/JSON.js'],
uglify: false
}
},
travis: {
enabled: (process.env.TRAVIS === 'true'),
pullRequest: (process.env.TRAVIS_PULL_REQUEST !== 'false'),
browser: process.env.BROWSER,
build: process.env.BUILD
},
sauceLabs: {
username: process.env.SAUCE_USERNAME,
accessKey: process.env.SAUCE_ACCESS_KEY
}
}
};
if (grunt.option('file') || grunt.option('module')){
Object.getOwnPropertyNames(config.environment.build).forEach(function(name){
var build = config.environment.build[name];
if (grunt.option('file')){
if (build.components == null || build.components.indexOf('Core/' + grunt.option('file')) !== -1){
build.components = 'Core/' + grunt.option('file');
build.specs = grunt.file.match('Specs/**/' + grunt.option('file') + '.js', grunt.file.expand(build.specs));
} else {
build.components = [];
build.specs = [];
}
}
if (grunt.option('module')){
build.specs = grunt.file.match('Specs/' + grunt.option('module') + '/**.js', grunt.file.expand(build.specs));
}
});
}
grunt.initConfig(config);
grunt.util.linefeed = '\n';
grunt.file.expand('./Grunt/options/*.js').forEach(function(file){
grunt.config.merge(require(file)(grunt));
});
grunt.loadTasks('Grunt/tasks');
};