forked from mar10/jquery-ui-contextmenu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
193 lines (175 loc) · 7.54 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
#jshint node: true, camelcase: false
"use strict"
module.exports = (grunt) ->
grunt.initConfig
pkg:
grunt.file.readJSON("package.json")
connect:
demo:
options:
hostname: "*" # make accessible from everywhere
port: 8080
base: "./"
keepalive: true
dev: # pass on, so subsequent tastks (like watch) can start
options:
port: 8080
base: "./"
keepalive: false
sauce:
options:
hostname: "localhost"
port: 9999
base: ""
keepalive: false
exec:
tabfix:
# Cleanup whitespace according to http://contribute.jquery.org/style-guide/js/
# (requires https://github.com/mar10/tabfix)
cmd: "tabfix -t -r -m *.js,*.css,*.html,*.yaml -i node_modules ."
upload:
# FTP upload the demo files (requires https://github.com/mar10/pyftpsync)
cmd: "pyftpsync --progress upload . ftp://www.wwwendt.de/tech/demo/jquery-contextmenu --delete-unmatched --omit dist,node_modules,.*,_* -x"
jscs:
src: ["jquery.ui-contextmenu.js", "test/tests.js"]
options:
config: ".jscsrc"
force: true
jshint:
files: ["jquery.ui-contextmenu.js", "test/tests.js"]
options:
jshintrc: ".jshintrc"
qunit:
all: ["test/index.html", "test/index-jquery-ui-1-10.html"]
# replace: # grunt-text-replace
# production:
# src: ["build/**/*.js"]
# overwrite : true
# replacements: [ {
# from : /@DATE/g
# to : "<%= grunt.template.today('yyyy-mm-dd\"T\"HH:MM') %>"
# },{
# from : /buildType:\s*\"[a-zA-Z]+\"/g
# to : "buildType: \"production\""
# },{
# from : /debugLevel:\s*[0-9]/g
# to : "debugLevel: 1"
# } ]
# release:
# src: ["dist/**/*.js"]
# overwrite : true
# replacements: [ {
# from : /@VERSION/g
# to : "<%= pkg.version %>"
# } ]
"saucelabs-qunit":
ui_10:
options:
urls: [
# "http://localhost:9999/test/index.html",
"http://localhost:9999/test/index-jquery-ui-1-10.html"
]
# username: process.env.SAUCE_USERNAME,
# key: process.env.SAUCE_ACCESS_KEY,
build: process.env.TRAVIS_JOB_ID
throttled: 8
browsers: [
{ browserName: "chrome", platform: "Windows 7" }
{ browserName: "firefox", platform: "Windows 7" }
# { browserName: "firefox", platform: "Windows XP" }
{ browserName: "firefox", platform: "Linux" }
{ browserName: "internet explorer", version: "6", platform: "Windows XP" }
{ browserName: "internet explorer", version: "7", platform: "Windows XP" }
{ browserName: "internet explorer", version: "8", platform: "Windows 7" }
{ browserName: "internet explorer", version: "9", platform: "Windows 7" }
{ browserName: "internet explorer", version: "10", platform: "Windows 8" }
{ browserName: "internet explorer", version: "11", platform: "Windows 8.1" }
{ browserName: "safari", version: "6", platform: "OS X 10.8" }
{ browserName: "safari", version: "7", platform: "OS X 10.9" }
{ browserName: "safari", version: "8", platform: "OS X 10.10" }
]
testname: "jquery.ui-contextmenu qunit tests (jQuery UI 10)"
ui: # UI Menu 11+ dropped support for IE7
options:
urls: [
"http://localhost:9999/test/index.html",
# "http://localhost:9999/test/index-jquery-ui-1-10.html"
]
# username: process.env.SAUCE_USERNAME,
# key: process.env.SAUCE_ACCESS_KEY,
build: process.env.TRAVIS_JOB_ID
throttled: 8
browsers: [
{ browserName: "chrome", platform: "Windows 7" }
{ browserName: "firefox", platform: "Windows 7" }
{ browserName: "firefox", platform: "Windows XP" }
{ browserName: "firefox", platform: "Linux" }
# { browserName: "internet explorer", version: "6", platform: "Windows XP" }
# { browserName: "internet explorer", version: "7", platform: "Windows XP" }
{ browserName: "internet explorer", version: "8", platform: "Windows 7" }
{ browserName: "internet explorer", version: "9", platform: "Windows 7" }
{ browserName: "internet explorer", version: "10", platform: "Windows 8" }
{ browserName: "internet explorer", version: "11", platform: "Windows 8.1" }
{ browserName: "safari", version: "6", platform: "OS X 10.8" }
{ browserName: "safari", version: "7", platform: "OS X 10.9" }
{ browserName: "safari", version: "8", platform: "OS X 10.10" }
]
testname: "jquery.ui-contextmenu qunit tests (jQuery UI 11+)"
uglify:
options:
banner: "/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - " + "<%= grunt.template.today('yyyy-mm-dd') %> | " + "<%= pkg.homepage ? ' ' + pkg.homepage + ' | ' : '' %>" + " Copyright (c) <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>;" + " Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %> */\n"
report: "gzip"
build:
options:
sourceMap: true
src: "jquery.ui-contextmenu.js"
dest: "jquery.ui-contextmenu.min.js"
watch:
dev:
options:
atBegin: true
files: ["jquery.ui-contextmenu.js", "test/tests.js"]
tasks: ["jshint", "jscs"]
# jshint:
# options:
# atBegin: true
# files: ["jquery.ui-contextmenu.js"]
# tasks: ["jshint"]
yabs:
release:
common: # defaults for all tools
manifests: ['package.json', 'bower.json', 'ui-contextmenu.jquery.json']
# The following tools are run in order:
check: { branch: ['master'], canPush: true, clean: true, cmpVersion: 'gte' }
run_test: { tasks: ['test'] }
bump: {} # 'bump' also uses the increment mode `yabs:release:MODE`
run_build: { tasks: ['build'] }
commit: {}
check_after_build: { clean: true } # Fails if new files found
tag: {}
push: { tags: true, useFollowTags: true }
githubRelease:
repo: 'mar10/jquery-ui-contextmenu'
draft: false
npmPublish: {}
bump_develop: { inc: 'prepatch' }
commit_develop: { message: 'Bump prerelease ({%= version %}) [ci skip]' }
push_develop: {}
# Load "grunt*" dependencies
for key of grunt.file.readJSON("package.json").devDependencies
grunt.loadNpmTasks key if key isnt "grunt" and key.indexOf("grunt") is 0
grunt.registerTask "server", ["connect:demo"]
grunt.registerTask "dev", ["connect:dev", "watch:dev"]
grunt.registerTask "test", ["jshint", "jscs", "qunit"]
grunt.registerTask "sauce", ["connect:sauce", "saucelabs-qunit:ui", "saucelabs-qunit:ui_10"]
if parseInt(process.env.TRAVIS_PULL_REQUEST, 10) > 0
# saucelab keys do not work on forks
# http://support.saucelabs.com/entries/25614798
grunt.registerTask "travis", ["test"]
else
grunt.registerTask "travis", ["test", "sauce"]
grunt.registerTask "default", ["test"]
# "sauce",
grunt.registerTask "build", ["exec:tabfix", "test", "uglify"]
grunt.registerTask "upload", ["build", "exec:upload"]
grunt.registerTask "server", ["connect:demo"]