ash_postgres/mix.exs

218 lines
6.5 KiB
Elixir
Raw Permalink Normal View History

2019-12-05 03:58:20 +13:00
defmodule AshPostgres.MixProject do
2019-10-07 09:36:18 +13:00
use Mix.Project
2019-12-05 04:13:24 +13:00
@description """
A postgres data layer for `Ash` resources. Leverages Ecto's postgres
support, and delegates to a configured repo.
"""
2024-01-13 04:11:42 +13:00
@version "1.4.0"
2020-06-01 17:36:43 +12:00
2019-10-07 09:36:18 +13:00
def project do
[
2019-12-05 03:58:20 +13:00
app: :ash_postgres,
2020-06-01 17:36:43 +12:00
version: @version,
2021-01-23 10:44:46 +13:00
elixir: "~> 1.11",
2019-10-07 09:36:18 +13:00
start_permanent: Mix.env() == :prod,
2019-12-05 04:13:24 +13:00
deps: deps(),
description: @description,
2020-06-03 14:47:41 +12:00
test_coverage: [tool: ExCoveralls],
2020-09-03 20:18:11 +12:00
elixirc_paths: elixirc_paths(Mix.env()),
2020-06-03 14:47:41 +12:00
preferred_cli_env: [
coveralls: :test,
"coveralls.github": :test,
"test.create": :test,
"test.migrate": :test,
"test.rollback": :test,
"test.migrate_tenants": :test,
"test.check_migrations": :test,
"test.drop": :test,
"test.generate_migrations": :test,
"test.reset": :test
2020-06-03 14:47:41 +12:00
],
2020-06-03 15:29:11 +12:00
dialyzer: [
plt_add_apps: [:ecto, :ash, :mix]
2020-06-03 15:29:11 +12:00
],
docs: docs(),
2020-06-03 14:47:41 +12:00
aliases: aliases(),
2019-12-05 04:13:24 +13:00
package: package(),
source_url: "https://github.com/ash-project/ash_postgres/",
homepage_url: "https://ash-hq.org",
consolidate_protocols: Mix.env() == :prod
2019-12-05 04:13:24 +13:00
]
end
2021-01-27 14:21:53 +13:00
if Mix.env() == :test do
def application() do
2023-10-18 05:25:38 +13:00
[
applications: [:ecto, :ecto_sql, :jason, :ash, :postgrex, :tools, :benchee],
mod: {AshPostgres.TestApp, []}
]
2021-01-27 14:21:53 +13:00
end
end
2020-09-03 20:18:11 +12:00
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
2019-12-05 04:13:24 +13:00
defp package do
[
name: :ash_postgres,
licenses: ["MIT"],
files: ~w(lib .formatter.exs mix.exs README* LICENSE*
CHANGELOG* documentation),
2019-12-05 04:13:24 +13:00
links: %{
GitHub: "https://github.com/ash-project/ash_postgres"
}
2019-10-07 09:36:18 +13:00
]
end
defp docs do
[
2022-08-24 11:56:46 +12:00
main: "get-started-with-postgres",
source_ref: "v#{@version}",
logo: "logos/small-logo.png",
2023-10-03 01:34:45 +13:00
before_closing_head_tag: fn type ->
if type == :html do
"""
<script>
if (location.hostname === "hexdocs.pm") {
var script = document.createElement("script");
script.src = "https://plausible.io/js/script.js";
script.setAttribute("defer", "defer")
script.setAttribute("data-domain", "ashhexdocs")
document.head.appendChild(script);
}
</script>
2023-10-03 01:34:45 +13:00
"""
end
end,
2024-01-13 08:48:41 +13:00
extras: [
"documentation/tutorials/get-started-with-postgres.md",
"documentation/how_to/join-manual-relationships.md",
"documentation/how_to/test-with-postgres.md",
"documentation/how_to/using-fragments.md",
"documentation/topics/migrations_and_tasks.md",
"documentation/topics/polymorphic_resources.md",
"documentation/topics/postgres-expressions.md",
"documentation/topics/references.md",
"documentation/topics/schema-based-multitenancy.md",
"documentation/dsls/DSL:-AshPostgres.DataLayer.md"
],
groups_for_extras: [
Tutorials: ~r'documentation/tutorials',
"How To": ~r'documentation/how_to',
Topics: ~r'documentation/topics',
DSLs: ~r'documentation/dsls'
],
2024-01-13 08:27:14 +13:00
nest_modules_by_prefix: [
AshPostgres.Functions
],
groups_for_modules: [
2022-08-24 11:56:46 +12:00
AshPostgres: [
AshPostgres,
2022-08-24 11:56:46 +12:00
AshPostgres.Repo,
AshPostgres.DataLayer
],
2023-09-23 08:14:25 +12:00
Utilities: [
AshPostgres.ManualRelationship
],
2022-08-24 11:56:46 +12:00
Introspection: [
2023-09-23 08:14:25 +12:00
AshPostgres.DataLayer.Info,
AshPostgres.CheckConstraint,
AshPostgres.CustomExtension,
AshPostgres.CustomIndex,
AshPostgres.Reference,
AshPostgres.Statement
2022-08-24 11:56:46 +12:00
],
2023-09-23 08:14:25 +12:00
Types: [
AshPostgres.Type,
AshPostgres.Tsquery,
AshPostgres.Tsvector
],
Extensions: [
2023-09-23 09:16:47 +12:00
AshPostgres.Extensions.Vector
2022-08-24 11:56:46 +12:00
],
"Custom Aggregates": [
AshPostgres.CustomAggregate
],
2022-08-24 11:56:46 +12:00
"Postgres Migrations": [
AshPostgres.Migration,
EctoMigrationDefault
],
2023-09-23 08:14:25 +12:00
Expressions: [
AshPostgres.Functions.Fragment,
AshPostgres.Functions.TrigramSimilarity,
AshPostgres.Functions.ILike,
AshPostgres.Functions.Like,
AshPostgres.Functions.VectorCosineDistance
2024-01-13 08:27:14 +13:00
]
]
]
end
2019-10-07 09:36:18 +13:00
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:ecto_sql, "~> 3.9"},
{:ecto, "~> 3.9"},
{:jason, "~> 1.0"},
2019-10-07 09:36:18 +13:00
{:postgrex, ">= 0.0.0"},
2024-01-30 10:57:04 +13:00
{:ash,
ash_version(github: "ash-project/ash", ref: "57654d3df49d39fe727bd86df3a0496c8598c7c1")},
2023-10-18 05:25:38 +13:00
{:benchee, "~> 1.1", only: [:dev, :test]},
2023-02-01 16:35:12 +13:00
{:git_ops, "~> 2.5", only: [:dev, :test]},
{:ex_doc, github: "elixir-lang/ex_doc", only: [:dev, :test], runtime: false},
2023-02-01 16:35:12 +13:00
{:ex_check, "~> 0.14", only: [:dev, :test]},
{:credo, ">= 0.0.0", only: [:dev, :test], runtime: false},
{:dialyxir, ">= 0.0.0", only: [:dev, :test], runtime: false},
{:sobelow, ">= 0.0.0", only: [:dev, :test], runtime: false},
{:excoveralls, "~> 0.14", only: [:dev, :test]}
2020-06-03 14:47:41 +12:00
]
end
2023-08-01 15:37:53 +12:00
defp ash_version(default_version) do
case System.get_env("ASH_VERSION") do
nil ->
default_version
2023-02-11 09:41:41 +13:00
2023-08-01 15:37:53 +12:00
"local" ->
[path: "../ash"]
2023-02-11 09:41:41 +13:00
2023-08-01 15:37:53 +12:00
"main" ->
[git: "https://github.com/ash-project/ash.git"]
2023-02-11 09:41:41 +13:00
2023-08-01 15:37:53 +12:00
version when is_binary(version) ->
"~> #{version}"
2023-02-11 09:41:41 +13:00
2023-08-01 15:37:53 +12:00
version ->
version
end
end
2020-06-03 14:47:41 +12:00
defp aliases do
[
sobelow:
"sobelow --skip -i Config.Secrets --ignore-files lib/migration_generator/migration_generator.ex",
2020-06-15 19:05:21 +12:00
credo: "credo --strict",
2023-09-23 08:14:25 +12:00
docs: [
2024-01-09 02:55:05 +13:00
"spark.cheat_sheets",
2023-09-23 08:14:25 +12:00
"docs",
"spark.replace_doc_links",
2023-09-23 08:14:25 +12:00
"spark.cheat_sheets_in_search"
],
2022-09-09 05:28:58 +12:00
"spark.formatter": "spark.formatter --extensions AshPostgres.DataLayer",
2023-09-23 08:14:25 +12:00
"spark.cheat_sheets": "spark.cheat_sheets --extensions AshPostgres.DataLayer",
2023-09-23 09:16:47 +12:00
"spark.cheat_sheets_in_search":
"spark.cheat_sheets_in_search --extensions AshPostgres.DataLayer",
"test.generate_migrations": "ash_postgres.generate_migrations",
"test.check_migrations": "ash_postgres.generate_migrations --check",
"test.migrate_tenants": "ash_postgres.migrate --tenants",
"test.migrate": "ash_postgres.migrate",
"test.rollback": "ash_postgres.rollback",
"test.create": "ash_postgres.create",
"test.reset": ["test.drop", "test.create", "test.migrate", "ash_postgres.migrate --tenants"],
"test.drop": "ash_postgres.drop"
2019-10-07 09:36:18 +13:00
]
end
end