This repository has been archived by the owner on Feb 18, 2018. It is now read-only.
forked from wuyuntao/jquery-autosuggest
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGruntfile.coffee
134 lines (114 loc) · 3.43 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
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
129
130
131
132
133
134
#global module:false
module.exports = (grunt) ->
'use strict'
port = 40000 + Math.round(1000 * Math.random())
banner = "/*! <%= pkg.title%> - v<%= pkg.version%> - <%= grunt.template.today('yyyy-mm-dd')%>\n
* URL: <%= pkg.homepage%>\n
* Copyright (c) <%= grunt.template.today('yyyy')%> <%= pkg.author.name%>\n
* Licensed <%= grunt.util._.pluck(pkg.licenses, 'type').join(', ')%> */\n\n"
# Project configuration.
grunt.initConfig
pkg : grunt.file.readJSON('package.json')
clean :
dist : ['dist/*.*']
concat :
dist :
options :
banner : banner
src : [ 'src/jquery.autoSuggest.js' ]
dest : 'dist/jquery.autoSuggest.js'
uglify :
dist :
options :
banner : banner
files :
'dist/jquery.autoSuggest.min.js' : '<%= concat.dist.src %>'
qunit :
files : ['test/jquery.autoSuggest.html']
connect :
server :
options :
port : port
base : '.'
jshint :
files : ['test/jquery.autoSuggest*.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 :
jQuery : true
coffee :
dist :
options :
bare : false
files :
'src/jquery.autoSuggest.js' : 'src/jquery.autoSuggest.coffee'
coffeelint :
grunt :
files :
src : [ 'Gruntfile.coffee' ]
options :
'indentation' :
value : 2
'max_line_length' :
value : 120
dist :
files :
src : [ 'src/*.coffee' ]
options :
'indentation' :
value : 2
'max_line_length' :
value : 200
cssmin :
all :
src : 'dist/jquery.autoSuggest.css'
dest : 'dist/jquery.autoSuggest.min.css'
compass :
dev :
options :
sassDir : 'scss'
cssDir : 'src'
imagesDir : 'images'
noLineComments : false
force : true
debugInfo : false
relativeAssets : true
prod :
options :
sassDir : 'scss'
cssDir : 'dist'
imagesDir : 'images'
# outputstyle : 'compressed', // will be done w/ cssmin to provide a non minified version & license
noLineComments : true
force : true
debugInfo : false
relativeAssets : true
watch :
coffee :
files : '<config:coffee.dist.files>'
tasks : 'coffeelint:dist coffee:dist qunit ok'
compass :
files : 'scss/*.scss'
tasks : 'compass:dev ok'
test :
files : '<config:jshint.files>'
tasks : 'jshint qunit'
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks)
# Default task: Complete testing and building.
grunt.registerTask 'default', ['compass', 'jshint', 'coffee', 'concat', 'cssmin', 'qunit', 'uglify']
# Build task: Only building jquery.autoSuggest.min.js
grunt.registerTask 'build', ['compass', 'coffee', 'concat', 'cssmin', 'uglify']
# Test task: Only testing the code (linting and unit tests).
grunt.registerTask 'test', ['compass:dev', 'jshint', 'coffee', 'qunit']
# Travis: CI Server
grunt.registerTask 'travis', ['compass', 'jshint', 'coffee', 'concat', 'cssmin', 'qunit', 'uglify']