defmodule Isotope.MixProject do use Mix.Project @source_url "https://codeberg.org/sickday/Isotope118" @upstream_url "https://github.com/viniciusmuller/isotope" @version "0.5.0" def project do [ app: :isotope_118, version: @version, elixir: "~> 1.18", start_permanent: Mix.env() == :prod, rustler_crates: rustler_crates(), dialyzer: dialyzer(), deps: deps(), aliases: aliases(), # Hex description: "Work with different noise functions using Elixir. " <> "Fork of isotope, maintained for Elixir 1.18+.", package: package(), test_coverage: [ ignore_modules: [ Isotope.Options.Cellular, Isotope.Options.Fractal, Isotope.NIF ] ], # Docs name: "Isotope", main: "Isotope", source_url: @source_url, docs: [ # ex_doc only infers link patterns for GitHub/GitLab/Bitbucket; Codeberg # (Forgejo) needs it spelled out or every source link 404s. source_url_pattern: "#{@source_url}/src/branch/main/%{path}#L%{line}", extras: ["README.md", "CHANGELOG.md", "LICENSE"] ] ] end defp aliases do [ test: ["compile", "test"], lint: ["format", "credo", "dialyzer"] ] end defp package do [ name: :isotope_118, licenses: ["MIT"], links: %{ "Codeberg" => @source_url, "Changelog" => "#{@source_url}/src/branch/main/CHANGELOG.md", "Upstream (isotope)" => @upstream_url }, exclude_patterns: [ "priv/plts", "native/noise/target", # Test-only: ~700KB of golden vectors and the suite that reads them. # `mod golden` is cfg(test), so the release build never looks for it. "native/noise/testdata", "native/noise/src/golden.rs", # Never ship a compiled NIF: rustler rebuilds it on the consumer's # machine, and whatever is in priv/native locally is the *developer's* # host artifact (a Mach-O arm64 .so, if published from a Mac). # A regex, not a string: `=~` treats strings as substrings, and the old # literal "priv/native/libnoise.so" never matched, because rustler # copies the artifact to priv/native/noise.so. ~r{^priv/native/.*\.so$} ], files: [ "lib", "native", "priv/native", ".formatter.exs", "README.md", "LICENSE", "mix.exs" ] ] end defp dialyzer do [ plt_core_path: "priv/plts", plt_file: {:no_warn, "priv/plts/dialyzer.plt"} ] end def application do [ extra_applications: [:eex, :logger] ] end defp rustler_crates() do [ noise: [ path: "native/noise", mode: :release ] ] end defp deps do [ # Development dependencies {:dialyxir, "~> 1.4", only: [:dev], runtime: false}, {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, {:ex_doc, "~> 0.40", only: :dev, runtime: false}, {:benchee, "~> 1.5", only: :dev}, # Other dependencies {:rustler, "~> 0.38.0"} ] end end