forked from bergie/create
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
64 lines (55 loc) · 1.61 KB
/
Gruntfile.coffee
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
module.exports = ->
banner = """/* Create.js <%= pkg.version %> - Inline editing toolkit
by Henri Bergius and contributors. Available under the MIT license.
See http://createjs.org for more information
*/"""
# Project configuration
@initConfig
pkg: @file.readJSON 'package.json'
# Build setup: concatenate source files
concat:
options:
stripBanners: true
banner: banner
full:
src: [
'src/*.js'
'src/**/*.js'
'locale/*.js'
]
dest: 'examples/create.js'
edit:
src: [
'src/jquery.Midgard.midgardEditable.js'
'src/jquery.Midgard.midgardStorage.js'
'src/collectionWidgets/*.js'
'src/editingWidgets/*.js'
]
dest: 'examples/create-editonly.js'
# JavaScript minification
uglify:
options:
banner: banner
report: 'min'
full:
files:
'examples/create.min.js': ['examples/create.js']
edit:
files:
'examples/create-editonly.min.js': ['examples/create-editonly.js']
# Coding standards verification
jshint:
all: ['src/*.js', 'src/**/*.js', 'locale/*.js']
# Unit tests
qunit:
all: ['test/*.html']
# Build dependencies
@loadNpmTasks 'grunt-contrib-concat'
@loadNpmTasks 'grunt-contrib-uglify'
# Testing dependencies
@loadNpmTasks 'grunt-contrib-jshint'
@loadNpmTasks 'grunt-contrib-qunit'
# Local tasks
@registerTask 'build', ['concat:full', 'uglify:full']
@registerTask 'editonly', ['concat:edit', 'uglify:edit']
@registerTask 'test', ['jshint', 'build', 'qunit']