You've already forked tribes-plugin-kobold
df849322ca
CI / Test (push) Failing after 15s
Adopt canonical plugin id/slug manifest fields, vendor-prefixed OTP app naming, and fully-qualified capability ids for Kobold.
113 lines
3.3 KiB
Elixir
113 lines
3.3 KiB
Elixir
defmodule TribeOne.TribesPlugin.Kobold.MixProject do
|
|
use Mix.Project
|
|
|
|
def project do
|
|
[
|
|
app: :tribe_one_kobold,
|
|
version: "0.1.0",
|
|
elixir: "~> 1.18",
|
|
elixirc_paths: elixirc_paths(Mix.env()),
|
|
start_permanent: Mix.env() == :prod,
|
|
deps: deps(),
|
|
aliases: aliases(),
|
|
usage_rules: usage_rules()
|
|
]
|
|
end
|
|
|
|
def cli do
|
|
[
|
|
preferred_envs: [precommit: :test, raw_precommit: :test, raw_test: :test]
|
|
]
|
|
end
|
|
|
|
def application do
|
|
[
|
|
extra_applications: [:logger]
|
|
# Uncomment if your plugin needs its own supervision tree:
|
|
# mod: {TribeOne.TribesPlugin.Kobold.Application, []}
|
|
]
|
|
end
|
|
|
|
defp elixirc_paths(:test), do: ["lib", "test/support"]
|
|
defp elixirc_paths(_), do: ["lib"]
|
|
|
|
defp deps do
|
|
[
|
|
# Plugin API dependency for local development alongside a tribes checkout.
|
|
#
|
|
# For CI or standalone development, this can be replaced with a published
|
|
# package once tribes_plugin_api is released.
|
|
{:tribes_plugin_api, path: "../tribes/tribes_plugin_api", runtime: false},
|
|
{:tribes_plugin, path: "../tribes-plugin-new", only: [:dev, :test], runtime: false},
|
|
{:igniter, "~> 0.7", only: [:dev, :test], runtime: false},
|
|
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
|
|
{:lazy_html, ">= 0.1.0", only: :test},
|
|
{:phoenix, "~> 1.8"},
|
|
{:phoenix_html, "~> 4.1"},
|
|
{:phoenix_live_view, "~> 1.1.0"},
|
|
{:usage_rules, "~> 1.2", only: :dev}
|
|
] ++ tribes_deps(Mix.env())
|
|
end
|
|
|
|
defp tribes_deps(:dev), do: [{:tribes, path: "../tribes", only: :dev, runtime: false}]
|
|
defp tribes_deps(:test), do: [{:tribes, path: "../tribes", only: :test}]
|
|
defp tribes_deps(_), do: []
|
|
|
|
defp usage_rules do
|
|
[
|
|
file: "AGENTS.md",
|
|
usage_rules: [
|
|
{:usage_rules, sub_rules: []},
|
|
{"usage_rules:elixir", main: false},
|
|
{"usage_rules:otp", main: false},
|
|
"phoenix:ecto",
|
|
"phoenix:html",
|
|
"phoenix:liveview",
|
|
"phoenix:phoenix",
|
|
{:ash, sub_rules: []},
|
|
{"ash:actions", link: :markdown, main: false},
|
|
{"ash:migrations", link: :markdown, main: false},
|
|
{"ash:testing", link: :markdown, main: false},
|
|
{:tribes_plugin_api, sub_rules: []},
|
|
{:tribes, sub_rules: []}
|
|
]
|
|
]
|
|
end
|
|
|
|
defp aliases do
|
|
[
|
|
test: &plugin_test_message/1,
|
|
raw_test: &raw_test/1,
|
|
lint: ["format --check-formatted", "credo"],
|
|
precommit: &plugin_precommit_message/1,
|
|
raw_precommit: &raw_precommit/1
|
|
]
|
|
end
|
|
|
|
defp plugin_test_message(_args) do
|
|
Mix.raise("""
|
|
This plugin test suite is host-backed. Use `plugin test` or `scripts/plugin test`.
|
|
|
|
For low-level debugging only, set up the host environment yourself and run `mix raw_test`.
|
|
""")
|
|
end
|
|
|
|
defp plugin_precommit_message(_args) do
|
|
Mix.raise("""
|
|
This plugin precommit is host-backed. Use `plugin precommit` or `scripts/plugin precommit`.
|
|
|
|
For low-level debugging only, set up the host environment yourself and run `mix raw_precommit`.
|
|
""")
|
|
end
|
|
|
|
defp raw_precommit(args) do
|
|
Mix.Task.run("format")
|
|
Mix.Task.run("compile", ["--warnings-as-errors"])
|
|
Mix.Task.run("credo", ["--strict", "--all"])
|
|
Mix.Task.run("deps.unlock", ["--unused"])
|
|
raw_test(args)
|
|
end
|
|
|
|
defp raw_test(args), do: Mix.Tasks.Test.run(args)
|
|
end
|