-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
117 lines (94 loc) · 2.79 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
module.exports = (grunt) ->
grunt.option 'stack', true
grunt.loadNpmTasks "grunt-embark"
grunt.loadTasks "tasks"
grunt.initConfig(
files:
web3:
"node_modules/embark-framework/js/web3.js"
js:
src: [
"app/js/jquery*.js"
"app/js/**/*.js"
]
css:
src: [
"app/css/**/*.css"
]
html:
src: [
"app/html/**/*.html"
]
coffee:
dest: "generated/dapp/compiled-coffee"
compiled: [
"generated/dapp/compiled-coffee/app.coffee"
"generated/dapp/compiled-coffee/**/*.js"
]
contracts:
src: [
"app/contracts/**/*.sol"
"app/contracts/**/*.se"
]
coffee:
compile:
expand: true
cwd: 'coffee'
src: '**/*.coffee'
dest: '<%= files.coffee.dest %>'
ext: '.js'
concat:
app:
src: ["<%= files.web3 %>", 'generated/tmp/abi.js', "<%= files.js.src %>", "<%= files.coffee.compiled %>"]
dest: "generated/dapp/js/app.min.js"
css:
src: "<%= files.css.src %>"
dest: "generated/dapp/css/app.min.css"
watch:
options:
livereload: true
html:
files: ["<%= files.html.src %>"]
tasks: ["copy"]
js:
files: ["<%= files.js.src %>"]
tasks: ["concat"]
css:
files: ["<%= files.css.src %>"]
tasks: ["concat"]
coffee:
files: ["coffee/**/*.coffee"]
tasks: ["coffee", "concat"]
contracts:
files: ["<%= files.contracts.src %>"]
tasks: ["deploy", "concat", "copy"]
config:
files: ["config/blockchain.yml", "config/contracts.yml"]
tasks: ["deploy", "concat", "copy"]
copy:
html:
files:
"generated/dapp/index.html" : "<%= files.html.src %>"
"dist/dapp/index.html" : "<%= files.html.src %>"
css:
files:
"dist/dapp/css/app.min.css" : "<%= files.css.src %>"
contracts:
files:
"dist/contracts/": '<%= files.contracts.src %>'
uglify:
dist:
src: "<%= concat.app.dest %>" # input from the concat process
dest: "dist/dapp/js/app.min.js"
clean:
workspaces: ["dist", "generated"]
deploy:
contracts: '<%= files.contracts.src %>'
dest: 'generated/tmp/abi.js'
)
# loading external tasks (aka: plugins)
# Loads all plugins that match "grunt-", in this case all of our current plugins
require('matchdep').filterAll('grunt-*').forEach(grunt.loadNpmTasks)
env = grunt.option('env')
grunt.registerTask "deploy", ["coffee", "deploy_contracts:"+env, "concat", "copy", "server", "watch"]
grunt.registerTask "build", ["clean", "deploy_contracts:"+env, "coffee", "concat", "uglify", "copy"]