Skip to content
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

Update mix scenic.setup instructions #65

Merged
merged 1 commit into from
Nov 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading