forked from hammerjs/hammer.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.coffee
105 lines (93 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
102
103
104
105
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
meta:
banner: '
/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n
* <%= pkg.homepage %>\n
*\n
* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> <<%= pkg.author.email %>>;\n
* Licensed under the <%= _.pluck(pkg.licenses, "type").join(", ") %> license */\n\n'
concat:
options:
separator: '\n\n'
build:
options:
banner: '<%= meta.banner %>'
src: [
'src/hammer.prefix'
'src/setup.js'
'src/utils.js'
'src/event.js'
'src/pointerevent.js'
'src/detection.js'
'src/instance.js'
'src/gestures/*.js'
'src/export.js'
'src/hammer.suffix']
dest: 'hammer.js'
uglify:
options:
report: 'gzip'
sourceMap: 'hammer.min.map'
banner: '<%= meta.banner %>'
build:
files:
'hammer.min.js': ['hammer.js']
'string-replace':
version:
files:
'hammer.js': 'hammer.js'
options:
replacements: [
pattern: '{{PKG_VERSION}}'
replacement: '<%= pkg.version %>'
]
jshint:
options:
jshintrc: true
build:
src: ['hammer.js', 'plugins/*.js']
jscs:
src: ['src/**/*.js', 'plugins/**/*.js']
options:
force: true
watch:
scripts:
files: ['src/**/*.js']
tasks: ['concat','string-replace','uglify','jshint','jscs']
options:
interrupt: true
connect:
server:
options:
hostname: "0.0.0.0"
port: 8000
qunit:
all: ['tests/unit/**/*.html']
yuidoc:
build:
name: '<%= pkg.title %>'
description: '<%= pkg.description %>'
version: '<%= pkg.version %>'
url: '<%= pkg.homepage %>'
options:
linkNatives: true
paths: 'src/'
outdir: 'docs/'
themedir: 'misc/docstheme/'
# Load tasks
grunt.loadNpmTasks 'grunt-contrib-concat'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-jshint'
grunt.loadNpmTasks 'grunt-contrib-connect'
grunt.loadNpmTasks 'grunt-contrib-qunit'
grunt.loadNpmTasks 'grunt-contrib-yuidoc'
grunt.loadNpmTasks 'grunt-string-replace'
grunt.loadNpmTasks 'grunt-jscs-checker'
# Default task(s).
grunt.registerTask 'default', ['connect','watch']
grunt.registerTask 'build', ['concat','string-replace','uglify','yuidoc','test']
grunt.registerTask 'test', ['jshint','jscs','qunit']
grunt.registerTask 'test-travis', ['build']