You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,7 @@ The [`rebar3`](https://rebar3.org) plugin provides the following tasks under the
69
69
*`version` Print the version of the [`atomvm_rebar3_plugin`](https://atomvm.github.io/atomvm_rebar3_plugin) to the console.
70
70
*`bootstrap` Compile Erlang files that `rebar3` otherwise cannot compile. Typically, such files include modules from the OTP `kernel` or `stdlib` application that `rebar3` uses internally for its own implementation.
71
71
*`dialyzer` Use dialyzer for static analysis of AtomVM applications.
72
+
*`escriptize` Generate a standalone binary for the current host, using AtomVM.
72
73
73
74
> IMPORTANT! Some of the above tasks were previously located under the default [`rebar3`](https://rebar3.org) namespace; however, the commands under the default namespace have been DEPRECATED. Users will get a warning message on the console when using deprecated tasks, and any deprecated tasks may be removed in the future without warning. Be sure to migrate any scripts or code you have to use the `atomvm` namespace.
74
75
@@ -615,7 +616,29 @@ Example:
615
616
616
617
Any setting specified on the command line take precedence over entries in `rebar.config`, which in turn take precedence over the default values specified above.
617
618
619
+
### The `escriptize` task
618
620
621
+
Use the `escriptize` task to generate a standalone binary combining AtomVM virtual machine and the application. The binary can then be copied to another host with the same architecture and would work provided that mbedtls and zlib are installed.
622
+
623
+
To use this task, you need to define a module that exports a `main/1` function, following `rebar3``escriptize` command. This function is invoked with the command line parameters, as strings.
624
+
625
+
`-spec main(Args :: [string()]) -> ok | 0 | any().`
626
+
627
+
If the function returns ok or 0, the `main` entry point will return 0 as its exit code. Otherwise, it will return 1. Please note that AtomVM does not implement `erlang:halt/1` as of this writing.
628
+
629
+
The module that exports this `main/1` function should be declared in `rebar.config` file with either:
0 commit comments