From 362373c0d7bd34474c8a28e2fd65e59f42cfe45d Mon Sep 17 00:00:00 2001 From: Hans Svensson Date: Wed, 30 Jan 2019 10:55:11 +0100 Subject: [PATCH] Add escript post_hooks --- rebar.config | 19 ++++++++++++++----- src/aeso_compiler.erl | 2 -- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/rebar.config b/rebar.config index 03d2d8b..f2e5106 100644 --- a/rebar.config +++ b/rebar.config @@ -1,15 +1,24 @@ {erl_opts, [debug_info]}. -{escript_name, aesophia}. - -{provider_hooks, [{post, [{compile, escriptize}]}]}. - -%% NOTE: When possible deps are referenced by Git ref to ensure consistency between builds. {deps, [ {aebytecode, {git, "https://github.com/aeternity/aebytecode.git", {ref,"99bf097"}}} , {getopt, "1.0.1"} ]}. +{escript_incl_apps, [aesophia, aebytecode, getopt]}. +{escript_main_app, aesophia}. +{escript_name, aesophia}. +{escript_emu_args, "%%! +sbtu +A0\n"}. +{provider_hooks, [{post, [{compile, escriptize}]}]}. + +{post_hooks, [{"(linux|darwin|solaris|freebsd|netbsd|openbsd)", + escriptize, + "cp \"$REBAR_BUILD_DIR/bin/aesophia\" ./aesophia"}, + {"win32", + escriptize, + "robocopy \"%REBAR_BUILD_DIR%/bin/\" ./ aesophia* " + "/njs /njh /nfl /ndl & exit /b 0"} % silence things + ]}. {dialyzer, [ {warnings, [unknown]}, diff --git a/src/aeso_compiler.erl b/src/aeso_compiler.erl index ca496ab..92d9afe 100644 --- a/src/aeso_compiler.erl +++ b/src/aeso_compiler.erl @@ -255,5 +255,3 @@ read_contract(Name) -> {ok, Bin} = file:read_file(Name), binary_to_list(Bin). -contract_path() -> - "apps/aesophia/test/contracts".