Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make use of profiles to minimize downstream dependencies #13

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## All rights reserved.
##

all: compile escript doc etest rel
all: compile escript etest doc rel

compile:
rebar3 compile
Expand All @@ -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
16 changes: 8 additions & 8 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
12 changes: 9 additions & 3 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -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, [
Expand All @@ -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}}]}
]}
]}.

Expand Down
2 changes: 1 addition & 1 deletion src/atomvm_packbeam.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -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"}]}
]
Expand Down
Loading