-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathGruntfile.js
74 lines (72 loc) · 2.03 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
coffee: {
compile: {
files: {
'src/ruc_jquery_validator.js': 'src/ruc_jquery_validator.coffee',
'spec/ruc_jquery_validatorSpec.js': 'spec/ruc_jquery_validatorSpec.coffee'
}
}
},
coffeelint: {
lint: ['src/*.coffee', 'spec/*.coffee'],
options: {
'camel_case_classes': {
level: 'ignore'
}
}
},
jasmine: {
test: {
src: 'src/*.js'
},
dist: {
src: 'dist/*.js'
},
options: {
specs: 'spec/*Spec.js',
helpers: ['lib/jasmine-jquery-1.5.0/jasmine-jquery.js'],
vendor: ['lib/jquery-1.9.1/jquery-1.9.1.js']
}
},
watch: {
coffee: {
files: ['src/**/*.coffee', 'spec/*Spec.coffee'],
tasks: ['coffeelint:lint', 'coffee:compile']
},
jasmine: {
files: ['src/**/*.js', 'spec/*Spec.js'],
tasks: 'jasmine:test'
}
},
uglify: {
options: {
banner:
'/**\n' +
' * <%= pkg.name %>\n' +
' * @author <%= pkg.author %>\n' +
' * @license <%= pkg.license %> <%= pkg.licenseURL %>\n' +
' * @version <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd") %>)\n' +
' * @homepage <%= pkg.homepage %>\n' +
' */\n'
},
dist: {
files: {
'dist/ruc_jquery_validator.min.js': 'src/ruc_jquery_validator.js'
}
}
}
});
// Load the plugins that provide tasks.
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-coffeelint');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
// Default task(s).
grunt.registerTask('default', ['coffeelint:lint', 'coffee:compile', 'jasmine:test']);
// Build task
grunt.registerTask('build', ['coffee:compile', 'uglify:dist', 'jasmine:dist']);
};