-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
128 lines (126 loc) · 3.46 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/*global module:false*/
/*global process:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
src: ['Gruntfile.js', 'src/**/*.js', 'tests/**/*.js'],
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
browser: true,
globals: {
require: true,
define: true,
requirejs: true,
describe: true,
expect: true,
it: true
}
}
},
concat: {
options: {
separator: "\n",
banner: "(function($){\n$.espacoGuerra = $.espacoGuerra || {};",
footer: ";})(jQuery);"
},
dist: {
src: [
//include libs
'bower_components/threejs/build/index.js',
//own classes and files
'src/**/*.js'
],
// the location of the resulting JS file
dest: 'js/<%= pkg.name %>.js'
}
},
watch: {
scripts: {
files: ['src/**/*.js', 'tests/**/*.js', 'tests/**/*.html'],
tasks: ['dev-watch'],
options: {
interrupt: true
}
}
},
removelogging: {
dist: {
src: "js/<%= pkg.name %>.js",
dest: "build/<%= pkg.name %>.js"
}
},
uglify: {
options: {
banner: ""
},
build: {
src: 'build/<%= pkg.name %>.js',
dest: 'js/<%= pkg.name %>.min.js'
}
},
mocha_istanbul: {
require: ['bower_components/jquery/dist/jquery.js', 'test_helper.js'],
coverage: {
src: 'tests',
options: {
coverageFolder: 'coverage',
mask: '**/*_tests.js',
root: 'src/'
}
}
},
'saucelabs-mocha': {
all: {
options: {
// username: ENV SAUCE_USERNAME
// key: ENV SAUCE_ACCESS_KEY
urls: ["http://localhost:9999/tests/saucelabs.html"],
testname: 'Sauce Unit Test for EspacoGuerra JS Client',
browsers: [
["Windows 8.1", "firefox", 34], ["Windows 8.1", "chrome", 39],
["Windows 8.1", "internet explorer", 11],// ["Windows 7", "opera", 12],
["OS X 10.10", "firefox", 34], ["OS X 10.10", "chrome", 39],
["OS X 10.10", "safari", 8],
["Linux", "firefox", 34], ["Linux", "chrome", 39],
// ["Linux", "opera", 12]
],
build: process.env.SNAP_PIPELINE_COUNTER || 'manual',
public: 'public'
}
}
},
connect: {
server: {
options: {
hostname: 'localhost',
port: 9999,
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-remove-logging');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-mocha');
grunt.loadNpmTasks('grunt-mocha-istanbul');
grunt.loadNpmTasks('grunt-saucelabs');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('test', ['mocha_istanbul:coverage']);
grunt.registerTask('dev-watch', ['jshint', 'test', 'concat:dist']);
grunt.registerTask('build', ['concat', 'removelogging', 'uglify']);
grunt.registerTask('server', ['connect']);
grunt.registerTask('default', ['dev-watch']);
};