Skip to content

Commit

Permalink
Update mix scenic.setup instructions
Browse files Browse the repository at this point in the history
Makes it a little shorter (plus you don't need to add scenic to
extra_applications)
  • Loading branch information
axelson committed Nov 30, 2024
1 parent 984224b commit b2e4bd0
Showing 1 changed file with 5 additions and 27 deletions.
32 changes: 5 additions & 27 deletions lib/mix/tasks/setup.ex
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,8 @@ defmodule Mix.Tasks.Scenic.Setup do
the device target...)
```elixir
{:scenic, "~> 0.11.0-beta.0"},
{:scenic_driver_local, "~> 0.11.0-beta.0"},
```
### Make sure your application is configured to start
This should be in your `mix.exs` file. If using Nerves, it will start `MyApplication.Application`
```elixir
def application do
[
mod: {MyApplication, []},
extra_applications: [:logger, :scenic]
]
end
{:scenic, "~> 0.11.0"},
{:scenic_driver_local, "~> 0.11.0"},
```
### Add Scenic to your app's supervisor
Expand Down Expand Up @@ -221,20 +208,9 @@ defmodule Mix.Tasks.Scenic.Setup do
{:scenic_driver_local, "~> #{Common.scenic_version()}"},
------
Make sure your mix.exs file starts your application and scenic
def application do
[
mod: {#{mod}, []},
extra_applications: [:logger, :scenic]
]
end
------
Add Scenic to your app's supervisor so that it starts scenic.
Something like this should be in your `#{app}.ex` module.
Something like this should be in your `#{app}/application.ex` module.
def start(_type, _args) do
# start the application with the configured viewport
Expand All @@ -246,6 +222,8 @@ defmodule Mix.Tasks.Scenic.Setup do
|> Supervisor.start_link( strategy: :one_for_one )
end
Note: if you don't have an `#{app}/application.ex` module then you probably
didn't generate your application with `mix new my_app_name --sup`
------
Add the following to your config.exs file. Change the app name as appropriate. This
Expand Down

0 comments on commit b2e4bd0

Please sign in to comment.