Rename Array.from to Array.convert, keep as is in compat layer
[mootools.git] / Gruntfile.js
blob5b3d26da2f426d0342326cd94a4f8a185789833b
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'
13                         },
14                         build: {
15                                 compat: {
16                                         name: 'mootools-core-compat',
17                                         sources: pkg.sources,
18                                         specs: 'Specs/**/*.js'
19                                 },
20                                 nocompat: {
21                                         name: 'mootools-core',
22                                         sources: pkg.sources,
23                                         strip: ['.*compat'],
24                                         specs: 'Specs/**/*.js'
25                                 },
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
33                                 }
34                         },
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
40                         },
41                         sauceLabs: {
42                                 username: process.env.SAUCE_USERNAME,
43                                 accessKey: process.env.SAUCE_ACCESS_KEY
44                         }
45                 }
46         };
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 = [];
58                                 }
59                         }
60                         if (grunt.option('module')){
61                                 build.specs = grunt.file.match('Specs/' + grunt.option('module') + '/**.js', grunt.file.expand(build.specs));
62                         }
63                 });
64         }
66         grunt.initConfig(config);
68         grunt.file.expand('./Grunt/options/*.js').forEach(function(file){
69                 grunt.config.merge(require(file)(grunt));
70         });
72         grunt.loadTasks('Grunt/tasks');