Current section

Files

Jump to
autumn mix.exs
Raw

mix.exs

defmodule Autumn.MixProject do
use Mix.Project
@source_url "https://github.com/leandrocp/autumn"
@version "0.6.0"
@dev? String.ends_with?(@version, "-dev")
@force_build? System.get_env("AUTUMN_BUILD") in ["1", "true"]
def project do
[
app: :autumn,
version: @version,
elixir: "~> 1.14",
start_permanent: Mix.env() == :prod,
build_embedded: Mix.env() == :prod,
package: package(),
docs: docs(),
deps: deps(),
aliases: aliases(),
name: "Autumn",
homepage_url: "https://autumnus.dev",
description: "Syntax highlighter powered by Tree-sitter and Neovim themes."
]
end
def application do
[
extra_applications: [:logger]
]
end
def cli do
[
preferred_envs: [
docs: :docs,
"hex.publish": :docs,
"test.rust": :test,
"test.all": :test,
quality: :test
]
]
end
defp package do
[
maintainers: ["Leandro Pereira"],
licenses: ["MIT"],
links: %{
Changelog: "https://hexdocs.pm/autumn/changelog.html",
GitHub: @source_url,
Site: "https://autumnus.dev"
},
files: ~w[
lib
native/autumnus_nif/src
native/autumnus_nif/.cargo
native/autumnus_nif/Cargo.*
native/autumnus_nif/Cross.toml
priv/static/css
examples
checksum-*.exs
mix.exs
README.md
LICENSE.md
CHANGELOG.md
usage-rules.md
]
]
end
defp docs do
[
main: "Autumn",
assets: "assets/images",
logo: "assets/images/autumn_icon.png",
source_ref: "v#{@version}",
source_url: @source_url,
extras: [
"CHANGELOG.md",
"examples/light_dark_manual.livemd",
"examples/light_dark_vars.livemd",
"examples/light_dark_function.livemd"
],
skip_undefined_reference_warnings_on: ["CHANGELOG.md"]
]
end
defp deps do
[
{:rustler, "~> 0.29", optional: not (@dev? or @force_build?)},
{:rustler_precompiled, "~> 0.6"},
{:nimble_options, "~> 1.0"},
{:ex_doc, ">= 0.0.0", only: :docs},
{:makeup_elixir, "~> 1.0", only: :docs},
{:makeup_eex, "~> 2.0", only: :docs},
{:makeup_syntect, "~> 0.1", only: :docs}
]
end
defp aliases do
[
setup: ["deps.get", "compile"],
quality: ["format.all", "lint.rust", "test.all"],
"gen.checksum": "rustler_precompiled.download Autumn.Native --all --print",
"format.all": ["format.rust", "format"],
"test.all": ["test.rust", "test"],
"format.rust": ["cmd cargo fmt --manifest-path=native/autumnus_nif/Cargo.toml --all"],
"lint.rust": [
"cmd cargo clippy --manifest-path=native/autumnus_nif/Cargo.toml -- -Dwarnings"
],
"test.rust": ["cmd cargo test --manifest-path=native/autumnus_nif/Cargo.toml"]
]
end
end