Current section
Files
Jump to
Current section
Files
mix.exs
defmodule Matterlix.MixProject do
use Mix.Project
@app :matterlix
@version "0.2.0"
@all_targets [
:bbb,
:grisp2,
:osd32mp1,
:mangopi_mq_pro,
:qemu_aarch64,
:rpi,
:rpi0,
:rpi0_2,
:rpi2,
:rpi3,
:rpi4,
:rpi5,
:x86_64
]
def project do
[
app: @app,
version: @version,
elixir: "~> 1.18",
archives: [nerves_bootstrap: "~> 1.14"],
listeners: listeners(Mix.target(), Mix.env()),
start_permanent: Mix.env() == :prod,
compilers: [:elixir_make] ++ Mix.compilers(),
make_targets: ["all"],
make_clean: ["clean"],
make_env: make_env(Mix.target()),
deps: deps(),
releases: [{@app, release()}],
description: description(),
package: package(),
source_url: "https://github.com/tomHoenderdos/matterlix",
docs: docs()
]
end
defp docs do
[
main: "readme",
extras: ["README.md", "CHANGELOG.md", "CONTRIBUTING.md", "LICENSE"],
source_url: "https://github.com/tomHoenderdos/matterlix",
source_ref: "v#{@version}",
groups_for_modules: [
"High-Level API": [Matterlix.Matter],
"Low-Level NIF": [Matterlix.Matter.NIF]
]
]
end
defp description do
"Elixir NIF bindings for the Matter (CHIP) SDK, designed for Nerves-based IoT devices"
end
defp package do
[
name: "matterlix",
licenses: ["Apache-2.0"],
links: %{
"GitHub" => "https://github.com/tomHoenderdos/matterlix"
}
]
end
defp make_env(:host) do
# For host builds, we don't cross-compile
%{}
end
defp make_env(target) do
# For target builds, use Nerves cross-compilation environment
%{
"TARGET" => to_string(target),
"CROSSCOMPILE" => "1"
}
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger, :runtime_tools],
mod: {Matterlix.Application, []}
]
end
def cli do
[preferred_targets: [run: :host, test: :host]]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
# Build tools
{:elixir_make, "~> 0.8", runtime: false},
# Documentation
{:ex_doc, "~> 0.34", only: :dev, runtime: false},
# Dependencies for all targets
{:nerves, "~> 1.10", runtime: false},
{:shoehorn, "~> 0.9.1"},
{:ring_logger, "~> 0.11.0"},
{:toolshed, "~> 0.4.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.1", targets: @all_targets},
# VintageNet WiFi for Matter network commissioning
{:vintage_net_wifi, "~> 0.12.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_bbb, "~> 2.19", runtime: false, targets: :bbb},
{:nerves_system_grisp2, "~> 0.8", runtime: false, targets: :grisp2},
{:nerves_system_osd32mp1, "~> 0.15", runtime: false, targets: :osd32mp1},
{:nerves_system_mangopi_mq_pro, "~> 0.6", runtime: false, targets: :mangopi_mq_pro},
{:nerves_system_qemu_aarch64, "~> 0.1", runtime: false, targets: :qemu_aarch64},
{:nerves_system_rpi, "~> 1.24", runtime: false, targets: :rpi},
{:nerves_system_rpi0, "~> 1.24", runtime: false, targets: :rpi0},
{:nerves_system_rpi0_2, "~> 1.31", runtime: false, targets: :rpi0_2},
{:nerves_system_rpi2, "~> 1.24", runtime: false, targets: :rpi2},
{:nerves_system_rpi3, "~> 1.24", runtime: false, targets: :rpi3},
{:nerves_system_rpi4, "~> 1.24", runtime: false, targets: :rpi4},
{:nerves_system_rpi5, "~> 0.2", runtime: false, targets: :rpi5},
{:nerves_system_x86_64, "~> 1.24", runtime: false, targets: :x86_64}
]
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
# Uncomment the following line if using Phoenix > 1.8.
# defp listeners(:host, :dev), do: [Phoenix.CodeReloader]
defp listeners(_, _), do: []
end