embark/boilerplate/Gruntfile.coffee

117 lines
2.8 KiB
CoffeeScript
Raw Normal View History

2015-05-24 12:58:17 +00:00
module.exports = (grunt) ->
2015-09-24 10:03:17 +00:00
grunt.option 'stack', true
2015-07-14 23:43:21 +00:00
grunt.loadNpmTasks "grunt-embark"
2015-07-23 02:32:30 +00:00
grunt.loadTasks "tasks"
2015-05-24 12:58:17 +00:00
grunt.initConfig(
2015-07-14 23:43:21 +00:00
files:
web3:
"node_modules/embark-framework/js/web3.js"
js:
src: [
"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"
2015-09-01 01:58:39 +00:00
"app/contracts/**/*.se"
2015-07-14 23:43:21 +00:00
]
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:
2015-08-01 02:53:27 +00:00
files: ["<%= files.css.src %>"]
2015-07-14 23:43:21 +00:00
tasks: ["concat"]
coffee:
files: ["coffee/**/*.coffee"]
tasks: ["coffee", "concat"]
contracts:
files: ["<%= files.contracts.src %>"]
tasks: ["deploy", "concat", "copy"]
2015-08-02 11:59:59 +00:00
config:
files: ["config/blockchain.yml", "config/contracts.yml"]
tasks: ["deploy", "concat", "copy"]
2015-07-14 23:43:21 +00:00
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)
2015-11-20 15:46:49 +00:00
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"]