From ab683eefbc88a6b032165bc54d3c607e3305926e Mon Sep 17 00:00:00 2001 From: hswick Date: Sun, 22 Apr 2018 16:45:23 -0500 Subject: [PATCH] Added simple mix task to compile solidity test files --- README.md | 2 +- mix.exs | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d0bec99..17545b3 100644 --- a/README.md +++ b/README.md @@ -26,5 +26,5 @@ solc --version Then if you've made changes to the example contracts you can compile them like this: ``` -solc -o test/examples/build --abi --bin test/examples/contracts/* --overwrite +mix solc ``` \ No newline at end of file diff --git a/mix.exs b/mix.exs index 6651813..58b48c5 100644 --- a/mix.exs +++ b/mix.exs @@ -56,3 +56,13 @@ defmodule ExW3.MixProject do ] end end + +defmodule Mix.Tasks.Solc do + use Mix.Task + + @shortdoc "Runs the solc compiler to create binary and abi of all contracts. Outputs to build directory" + def run(_) do + # calling our Hello.say() function from earlier + Mix.Shell.IO.cmd("solc -o test/examples/build --abi --bin test/examples/contracts/* --overwrite") + end +end \ No newline at end of file