Skip to content

Commit

Permalink
Add relx stanzas to create a standalone release of the packbeam utility.
Browse files Browse the repository at this point in the history
Signed-off-by: Fred Dushin <[email protected]>
  • Loading branch information
fadushin committed Oct 12, 2023
1 parent be939d9 commit 9ef5f36
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 6 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.6.2] (Unreleased)

- Add `relx` stanzas to create a standalone release of the `packbeam` utility

## [0.6.1]

- Added `extract` sub-command
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## All rights reserved.
##

all: compile escript edoc etest
all: compile escript edoc etest release

compile:
rebar3 compile
Expand All @@ -19,6 +19,10 @@ etest:
rebar3 proper --cover
rebar3 cover --verbose

release:
rebar3 release
rebar3 tar

clean:
rm -rf _build

Expand Down
22 changes: 20 additions & 2 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
{erl_opts, [no_debug_info]}.
{deps, []}.

{escript_incl_apps, [packbeam]}.
{escript_main_app, packbeam}.
{escript_incl_apps, [atomvm_packbeam]}.
{escript_main_app, atomvm_packbeam}.
{escript_name, packbeam}.
{escript_emu_args, "%%! +sbtu +A1\n"}.

Expand All @@ -28,3 +28,21 @@
]}
]}
]}.

{relx, [
{release, {atomvm_packbeam, "0.6.1"}, [
kernel,
stdlib,
atomvm_packbeam
]},
{mode, prod},
{generate_start_script, false},
{overlay, [
{copy, "src/packbeam.erl", "bin/packbeam.escript"}
]}
]}.

%% copy and rename escript next to `packbeam.escript` (See escript man page)
{post_hooks, [
{release, "cp ${REBAR_BUILD_DIR}/rel/atomvm_packbeam/erts-${ERLANG_ERTS_VER}/bin/escript ${REBAR_BUILD_DIR}/rel/atomvm_packbeam/bin/packbeam"}
]}.
2 changes: 1 addition & 1 deletion src/packbeam.app.src → src/atomvm_packbeam.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
%%
{
application,
packbeam,
atomvm_packbeam,
[
{description,
"An escript and library to manipulate (create, list, delete) AtomVM PackBeam files"},
Expand Down
2 changes: 1 addition & 1 deletion test/prop_packbeam.erl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
-include_lib("proper/include/proper.hrl").

-define(BUILD_DIR, "_build/").
-define(TEST_BEAM_DIR, "_build/test/lib/packbeam/test/").
-define(TEST_BEAM_DIR, "_build/test/lib/atomvm_packbeam/test/").


%%
Expand Down
2 changes: 1 addition & 1 deletion test/test_packbeam.erl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
-include_lib("eunit/include/eunit.hrl").

-define(BUILD_DIR, "_build/").
-define(TEST_BEAM_DIR, "_build/test/lib/packbeam/test/").
-define(TEST_BEAM_DIR, "_build/test/lib/atomvm_packbeam/test/").

packbeam_create_simple_test() ->
AVMFile = dest_dir("packbeam_create_simple_test.avm"),
Expand Down

0 comments on commit 9ef5f36

Please sign in to comment.