-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
57 lines (45 loc) · 1.36 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
matchdep = require "matchdep"
module.exports = (grunt) ->
basepath = grunt.file.readJSON("filepath.json")
filepath =
cs : basepath.cs
mm : basepath.mm
jar : basepath.jar
xml : basepath.xml
bundle : basepath.bundle
xcode : basepath.xcode
config =
pkg: grunt.file.readJSON "package.json"
exec:
cp:
cmd: (from, to) ->
return "cp -rf #{from} #{to}"
esteWatch:
options:
dirs: [
"build/Packager/Assets/Plugins/**/"
"plugins/**/"
]
livereload:
enabled: false
cs: (file) ->
return ["exec:cp:#{file}:#{filepath.cs}"]
mm: (file) ->
task = [
"exec:cp:#{file}:#{filepath.mm}"
"exec:cp:#{file}:#{filepath.xcode.mm}"
]
return task
jar: (file) ->
return ["exec:cp:#{file}:#{filepath.jar}"]
xml: (file) ->
return ["exec:cp:#{file}:#{filepath.xml}"]
bundle: (file) ->
return ["exec:cp:#{file}:#{filepath.bundle}"]
grunt.initConfig config
matchdep.filterDev("grunt-*").forEach grunt.loadNpmTasks
grunt.registerTask "default", ["esteWatch"]
grunt.registerTask "watch", "watching \.(cs|mm|jar|bundle) files.", ->
console.log "environment : %s", opts.env
console.log "livereload : %s", opts.livereload
grunt.task.run "esteWatch"