mirror of https://github.com/embarklabs/embark.git
move grunt-embark back to the main repo
This commit is contained in:
parent
00543f3830
commit
9115e5984a
|
@ -1,8 +1,8 @@
|
|||
module.exports = (grunt) ->
|
||||
|
||||
grunt.option 'stack', true
|
||||
grunt.loadNpmTasks "grunt-embark"
|
||||
grunt.loadTasks "tasks"
|
||||
grunt.loadTasks "node_modules/embark-framework/grunt-embark/tasks"
|
||||
|
||||
grunt.initConfig(
|
||||
files:
|
||||
|
@ -114,3 +114,4 @@ module.exports = (grunt) ->
|
|||
|
||||
grunt.registerTask "deploy", ["coffee", "deploy_contracts:"+env, "concat", "copy", "server", "watch"]
|
||||
grunt.registerTask "build", ["clean", "deploy_contracts:"+env, "coffee", "concat", "uglify", "copy"]
|
||||
|
||||
|
|
|
@ -10,8 +10,7 @@
|
|||
"license": "ISC",
|
||||
"homepage": "",
|
||||
"devDependencies": {
|
||||
"embark-framework": "^1.0.2",
|
||||
"grunt-embark": "^0.5.1",
|
||||
"embark-framework": "/Users/iurimatias/Projects/embark-framework",
|
||||
"grunt-contrib-clean": "^0.6.0",
|
||||
"grunt-contrib-coffee": "^0.13.0",
|
||||
"grunt-contrib-concat": "^0.5.1",
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
module.exports = (grunt) ->
|
||||
|
||||
grunt.initConfig
|
||||
"grunt-embark": {}
|
||||
|
||||
grunt.loadTasks "tasks"
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 embark-framework
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
# grunt-embark
|
||||
grunt plugin for [Embark](https://github.com/iurimatias/embark-framework) - DApp Framework for Ethereum
|
||||
|
||||
## Getting Started
|
||||
From the same directory as your project's Gruntfile and package.json, install
|
||||
this plugin with the following command:
|
||||
|
||||
```bash
|
||||
$ npm install embark-framework --save-dev
|
||||
$ npm install grunt-embark --save-dev
|
||||
```
|
||||
|
||||
Once that's done, add this line to your project's Gruntfile:
|
||||
|
||||
```js
|
||||
grunt.loadNpmTasks('grunt-embark');
|
||||
```
|
||||
|
||||
## Config
|
||||
Inside your `Gruntfile.js` file, add a section named `deploy`, containing
|
||||
the fields `contracts` and `dest`.
|
||||
|
||||
### Here's an example that deploys contracts and generates the js client file
|
||||
|
||||
```js
|
||||
deploy: {
|
||||
contracts: ["app/contracts/**/*.sol"],
|
||||
dest: "embark_client.js"
|
||||
}
|
||||
```
|
|
@ -0,0 +1,9 @@
|
|||
module.exports = (grunt) ->
|
||||
|
||||
grunt.registerTask "blockchain", "deploy ethereum node", (env_) =>
|
||||
env = env_ || "development"
|
||||
Embark = require('embark-framework')
|
||||
Embark.init()
|
||||
Embark.blockchainConfig.loadConfigFile('config/blockchain.yml')
|
||||
Embark.startBlockchain(env)
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
module.exports = (grunt) ->
|
||||
|
||||
grunt.registerTask "deploy_contracts", "deploy code", (env_) ->
|
||||
env = env_ || "development"
|
||||
contractFiles = grunt.file.expand(grunt.config.get("deploy.contracts"));
|
||||
destFile = grunt.config.get("deploy.dest");
|
||||
|
||||
Embark = require('embark-framework')
|
||||
Embark.init()
|
||||
Embark.blockchainConfig.loadConfigFile('config/blockchain.yml')
|
||||
Embark.contractsConfig.loadConfigFile('config/contracts.yml')
|
||||
|
||||
chainFile = Embark.blockchainConfig.blockchainConfig[env].chains || './chains.json'
|
||||
|
||||
deployed = false
|
||||
|
||||
done = @async()
|
||||
Embark.deployContracts env, contractFiles, destFile, chainFile, true, true, (abi) =>
|
||||
grunt.file.write(destFile, abi)
|
||||
|
||||
unless deployed
|
||||
deployed = true
|
||||
done()
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
module.exports = (grunt) ->
|
||||
|
||||
grunt.registerTask "ipfs", "distribute into ipfs", (env_) =>
|
||||
env = env_ || "development"
|
||||
Embark = require('embark-framework')
|
||||
Embark.release.ipfs("dist/dapp/")
|
||||
|
Loading…
Reference in New Issue