-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.js
99 lines (91 loc) · 2.86 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
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? " * " + pkg.homepage + "\\n" : "" %>' +
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' +
' * Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %>\n */\n'
},
linter: {
files: [ 'Gruntfile.js', 'package.json',
'www/js/**/*.js', 'www/js/spec/**/*.js',
'!www/thirdparty/**/*.js', '!www/js/**/*.min.js'
],
globals: {
jQuery: true,
$: true,
describe: true,
it: true,
xdescribe: true,
xit: true,
expect: true,
define: true,
require: true,
requirejs: true,
global_ns: true,
saveAs: true
}
},
watch: {
files: ['<config:linter.files>', 'www/spec/**/*.js'],
tasks: 'linter jasmine'
},
jasmine: {
src: [ 'www/thirdparty/require.js', '!www/js/spec/**/*.spec.js' ],
options: {
template: require('grunt-template-jasmine-requirejs'),
specs : 'www/js/spec/**/*.spec.js'
}
},
shell: {
options: {
failOnError: true,
stdout: true
},
debug_ios: {
//command: 'cordova build ios && cordova emulate ios'
command: 'cordova build ios && cordova run ios'
},
debug_android: {
//command: 'cordova build android && cordova emulate android'
command: 'cordova build android && cordova run android'
},
debug_blackberry: {
//command: 'cordova build blackberry && cordova emulate blackberry'
command: 'cordova build blackberry && cordova run blackberry'
}
},requirejs: {
compile: {
options: {
baseUrl: ".",
name: "www/js/Sacred-Geometry-Calculator/Sacred-Geometry-Calculator.js",
// mainConfigFile: "www/js/tic_tac_toe/tic_tac_toe.js",
out: 'www/js/Sacred-Geometry-Calculator/Sacred-Geometry-Calculator.min.js',
optimize: "uglify2"
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-linter');
grunt.loadNpmTasks('grunt-volo');
// Default task
grunt.registerTask('default', ['test_syntax','min_code','test_tdd']);
// Custom tasks
grunt.registerTask('test', ['test_syntax','test_tdd']);
grunt.registerTask('debug:ios', ['test_syntax','test_tdd','min_code','shell:debug_ios']);
grunt.registerTask('debug:android', ['test_syntax','test_tdd','min_code','shell:debug_android']);
grunt.registerTask('debug:blackberry', ['test_syntax','test_tdd','min_code','shell:debug_blackberry']);
// Resolve and get deps.
grunt.registerTask('get_deps', ['volo:install']);
grunt.registerTask('test_syntax', ['linter']);
grunt.registerTask('test_tdd', ['jasmine']);
// grunt.registerTask('min_code', ['requirejs']);
grunt.registerTask('min_code', [ ]);
};