forked from excellenteasy/iscroll-sticky
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
83 lines (69 loc) · 1.71 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
'use strict'
# Constants
MODULES_DIR = 'src'
BUILD_DIR = 'build'
DIST_DIR = 'dist'
GRUNTFILE = 'Gruntfile.coffee'
TMP_DIR = 'tmp'
module.exports = (grunt) ->
grunt.initConfig
bower:
install:
cleanup: yes
copy: no
clean:
build: [BUILD_DIR]
dist: [DIST_DIR]
tmp: TMP_DIR
lib: 'lib'
coffee:
dist:
options:
sourceMap: yes
join: yes
src: '<%= coffeelint.src.files.src %>'
dest: "#{DIST_DIR}/iscroll-sticky.js"
coffeelint:
options:
newlines_after_classes:
level: 'error'
no_empty_param_list:
level: 'error'
no_stand_alone_at:
level: 'error'
src:
files: src: ["#{MODULES_DIR}/iscroll-sticky.coffee"]
max_line_length:
value: 79
level: 'error'
gruntfile:
files: src: [GRUNTFILE]
shell:
options:
stderr : true
stdout : true
failOnError : true
semver:
command: './node_modules/semver-sync/bin/semver-sync -v'
hooks:
command: 'cp -R ./hooks ./.git/'
watch:
lib:
files: ['<%= coffeelint.gruntfile.files.src %>', "#{MODULES_DIR}/**"]
tasks: ['build']
# Load grunt-* plugins
require('matchdep').filterDev('grunt-*').forEach grunt.loadNpmTasks
grunt.registerTask 'build', [
'clean:build'
'coffee']
grunt.registerTask 'dist', [
'clean:dist'
'coffee']
grunt.registerTask 'default', ['build']
grunt.registerTask 'dev', [
'bower:install'
'clean:lib'
'shell:hooks'
'build'
'watch']
grunt.registerTask 'precommit', ['shell:semver', 'coffeelint', 'dist']