Skip to content

Commit dea23c7

Browse files
committed
Updated newer zepto build method (npm instead of rake). Clean zepto dist and fixed silent error. Should fix Travis.
1 parent 3fb20f0 commit dea23c7

File tree

3 files changed

+36
-23
lines changed

3 files changed

+36
-23
lines changed

Gruntfile.coffee

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = (grunt) ->
2+
extend = require('util')._extend
23

34
# Project configuration.
45
grunt.initConfig
@@ -46,6 +47,7 @@ module.exports = (grunt) ->
4647
build: ["<%= dirs.build %>"]
4748
dist: ["<%= dirs.dist %>"]
4849
package: ["<%= dirs.package%>"]
50+
zepto: ["submodules/zepto/dist"]
4951

5052
coffee:
5153
jqt:
@@ -140,7 +142,7 @@ module.exports = (grunt) ->
140142
files: [
141143
expand: yes
142144
cwd: 'submodules/zepto/dist/'
143-
src: 'zepto.js'
145+
src: ['zepto.js', 'zepto.min.js']
144146
dest: '<%= dirs.build %>/lib/zepto'
145147
,
146148
src: 'submodules/zepto/src/touch.js'
@@ -178,11 +180,14 @@ module.exports = (grunt) ->
178180
expand: true
179181
]
180182

181-
rake:
183+
"npm-command":
182184
zepto:
183-
params: "concat[fx:ajax:data:detect:event:form:polyfill:touch]"
185+
command: "run-script"
186+
script: "dist"
187+
params: ""
184188
options:
185189
cwd: "submodules/zepto"
190+
env: extend(process.env, {'MODULES': 'zepto event ajax form ie detect fx data touch'})
186191

187192
compass:
188193
compile:
@@ -317,18 +322,25 @@ module.exports = (grunt) ->
317322
grunt.loadNpmTasks "grunt-contrib-compress"
318323
grunt.loadNpmTasks "grunt-update-submodules"
319324

320-
grunt.registerMultiTask "rake", "Compile a Ruby Package with Rake", ->
325+
grunt.registerMultiTask "npm-command", "Run an NPM command in a specific module", ->
321326
cb = @async() # Tell grunt the task is async
322-
options = @data["options"]
327+
command = @data["command"]
323328
params = grunt.template.process(@data["params"])
324-
exec = require("child_process").exec
325-
child = exec("rake " + params + "", options, (error, stdout, stderr) ->
326-
console.log "stdout: " + stdout if stdout
329+
script = grunt.template.process(@data["script"])
330+
options = @data["options"]
327331

332+
exec = require("child_process").exec
333+
child = exec("npm install", options, (error, stdout, stderr) ->
334+
grunt.log.write stdout if stdout
335+
grunt.log.error stdout if stderr
328336
if error isnt null
329-
console.log "error: " + error
330-
console.log "stderr: " + stdout
331-
cb() # Execute the callback when the async task is done
337+
cb(error) # Execute the callback when the async task is done
338+
else
339+
child = exec(["npm", command, script, params].join(' '), options, (error, stdout, stderr) ->
340+
grunt.log.write stdout if stdout
341+
grunt.log.error stdout if stderr
342+
cb(error) # Execute the callback when the async task is done
343+
)
332344
)
333345

334346
grunt.registerTask "git-describe", "Describes current git commit", ->
@@ -357,7 +369,7 @@ module.exports = (grunt) ->
357369
grunt.renameTask 'watch', 'watch_files'
358370

359371
# Git submodule updates
360-
grunt.registerTask 'zepto', ['rake', 'copy:zepto', 'copy:jquery-bridge']
372+
grunt.registerTask 'zepto', ['clean:zepto', 'npm-command:zepto', 'copy:zepto', 'copy:jquery-bridge']
361373

362374
# Compile Scripts
363375
grunt.registerTask 'scripts', ['coffee', 'copy:prepare', 'concat', 'zepto']

package.json

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,22 @@
3131
},
3232
"dependencies": {},
3333
"devDependencies": {
34-
"grunt-update-submodules": "~0.2.0",
3534
"grunt": "~0.4.2",
36-
"grunt-contrib-copy": "~0.5.0",
37-
"grunt-contrib-concat": "~0.3.0",
38-
"grunt-contrib-compass": "~0.7.2",
35+
"grunt-contrib": "~0.9.0",
3936
"grunt-contrib-clean": "~0.5.0",
40-
"grunt-contrib-qunit": "~0.4.0",
41-
"grunt-contrib-uglify": "~0.3.2",
4237
"grunt-contrib-coffee": "~0.10.1",
43-
"grunt-contrib-watch": "~0.5.3",
44-
"grunt-contrib-jshint": "~0.8.0",
38+
"grunt-contrib-compass": "~0.7.2",
4539
"grunt-contrib-compress": "~0.6.1",
40+
"grunt-contrib-concat": "~0.3.0",
41+
"grunt-contrib-copy": "~0.5.0",
4642
"grunt-contrib-cssmin": "~0.7.0",
47-
"grunt-contrib": "~0.9.0",
48-
"grunt-coverjs": "~0.1.0"
43+
"grunt-contrib-jshint": "~0.8.0",
44+
"grunt-contrib-qunit": "~0.4.0",
45+
"grunt-contrib-uglify": "~0.3.2",
46+
"grunt-contrib-watch": "~0.5.3",
47+
"grunt-coverjs": "~0.1.0",
48+
"grunt-update-submodules": "~0.2.0",
49+
"shelljs": "^0.3.0"
4950
},
5051
"optionalDependencies": {},
5152
"scripts": {

0 commit comments

Comments
 (0)