ash_archival/mix.exs

120 lines
2.8 KiB
Elixir
Raw Normal View History

2022-07-14 06:29:49 +12:00
defmodule AshArchival.MixProject do
use Mix.Project
2022-08-24 12:44:46 +12:00
@version "0.1.1-rc.2"
2022-07-14 07:19:07 +12:00
@description """
A small resource extension that sets a resource up to archive instead of destroy.
"""
2022-07-14 06:29:49 +12:00
def project do
[
app: :ash_archival,
version: @version,
elixir: "~> 1.13",
source_url: "https://github.com/ash-project/ash_archival",
homepage_url: "https://github.com/ash-project/ash_archival",
start_permanent: Mix.env() == :prod,
description: @description,
2022-07-14 06:29:49 +12:00
aliases: aliases(),
package: package(),
deps: deps(),
docs: docs(),
consolidate_protocols: Mix.env() != :test
]
end
defp package do
[
name: :ash_postgres,
licenses: ["MIT"],
links: %{
GitHub: "https://github.com/ash-project/ash_archival"
}
]
end
2022-08-24 12:44:26 +12:00
defp extras() do
"documentation/**/*.md"
|> Path.wildcard()
|> Enum.map(fn path ->
title =
path
|> Path.basename(".md")
|> String.split(~r/[-_]/)
|> Enum.map(&String.capitalize/1)
|> Enum.join(" ")
|> case do
"F A Q" ->
"FAQ"
other ->
other
end
{String.to_atom(path),
[
title: title
]}
end)
end
2022-07-14 06:29:49 +12:00
defp docs do
[
2022-08-24 12:44:26 +12:00
main: "archival",
source_ref: "v#{@version}",
extras: extras(),
groups_for_modules: [
Extension: [
AshArchival.Resource
],
Introspection: [
AshArchival.Resource.Info
],
Transformers: [
~r/AshArchival.Resource.Transformers.*/
]
]
2022-07-14 06:29:49 +12:00
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger]
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
2022-08-24 12:44:26 +12:00
{:ash, ash_version("~> 2.0.0-pre.4")},
2022-07-14 06:29:49 +12:00
{:git_ops, "~> 2.4.5", only: :dev},
{:ex_doc, "~> 0.22", only: :dev, runtime: false},
{:ex_check, "~> 0.14", only: :dev},
{:credo, ">= 0.0.0", only: :dev, runtime: false},
{:dialyxir, ">= 0.0.0", only: :dev, runtime: false},
{:sobelow, ">= 0.0.0", only: :dev, runtime: false},
{:excoveralls, "~> 0.14", only: [:dev, :test]},
{:elixir_sense, github: "elixir-lsp/elixir_sense", only: [:dev, :test]}
]
end
defp aliases do
[
sobelow:
"sobelow --skip -i Config.Secrets --ignore-files lib/migration_generator/migration_generator.ex",
credo: "credo --strict",
"ash.formatter": "ash.formatter --extensions AshArchival.Resource"
]
end
defp ash_version(default_version) do
case System.get_env("ASH_VERSION") do
nil -> default_version
"local" -> [path: "../ash"]
"main" -> [git: "https://github.com/ash-project/ash.git"]
version -> "~> #{version}"
end
end
end