# SPDX-FileCopyrightText: 2026 Ben Youngblood
#
# SPDX-License-Identifier: Apache-2.0
defmodule STK31862.MixProject do
use Mix.Project
@version "0.1.0"
@description "Use the Sensortek STK31862 ambient light sensor in Elixir"
@source_url "https://github.com/one-raven/stk31862"
def project do
[
app: :stk31862,
version: @version,
elixir: "~> 1.12",
elixirc_paths: elixirc_paths(Mix.env()),
deps: deps(),
start_permanent: Mix.env() == :prod,
description: @description,
dialyzer: [
flags: [:missing_return, :extra_return, :unmatched_returns, :error_handling, :underspecs]
],
docs: docs(),
package: package(),
aliases: aliases()
]
end
def cli do
[
preferred_envs: %{
docs: :docs,
"hex.publish": :docs,
"hex.build": :docs
}
]
end
def application do
[
extra_applications: [:logger]
]
end
defp deps do
[
{:circuits_i2c, "~> 2.0 or ~> 1.0 or ~> 0.3"},
{:circuits_sim, github: "elixir-circuits/circuits_sim", only: [:dev, :test]},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.3", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.29", only: :docs, runtime: false}
]
end
defp elixirc_paths(env) when env in [:test, :dev], do: ["lib", "test/support"]
defp elixirc_paths(_env), do: ["lib"]
defp package do
%{
files: [
"lib",
"mix.exs",
"README*",
"CHANGELOG*"
],
licenses: ["Apache-2.0"],
links: %{
"GitHub" => @source_url
}
}
end
defp docs do
[
extras: ["README.md", "CHANGELOG.md"],
main: "readme",
source_ref: "v#{@version}",
source_url: @source_url,
skip_undefined_reference_warnings_on: ["CHANGELOG.md"]
]
end
defp aliases do
[
lint: ["format", "deps.unlock --unused", "credo", "dialyzer"]
]
end
end