-
Notifications
You must be signed in to change notification settings - Fork 9
Add docs to Mix tasks #41
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,4 @@ | ||
defmodule ExAtomVM do | ||
@moduledoc """ | ||
Documentation for ExAtomVM. | ||
""" | ||
|
||
@doc """ | ||
Hello world. | ||
|
||
## Examples | ||
|
||
iex> ExAtomVM.hello() | ||
:world | ||
|
||
""" | ||
def hello do | ||
:world | ||
end | ||
@moduledoc "README.md" | ||
|> File.read!() | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,38 @@ | ||
defmodule Mix.Tasks.Atomvm.Packbeam do | ||
use Mix.Task | ||
|
||
@shortdoc "Bundle the application into an AVM file" | ||
|
||
@moduledoc """ | ||
Bundle an application into an AVM file that can be flashed to a micro-controller and (or directly on a unix host) executed by the AtomVM virtual machine. | ||
|
||
> #### Info {: .info} | ||
> | ||
> Normally using this task manually is not required, it is called automatically by `atomvm.esp32.flash`, `atomvm.stm32.flash` and `atomvm.pico.flash`. | ||
|
||
## Usage example | ||
|
||
Within your AtomVM mix project run | ||
|
||
` | ||
$ mix atomvm.packbeam | ||
` | ||
|
||
## Configuration | ||
|
||
ExAtomVM can be configured from the mix.ex file and supports the following settings for the | ||
`atomvm.packbeam` task. | ||
|
||
* `:start` - The name of the module containing the start/0 entrypoint function. Only to be used to override the `:start` options defined in the the projects `mix.exs` This would not normally be needed, unless the user had an alternate mode of operation e.g like a client/server app that normally builds the client, but when building the server uses a different start module. | ||
|
||
## Command line options | ||
|
||
Properties in the mix.exs file may be over-ridden on the command line using long-style flags (prefixed by --) by the same name | ||
as the [supported properties](#module-configuration) | ||
|
||
For example, you can use the `--start` option to specify or override the `start` property. | ||
""" | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we mentioned the dependencies elsewhere, this is actually another that users will not often need to use directly. The various MCU.flash tasks depend on this one, it is only for generic_unix, or WASM (?) that this task will be required for users. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure I follow. But this is only an example that it is possible to set this flag if needed. Or do you mean that this flag is always needed when running this particular task directly? (I've no problem with changing copy if wished) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't mean the flag, I meant using the atomvm.packbeam task directly is not needed for micro-controllers. The atomvm.esp32.flash, atomvm.stm32.flash, and atomvm.pico.flash all depend on atomvm.packbeam, so using the packbeam task directly is only needed to create an AVM file for generic_unix... and possibly WASM, but I am not up to speed on deploying an Elixir WASM application, so I don't know all the details there. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We mentioned in the uf2create task that the atomvm.pico.flash task depends on uf2create task, so using it directly is not normally needed... I thought we might mention similarly about the atomvm.packbeam task. |
||
alias ExAtomVM.PackBEAM | ||
alias Mix.Project | ||
alias Mix.Tasks.Atomvm.Check | ||
|
Uh oh!
There was an error while loading. Please reload this page.