Skip to content

Commit

Permalink
Support Elixir 1.16
Browse files Browse the repository at this point in the history
  • Loading branch information
jjcarstens authored and fhunleth committed Dec 26, 2023
1 parent 11fed3c commit 28b227a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
version: 2.1

latest: &latest
pattern: "^1.15.*-erlang-26.*$"
pattern: "^1.16.*-erlang-26.*$"

tags: &tags
[
1.15.7-erlang-26.1.2-alpine-3.18.4,
1.16.0-erlang-26.2.1-alpine-3.18.4,
1.15.7-erlang-26.2.1-alpine-3.18.4,
1.14.5-erlang-25.3.2-alpine-3.18.0,
1.13.4-erlang-24.3.4-alpine-3.15.3,
1.12.3-erlang-24.3.4-alpine-3.15.3,
Expand Down
13 changes: 12 additions & 1 deletion lib/nerves/package.ex
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ defmodule Nerves.Package do
config = Enum.reject(config[:nerves_package], fn {k, _v} -> k in @required end)

dep_opts =
Mix.Dep.load_on_environment(env: Mix.env())
load_env_deps()
|> Enum.find(%{}, &(&1.app == app))
|> Map.get(:opts, [])
|> Keyword.get(:nerves, [])
Expand All @@ -92,6 +92,17 @@ defmodule Nerves.Package do
}
end

if Version.match?(System.version(), ">= 1.16.0") do
defp load_env_deps() do
Mix.Dep.Converger.converge(env: Mix.env())
end
else
defp load_env_deps() do
# deprecated in Elixir >= 1.16.0
Mix.Dep.load_on_environment(env: Mix.env())
end
end

@doc """
Starts an interactive shell with the working directory set
to the package path
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule Nerves.MixProject do
[
app: :nerves,
version: @version,
elixir: "~> 1.11.2 or ~> 1.12.0 or ~> 1.13.0 or ~> 1.14.0 or ~> 1.15.1",
elixir: "~> 1.11.2 or ~> 1.12.0 or ~> 1.13.0 or ~> 1.14.0 or ~> 1.15.1 or ~> 1.16.0",
elixirc_paths: elixirc_paths(Mix.env()),
deps: deps(),
description: description(),
Expand Down

0 comments on commit 28b227a

Please sign in to comment.