Skip to content

Commit 48cbbc4

Browse files
authored
Merge pull request #13 from atomvm/profiles
2 parents d94b4cd + 496ab50 commit 48cbbc4

File tree

4 files changed

+31
-21
lines changed

4 files changed

+31
-21
lines changed

Makefile

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## All rights reserved.
44
##
55

6-
all: compile escript doc etest rel
6+
all: compile escript etest doc rel
77

88
compile:
99
rebar3 compile
@@ -12,19 +12,23 @@ escript:
1212
rebar3 escriptize
1313

1414
doc:
15-
rebar3 ex_doc
15+
rebar3 as doc ex_doc
1616

1717
etest:
18-
rebar3 eunit --cover
19-
rebar3 proper --cover
20-
rebar3 cover --verbose
18+
rebar3 as test eunit --cover
19+
rebar3 as test proper --cover
20+
rebar3 as test cover --verbose
2121

2222
rel:
23-
rebar3 release
24-
rebar3 tar
23+
rebar3 as prod release
24+
rebar3 as prod tar
25+
rm -rf x
26+
mkdir x
27+
PACKBEAM_DEBUG=1 ./install.sh x 0.7.1
28+
x/bin/packbeam version
2529

2630
clean:
2731
rm -rf _build
2832

29-
publish:
30-
rebar3 hex publish
33+
publish: doc
34+
rebar3 as publish hex publish --doc-dir docs

install.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,30 +65,30 @@ if [ ! -e "${prefix}" ]; then
6565
fi
6666

6767
echo_run() {
68-
local cmd="$@"
68+
cmd="$@"
6969
if [ -n "${PACKBEAM_DEBUG}" ]; then
7070
echo "# $(date) [$(hostname)]> ${cmd}"
7171
fi
7272
${cmd}
7373
}
7474

75-
readonly src_tar="${root_dir}/_build/default/rel/atomvm_packbeam/atomvm_packbeam-${version}.tar.gz"
75+
readonly src_tar="${root_dir}/_build/prod/rel/atomvm_packbeam/atomvm_packbeam-${version}.tar.gz"
7676
if [ ! -e "${src_tar}" ]; then
7777
echo "ERROR! It looks like atomvm_packbeam version ${version} has not been built!"
7878
exit 1
7979
fi
8080

81-
## unzip the archive (so that BSD tar can deal with it)
82-
readonly tmp_dir="$(mktemp -d /tmp/atomvm_packbeam.XXXXXX)"
83-
echo_run cp "${src_tar}" "${tmp_dir}/."
84-
echo_run gunzip "${tmp_dir}/atomvm_packbeam-${version}.tar.gz"
85-
8681
readonly dest_dir="${prefix}/atomvm_packbeam"
87-
if [ $(${dest_dir}/bin/packbeam version) = ${version} ]; then
82+
if [ -e "${dest_dir}/bin/packbeam" ] && [ "$(${dest_dir}/bin/packbeam version)" == "${version}" ]; then
8883
echo "ERROR! It looks like ${version} is already installed!"
8984
exit 1
9085
fi
9186

87+
## unzip the archive (so that BSD tar can deal with it)
88+
readonly tmp_dir="$(mktemp -d /tmp/atomvm_packbeam.XXXXXX)"
89+
echo_run cp "${src_tar}" "${tmp_dir}/."
90+
echo_run gunzip "${tmp_dir}/atomvm_packbeam-${version}.tar.gz"
91+
9292
echo_run mkdir -p "${dest_dir}"
9393
echo_run tar -C "${dest_dir}" -x -f "${tmp_dir}/atomvm_packbeam-${version}.tar"
9494

rebar.config

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
{api_reference, true},
2626
{skip_undefined_reference_warnings_on, ["README.md"]}
2727
]}.
28-
{hex, [{doc, #{provider => ex_doc}}]}.
29-
{plugins, [rebar3_hex, rebar3_proper, rebar3_ex_doc]}.
3028

3129
%% Profiles
3230
{profiles, [
@@ -35,7 +33,15 @@
3533
{cover_enabled, true},
3634
{deps, [
3735
{proper, "1.4.0"}
38-
]}
36+
]},
37+
{plugins, [rebar3_proper]}
38+
]},
39+
{doc, [
40+
{plugins, [rebar3_ex_doc]}
41+
]},
42+
{publish, [
43+
{plugins, [rebar3_hex, rebar3_ex_doc]},
44+
{hex, [{doc, #{provider => ex_doc}}]}
3945
]}
4046
]}.
4147

src/atomvm_packbeam.app.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
{applications, [kernel, stdlib]},
2626
{env, []},
2727
{modules, [packbeam_api]},
28-
{licenses, ["Apache 2.0"]},
28+
{licenses, ["Apache-2.0"]},
2929
{pkg_name, "atomvm_packbeam"},
3030
{links, [{"github", "https://github.com/atomvm/atomvm_packbeam"}]}
3131
]

0 commit comments

Comments
 (0)