Merge pull request #2789 from SergioCrisostomo/upgrade-karma-sauce-launcher
[mootools.git] / Gruntfile.js
blob6c11e4dbdad8f869a2cd03bc2dd307d976f0a679
1 'use strict';
3 module.exports = function(grunt){
4 require('load-grunt-tasks')(grunt);
6 var pkg = grunt.file.readYAML('package.yml');
8 var config = {
9 environment: {
10 dir: {
11 dist: 'dist',
12 build: 'build'
14 build: {
15 compat: {
16 name: 'mootools-core-compat',
17 sources: pkg.sources,
18 specs: 'Specs/**/*.js'
20 nocompat: {
21 name: 'mootools-core',
22 sources: pkg.sources,
23 strip: ['.*compat'],
24 specs: 'Specs/**/*.js'
26 server: {
27 name: 'mootools-core-server',
28 sources: pkg.sources,
29 components: ['Core/Core', 'Core/Array', 'Core/String', 'Core/Number', 'Core/Function', 'Core/Object', 'Core/Class', 'Core/Class.Extras', 'Core/Class.Thenable', 'Core/JSON'],
30 strip: ['1.2compat', '1.3compat', '1.4compat', '*compat', 'IE', 'ltIE8', 'ltIE9', '!ES5', '!ES5-bind', 'webkit', 'ltFF4'],
31 specs: ['Specs/Core/*.js', 'Specs/Class/*.js', 'Specs/Types/*.js', 'Specs/Utilities/JSON.js'],
32 uglify: false
35 travis: {
36 enabled: (process.env.TRAVIS === 'true'),
37 pullRequest: (process.env.TRAVIS_PULL_REQUEST !== 'false'),
38 browser: process.env.BROWSER,
39 build: process.env.BUILD
41 sauceLabs: {
42 username: process.env.SAUCE_USERNAME,
43 accessKey: process.env.SAUCE_ACCESS_KEY
48 if (grunt.option('file') || grunt.option('module')){
49 Object.getOwnPropertyNames(config.environment.build).forEach(function(name){
50 var build = config.environment.build[name];
51 if (grunt.option('file')){
52 if (build.components == null || build.components.indexOf('Core/' + grunt.option('file')) !== -1){
53 build.components = 'Core/' + grunt.option('file');
54 build.specs = grunt.file.match('Specs/**/' + grunt.option('file') + '.js', grunt.file.expand(build.specs));
55 } else {
56 build.components = [];
57 build.specs = [];
60 if (grunt.option('module')){
61 build.specs = grunt.file.match('Specs/' + grunt.option('module') + '/**.js', grunt.file.expand(build.specs));
63 });
66 grunt.initConfig(config);
67 grunt.util.linefeed = '\n';
69 grunt.file.expand('./Grunt/options/*.js').forEach(function(file){
70 grunt.config.merge(require(file)(grunt));
71 });
73 grunt.loadTasks('Grunt/tasks');