Current section
Files
Jump to
Current section
Files
mix.exs
defmodule ExEditor.MixProject do
use Mix.Project
@version "0.2.0"
@source_url "https://github.com/thanos/ex_editor"
def project do
[
app: :ex_editor,
version: @version,
elixir: "~> 1.15",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
deps: deps(),
description: description(),
package: package(),
docs: docs(),
name: "ExEditor",
source_url: @source_url,
test_coverage: [tool: ExCoveralls],
aliases: [
verify: &verify/1
],
preferred_cli_env: [
coveralls: :test,
"coveralls.detail": :test,
"coveralls.post": :test,
"coveralls.html": :test
],
dialyzer: [
plt_file: {:no_warn, "priv/plts/dialyzer.plt"},
plt_add_apps: [:mix, :ex_unit]
]
]
end
def application do
[
extra_applications: [:logger]
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
defp deps do
[
{:ex_doc, "~> 0.31", only: :dev, runtime: false},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:sobelow, "~> 0.13", only: [:dev, :test], runtime: false},
{:excoveralls, "~> 0.18", only: :test},
{:dialyxir, "~> 1.4", only: :dev, runtime: false}
]
end
defp description do
"A headless code editor library for Phoenix LiveView applications with a plugin system for extensibility."
end
defp package do
[
licenses: ["MIT"],
links: %{"GitHub" => @source_url},
maintainers: ["Thanos Vassilakis"]
]
end
defp docs do
[
main: "readme",
extras: [
"README.md",
"CHANGELOG.md",
"guides/plugins.md"
]
]
end
defp verify(_) do
steps = [
{"compile --warnings-as-errors", :dev},
{"format --check-formatted", :dev},
{"credo --strict", :dev},
{"sobelow --config", :dev},
# {"dialyzer", :dev},
{"test --cover", :test},
{"docs --warnings-as-errors", :dev}
]
Enum.each(steps, fn {task, env} ->
Mix.shell().info([:bright, "==> mix #{task}", :reset])
{_, exit_code} =
System.cmd("mix", String.split(task),
env: [{"MIX_ENV", to_string(env)}],
into: IO.stream()
)
if exit_code != 0 do
Mix.raise("mix #{task} failed (exit code #{exit_code})")
end
end)
Mix.shell().info([:green, :bright, "\nAll verification checks passed!", :reset])
end
end