-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.coffee
101 lines (84 loc) · 2.74 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
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
module.exports = ->
@initConfig
pkg: @file.readJSON 'package.json'
jshint:
all: [ 'Gruntfile.coffe', 'src/*.js', 'test/suites/*.js' ]
options:
jshintrc: '.jshintrc'
uglify:
options:
report: 'gzip'
banner: '/*! <%= pkg.name %> v<%= pkg.version %> | <%= pkg.license %> License | github.com/frqnck/apt.js */'
mangle: { reserved: ['a', 'p', 't', '$'], toplevel: true }
# core:
# files:
# 'dist/apt.min.js': ['src/apt-core.js', 'src/apt-event.js', 'src/apt-dom.js', 'src/apt-src.js', 'src/apt-ajax.js']
shims:
options:
banner: '/*! apt-shims.js v<%= pkg.version %> | <%= pkg.license %> License | github.com/frqnck/apt.js */'
files:
'dist/apt-shims.min.js': ['src/extra/apt-shims.js']
utils:
options:
banner: '/*! apt-utils.js v<%= pkg.version %> | <%= pkg.license %> License | github.com/frqnck/apt.js */'
files:
'dist/apt-utils.min.js': ['src/extra/apt-utils.js']
dist:
files:
'dist/apt.min.js': ['dist/apt.js']
compress:
main:
options:
mode: 'gzip'
files: [
expand: true,
src: ['dist/*.min.js'],
dest: '.',
ext: '.min.js.gz'
]
connect:
rootServer:
options:
port: 9000,
base: '.'
qunit:
all:
options:
'--web-security': 'no',
urls: [
'http://localhost:9000/test/index-src.html'
]
coverage:
disposeCollector: true,
src: ['src/*.js'],
instrumentedFiles: 'tmp/',
htmlReport: 'report/coverage',
coberturaReport: 'report/',
linesThresholdPct: 85
all: ['test/*.html']
shell:
dist:
command: './build-dist.sh'
comments:
dist:
options:
singleline: true,
multiline: true,
keepSpecialComments: false
src: [ 'dist/apt.js' ]
@loadNpmTasks 'grunt-contrib-jshint'
@loadNpmTasks 'grunt-contrib-uglify'
@loadNpmTasks 'grunt-contrib-connect'
@loadNpmTasks 'grunt-contrib-compress'
@loadNpmTasks 'grunt-shell'
@loadNpmTasks 'grunt-contrib-qunit'
@loadNpmTasks 'grunt-stripcomments'
# @loadNpmTasks 'grunt-qunit-istanbul'
@registerTask 'lint', ['jshint']
@registerTask 'test', ['connect', 'qunit']
# @registerTask 'build-core', ['uglify:core']
@registerTask 'build-utils', ['uglify:utils']
@registerTask 'build-shims', ['uglify:shims']
@registerTask 'build-apt.js', ['shell:dist', 'comments:dist', 'uglify:dist']
@registerTask 'build', ['build-apt.js', 'uglify:utils', 'uglify:shims']
@registerTask 'default', ['lint', 'test']