From 496ab508201cd802f181465618dbd3fd0a565437 Mon Sep 17 00:00:00 2001 From: Fred Dushin Date: Sat, 18 Nov 2023 09:43:06 -0500 Subject: [PATCH] Make use of profiles to minimize downstream dependencies Signed-off-by: Fred Dushin --- Makefile | 22 +++++++++++++--------- install.sh | 16 ++++++++-------- rebar.config | 12 +++++++++--- src/atomvm_packbeam.app.src | 2 +- 4 files changed, 31 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index 588eb25..1bea918 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ ## All rights reserved. ## -all: compile escript doc etest rel +all: compile escript etest doc rel compile: rebar3 compile @@ -12,19 +12,23 @@ escript: rebar3 escriptize doc: - rebar3 ex_doc + rebar3 as doc ex_doc etest: - rebar3 eunit --cover - rebar3 proper --cover - rebar3 cover --verbose + rebar3 as test eunit --cover + rebar3 as test proper --cover + rebar3 as test cover --verbose rel: - rebar3 release - rebar3 tar + rebar3 as prod release + rebar3 as prod tar + rm -rf x + mkdir x + PACKBEAM_DEBUG=1 ./install.sh x 0.7.1 + x/bin/packbeam version clean: rm -rf _build -publish: - rebar3 hex publish +publish: doc + rebar3 as publish hex publish --doc-dir docs diff --git a/install.sh b/install.sh index 188bb1c..08248b5 100755 --- a/install.sh +++ b/install.sh @@ -65,30 +65,30 @@ if [ ! -e "${prefix}" ]; then fi echo_run() { - local cmd="$@" + cmd="$@" if [ -n "${PACKBEAM_DEBUG}" ]; then echo "# $(date) [$(hostname)]> ${cmd}" fi ${cmd} } -readonly src_tar="${root_dir}/_build/default/rel/atomvm_packbeam/atomvm_packbeam-${version}.tar.gz" +readonly src_tar="${root_dir}/_build/prod/rel/atomvm_packbeam/atomvm_packbeam-${version}.tar.gz" if [ ! -e "${src_tar}" ]; then echo "ERROR! It looks like atomvm_packbeam version ${version} has not been built!" exit 1 fi -## unzip the archive (so that BSD tar can deal with it) -readonly tmp_dir="$(mktemp -d /tmp/atomvm_packbeam.XXXXXX)" -echo_run cp "${src_tar}" "${tmp_dir}/." -echo_run gunzip "${tmp_dir}/atomvm_packbeam-${version}.tar.gz" - readonly dest_dir="${prefix}/atomvm_packbeam" -if [ $(${dest_dir}/bin/packbeam version) = ${version} ]; then +if [ -e "${dest_dir}/bin/packbeam" ] && [ "$(${dest_dir}/bin/packbeam version)" == "${version}" ]; then echo "ERROR! It looks like ${version} is already installed!" exit 1 fi +## unzip the archive (so that BSD tar can deal with it) +readonly tmp_dir="$(mktemp -d /tmp/atomvm_packbeam.XXXXXX)" +echo_run cp "${src_tar}" "${tmp_dir}/." +echo_run gunzip "${tmp_dir}/atomvm_packbeam-${version}.tar.gz" + echo_run mkdir -p "${dest_dir}" echo_run tar -C "${dest_dir}" -x -f "${tmp_dir}/atomvm_packbeam-${version}.tar" diff --git a/rebar.config b/rebar.config index 89ecb11..a59792d 100644 --- a/rebar.config +++ b/rebar.config @@ -25,8 +25,6 @@ {api_reference, true}, {skip_undefined_reference_warnings_on, ["README.md"]} ]}. -{hex, [{doc, #{provider => ex_doc}}]}. -{plugins, [rebar3_hex, rebar3_proper, rebar3_ex_doc]}. %% Profiles {profiles, [ @@ -35,7 +33,15 @@ {cover_enabled, true}, {deps, [ {proper, "1.4.0"} - ]} + ]}, + {plugins, [rebar3_proper]} + ]}, + {doc, [ + {plugins, [rebar3_ex_doc]} + ]}, + {publish, [ + {plugins, [rebar3_hex, rebar3_ex_doc]}, + {hex, [{doc, #{provider => ex_doc}}]} ]} ]}. diff --git a/src/atomvm_packbeam.app.src b/src/atomvm_packbeam.app.src index 2b96c12..7974c79 100644 --- a/src/atomvm_packbeam.app.src +++ b/src/atomvm_packbeam.app.src @@ -25,7 +25,7 @@ {applications, [kernel, stdlib]}, {env, []}, {modules, [packbeam_api]}, - {licenses, ["Apache 2.0"]}, + {licenses, ["Apache-2.0"]}, {pkg_name, "atomvm_packbeam"}, {links, [{"github", "https://github.com/atomvm/atomvm_packbeam"}]} ]