From b2e4bd0958d737be4710a1e27fccae2af78051c0 Mon Sep 17 00:00:00 2001 From: Jason Axelson Date: Sun, 24 Sep 2023 18:33:38 -1000 Subject: [PATCH] Update mix scenic.setup instructions Makes it a little shorter (plus you don't need to add scenic to extra_applications) --- lib/mix/tasks/setup.ex | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/lib/mix/tasks/setup.ex b/lib/mix/tasks/setup.ex index 076f0fe..d1202a7 100644 --- a/lib/mix/tasks/setup.ex +++ b/lib/mix/tasks/setup.ex @@ -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 @@ -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 @@ -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