Skip to content
Merged
Show file tree
Hide file tree
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
11 changes: 5 additions & 6 deletions template/lib/package_name.ex.eex
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
defmodule <%= @module_name %> do
@moduledoc false
use Nerves.Package.Platform
# This module's only purpose is get rid of error messages when used with Nerves 1.x

# The functions needed to be implemented when using Nerves.Package.Platform. Implement
# anyway, but don't require Nerves.Package.Platform to be around.
# use Nerves.Package.Platform

@impl Nerves.Package.Platform
def bootstrap(_pkg) do
:ok
end

@impl Nerves.Package.Platform
def build_path_link(_pkg) do
# Unused since never built via Nerves tooling
"Run build.sh directly"
end

@impl Nerves.Artifact.BuildRunner
def build(_pkg, _toolchain, _opts) do
{:error, "Run build.sh directly"}
end

@impl Nerves.Artifact.BuildRunner
def archive(_pkg, _toolchain, _opts) do
{:error, "Run build.sh directly"}
end

@impl Nerves.Artifact.BuildRunner
def clean(_pkg) do
{:error, "Run build.sh directly"}
end
Expand Down
10 changes: 1 addition & 9 deletions template/mix.exs.eex
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,12 @@ defmodule <%= @module_name %>.MixProject do
description: @description,
package: package(),
source_url: @source_url,
compilers: compilers(Mix.env()),
nerves_package: nerves_package(),
deps: deps(),
docs: docs()
]
end

# Removing Nerves.Toolchain.CTNG had the side effect of introducing a
# circular dependency between Nerves bootstram and compiling the platform.
# Since we no longer support compiling the toolchain via the Nerves tooling,
# use the environment to see whether this is the root project or not.
defp compilers(:prod), do: [:nerves_package | Mix.compilers()]
defp compilers(_), do: Mix.compilers()

def application do
[]
end
Expand All @@ -53,7 +45,7 @@ defmodule <%= @module_name %>.MixProject do
defp deps do
[
{:ex_doc, "~> 0.22", only: :docs, runtime: false},
{:nerves, "~> 1.13", runtime: false}
{:nerves, "~> 1.13 or ~> 2.0", runtime: false}
]
end

Expand Down
Loading