Fix licenses on ODL scripts
[ccsdk/distribution.git] / dgbuilder / Gruntfile.js
1 /**
2  * Copyright 2013, 2014 IBM Corp.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  **/
16
17 module.exports = function(grunt) {
18     
19     // Project configuration.
20     grunt.initConfig({
21             pkg: grunt.file.readJSON('package.json'),
22             simplemocha: {
23                 options: {
24                     globals: ['expect'],
25                     timeout: 3000,
26                     ignoreLeaks: false,
27                     ui: 'bdd',
28                     reporter: 'spec'
29                 },
30                 all: { src: ['test/**/*_spec.js'] },
31                 core: { src: ["test/_spec.js","test/red/**/*_spec.js"]},
32                 nodes: { src: ["test/nodes/**/*_spec.js"]}
33             },
34             jshint: {
35                 options: {
36                     // http://www.jshint.com/docs/options/
37                     "asi": true,      // allow missing semicolons
38                     "curly": true,    // require braces
39                     "eqnull": true,   // ignore ==null
40                     "forin": true,    // require property filtering in "for in" loops
41                     "immed": true,    // require immediate functions to be wrapped in ( )
42                     "nonbsp": true,   // warn on unexpected whitespace breaking chars
43                     //"strict": true, // commented out for now as it causes 100s of warnings, but want to get there eventually
44                     "loopfunc": true, // allow functions to be defined in loops
45                     "sub": true       // don't warn that foo['bar'] should be written as foo.bar
46                 },
47                 all: [
48                     'Gruntfile.js',
49                     'red.js',
50                     'red/**/*.js',
51                     'nodes/**/*.js',
52                     'public/red/**/*.js'
53                 ],
54                 
55                 core: {
56                     files: {
57                         src: [
58                             'Gruntfile.js',
59                             'red.js',
60                             'red/**/*.js'
61                         ]
62                     }
63                 },
64                 nodes: {
65                     files: {
66                         src: [ 'nodes/**/*.js' ]
67                     }
68                 },
69                 editor: {
70                     files: {
71                         src: [ 'public/red/**/*.js' ]
72                     }
73                 },
74                 tests: {
75                     files: {
76                         src: ['test/**/*.js']
77                     },
78                     options: {
79                         "expr": true
80                     }
81                 }
82                 
83             }
84     });
85     
86     grunt.loadNpmTasks('grunt-simple-mocha');
87     grunt.loadNpmTasks('grunt-contrib-jshint');
88     
89     grunt.registerTask('default', ['jshint:core','jshint:tests','jshint:editor','simplemocha:core','simplemocha:nodes']);
90     
91 };