# SPDX-FileCopyrightText: 2026 Lars Wikman # # SPDX-License-Identifier: Apache-2.0 defmodule BodgeUSB.MixProject do use Mix.Project @version "0.1.1" def project do [ app: :bodge_usb, version: @version, elixir: "~> 1.17", start_permanent: Mix.env() == :prod, elixirc_paths: elixirc_paths(Mix.env()), compilers: [:elixir_make] ++ Mix.compilers(), make_targets: ["all"], make_clean: ["clean"], deps: deps(), name: "BodgeUSB", description: "Talk to USB devices from Elixir on Linux via a usbfs-scoped syscall NIF", docs: docs(), package: package(), aliases: aliases(), dialyzer: dialyzer() ] end def application do [ extra_applications: [:logger] ] end defp elixirc_paths(:test), do: ["lib", "test/support"] defp elixirc_paths(_), do: ["lib"] def docs do [ main: "readme", source_url: "https://github.com/lawik/bodge_usb", source_ref: "v#{@version}", extras: ["README.md", "CHANGELOG.md"] ] end def package do [ name: :bodge_usb, # Hex's default file set excludes c_src/ and the Makefile, without which # the package cannot compile. files: [ "lib", "c_src", "Makefile", "mix.exs", "README.md", "LICENSE.md", "LICENSES", "REUSE.toml", "CHANGELOG.md" ], licenses: ["Apache-2.0"], links: %{"GitHub" => "https://github.com/lawik/bodge_usb"} ] end def aliases do [ check: [ "hex.audit", "compile --warnings-as-errors --force", "format --check-formatted", "credo --strict", "deps.unlock --check-unused", "spellweaver.check", "dialyzer" ], precommit: [ "hex.audit", "compile --warnings-as-errors --force", "format", "credo --strict", "deps.unlock --unused", "spellweaver.check", "dialyzer", "test" ] ] end def cli do [ preferred_envs: [precommit: :test] ] end def dialyzer do [ plt_add_apps: [:mix], ignore_warnings: ".dialyzer_ignore.exs" ] end defp deps do [ {:elixir_make, "~> 0.8", runtime: false}, {:nstandard, "~> 0.5", only: [:dev, :test], runtime: false}, {:ex_doc, "~> 0.40", only: [:dev, :test], runtime: false}, {:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false}, {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, {:spellweaver, "~> 0.1.8", only: [:dev, :test], runtime: false} ] end end