Skip to content

Commit a3b4194

Browse files
committed
Remove last references to the old nerves.exs
This was where Nerves package configuration existed before it was moved to the mix.exs.
1 parent 5523ba2 commit a3b4194

File tree

2 files changed

+11
-40
lines changed

2 files changed

+11
-40
lines changed

lib/nerves/env.ex

+4-6
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ defmodule Nerves.Env do
22
@moduledoc """
33
Contains package info for Nerves dependencies
44
5-
The Nerves Env is used to load information from dependencies that
6-
contain a nerves.exs config file in the root of the dependency
7-
path. Nerves loads this config because it needs access to information
8-
about Nerves compile time dependencies before any code is compiled.
5+
The Nerves Env is used to load information from dependencies that have nerves
6+
config. Nerves loads this config because it needs access to information about
7+
Nerves compile time dependencies before any code is compiled.
98
"""
109

1110
alias Nerves.Artifact
@@ -525,8 +524,7 @@ defmodule Nerves.Env do
525524

526525
package_config != nil
527526
rescue
528-
_e ->
529-
File.exists?(Package.config_path(path))
527+
_e -> false
530528
end
531529

532530
defp mix_config() do

lib/nerves/package.ex

+7-34
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ defmodule Nerves.Package do
4444
config: Keyword.t()
4545
}
4646

47-
@package_config "nerves.exs"
4847
@required [:type, :version, :platform]
4948

5049
@doc """
@@ -61,7 +60,7 @@ defmodule Nerves.Package do
6160
if !type do
6261
Mix.shell().error(
6362
"The Nerves package #{app} does not define a type.\n\n" <>
64-
"Verify that the key exists in '#{config_path(path)}'.\n"
63+
"Verify that the key exists.\n"
6564
)
6665

6766
exit({:shutdown, 1})
@@ -120,44 +119,18 @@ defmodule Nerves.Package do
120119
pkg.build_runner.shell(pkg)
121120
end
122121

123-
@doc """
124-
Takes the path to the package and returns the path to its package config.
125-
"""
126-
@spec config_path(String.t()) :: String.t()
127-
def config_path(path) do
128-
Path.join(path, @package_config)
129-
end
130-
131122
@doc """
132123
Get Mix.Project config for an application
133124
"""
134125
@spec config(Application.app(), Path.t()) :: Keyword.t()
135126
def config(app, path) do
136-
project_config =
137-
if app == Mix.Project.config()[:app] do
127+
if app == Mix.Project.config()[:app] do
128+
Mix.Project.config()
129+
else
130+
Mix.Project.in_project(app, path, fn _mod ->
138131
Mix.Project.config()
139-
else
140-
Mix.Project.in_project(app, path, fn _mod ->
141-
Mix.Project.config()
142-
end)
143-
end
144-
145-
nerves_package =
146-
case project_config[:nerves_package] do
147-
nil ->
148-
# TODO: Deprecated. Clean up after 1.0
149-
Mix.shell().raise("""
150-
Nerves configuration has moved from nerves.exs to mix.exs.
151-
152-
Use `mix nerves.new` to regenerate your project's mix.exs and merge
153-
your code into the new project.
154-
""")
155-
156-
nerves_package ->
157-
nerves_package
158-
end
159-
160-
Keyword.put(project_config, :nerves_package, nerves_package)
132+
end)
133+
end
161134
end
162135

163136
defp dep_type(pkg) do

0 commit comments

Comments
 (0)