2023-10-12 16:04:33 +13:00
|
|
|
defmodule BivouacNerves.MixProject do
|
2023-09-28 17:48:20 +13:00
|
|
|
use Mix.Project
|
|
|
|
|
2023-10-12 16:04:33 +13:00
|
|
|
@app :bivouac_nerves
|
2023-09-28 17:48:20 +13:00
|
|
|
@version "0.1.0"
|
2023-10-12 16:04:33 +13:00
|
|
|
@all_targets [:rpi4, :x86_64]
|
2023-09-28 17:48:20 +13:00
|
|
|
|
|
|
|
def project do
|
|
|
|
[
|
|
|
|
app: @app,
|
|
|
|
version: @version,
|
|
|
|
elixir: "~> 1.11",
|
|
|
|
archives: [nerves_bootstrap: "~> 1.11"],
|
|
|
|
start_permanent: Mix.env() == :prod,
|
|
|
|
deps: deps(),
|
|
|
|
releases: [{@app, release()}],
|
|
|
|
preferred_cli_target: [run: :host, test: :host]
|
|
|
|
]
|
|
|
|
end
|
|
|
|
|
|
|
|
# Run "mix help compile.app" to learn about applications.
|
|
|
|
def application do
|
|
|
|
[
|
2023-10-12 16:04:33 +13:00
|
|
|
mod: {BivouacNerves.Application, []},
|
2023-09-28 17:48:20 +13:00
|
|
|
extra_applications: [:logger, :runtime_tools]
|
|
|
|
]
|
|
|
|
end
|
|
|
|
|
|
|
|
# Run "mix help deps" to learn about dependencies.
|
|
|
|
defp deps do
|
2023-09-28 19:04:00 +13:00
|
|
|
test_opts = [only: ~w[dev test]a, runtime: false, targets: :host]
|
|
|
|
|
2023-09-28 17:48:20 +13:00
|
|
|
[
|
|
|
|
# Dependencies for all targets
|
|
|
|
{:nerves, "~> 1.10", runtime: false},
|
|
|
|
{:shoehorn, "~> 0.9.1"},
|
|
|
|
{:ring_logger, "~> 0.10.0"},
|
|
|
|
{:toolshed, "~> 0.3.0"},
|
|
|
|
|
|
|
|
# Allow Nerves.Runtime on host to support development, testing and CI.
|
|
|
|
# See config/host.exs for usage.
|
|
|
|
{:nerves_runtime, "~> 0.13.0"},
|
|
|
|
|
|
|
|
# Dependencies for all targets except :host
|
|
|
|
{:nerves_pack, "~> 0.7.0", targets: @all_targets},
|
|
|
|
|
|
|
|
# Dependencies for specific targets
|
|
|
|
# NOTE: It's generally low risk and recommended to follow minor version
|
|
|
|
# bumps to Nerves systems. Since these include Linux kernel and Erlang
|
|
|
|
# version updates, please review their release notes in case
|
|
|
|
# changes to your application are needed.
|
|
|
|
{:nerves_system_rpi4, "~> 1.19", runtime: false, targets: :rpi4},
|
|
|
|
{:nerves_system_x86_64, "~> 1.19", runtime: false, targets: :x86_64},
|
2023-09-28 19:04:00 +13:00
|
|
|
|
|
|
|
# Dev/test deps
|
|
|
|
|
|
|
|
{:credo, "~> 1.7", test_opts},
|
|
|
|
{:dialyxir, "~> 1.3", test_opts},
|
|
|
|
{:doctor, "~> 0.21", test_opts},
|
|
|
|
{:earmark, ">= 0.0.0", test_opts},
|
|
|
|
{:ex_check, "~> 0.15", test_opts},
|
|
|
|
{:ex_doc, ">= 0.0.0", test_opts},
|
|
|
|
{:faker, "~> 0.17", test_opts},
|
|
|
|
{:git_ops, "~> 2.6", test_opts},
|
|
|
|
{:mix_audit, "~> 2.1", test_opts}
|
2023-09-28 17:48:20 +13:00
|
|
|
]
|
|
|
|
end
|
|
|
|
|
|
|
|
def release do
|
|
|
|
[
|
|
|
|
overwrite: true,
|
|
|
|
# Erlang distribution is not started automatically.
|
|
|
|
# See https://hexdocs.pm/nerves_pack/readme.html#erlang-distribution
|
|
|
|
cookie: "#{@app}_cookie",
|
|
|
|
include_erts: &Nerves.Release.erts/0,
|
|
|
|
steps: [&Nerves.Release.init/1, :assemble],
|
|
|
|
strip_beams: Mix.env() == :prod or [keep: ["Docs"]]
|
|
|
|
]
|
|
|
|
end
|
|
|
|
end
|