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 """
|
2024-05-02 07:22:28 +12:00
|
|
|
The PostgreSQL data layer for Ash Framework
|
2019-12-05 04:13:24 +13:00
|
|
|
"""
|
|
|
|
|
2024-06-14 01:54:16 +12:00
|
|
|
@version "2.0.9"
|
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,
|
2024-03-12 15:08:25 +13:00
|
|
|
elixir: "~> 1.13",
|
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-09-03 20:18:11 +12:00
|
|
|
elixirc_paths: elixirc_paths(Mix.env()),
|
2024-04-30 09:04:24 +12:00
|
|
|
consolidate_protocols: Mix.env() == :prod,
|
2020-06-03 14:47:41 +12:00
|
|
|
preferred_cli_env: [
|
|
|
|
coveralls: :test,
|
2021-02-25 07:59:49 +13:00
|
|
|
"coveralls.github": :test,
|
|
|
|
"test.create": :test,
|
|
|
|
"test.migrate": :test,
|
2023-09-06 17:18:57 +12:00
|
|
|
"test.rollback": :test,
|
2021-02-25 07:59:49 +13:00
|
|
|
"test.migrate_tenants": :test,
|
2022-05-19 05:21:58 +12:00
|
|
|
"test.check_migrations": :test,
|
2021-02-25 07:59:49 +13:00
|
|
|
"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: [
|
2020-09-11 12:26:47 +12:00
|
|
|
plt_add_apps: [:ecto, :ash, :mix]
|
2020-06-03 15:29:11 +12:00
|
|
|
],
|
2020-06-14 19:04:18 +12:00
|
|
|
docs: docs(),
|
2020-06-03 14:47:41 +12:00
|
|
|
aliases: aliases(),
|
2019-12-05 04:13:24 +13:00
|
|
|
package: package(),
|
2023-09-27 16:17:47 +13:00
|
|
|
source_url: "https://github.com/ash-project/ash_postgres/",
|
|
|
|
homepage_url: "https://ash-hq.org",
|
2023-12-20 12:14:12 +13:00
|
|
|
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
|
|
|
[
|
|
|
|
mod: {AshPostgres.TestApp, []}
|
|
|
|
]
|
2021-01-27 14:21:53 +13:00
|
|
|
end
|
2021-01-27 14:02:53 +13:00
|
|
|
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"],
|
2022-08-23 14:46:20 +12:00
|
|
|
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
|
|
|
|
|
2020-06-14 19:04:18 +12:00
|
|
|
defp docs do
|
|
|
|
[
|
2024-05-02 06:40:16 +12:00
|
|
|
main: "readme",
|
2020-06-14 19:04:18 +12:00
|
|
|
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
|
|
|
|
"""
|
2023-10-03 03:56:05 +13:00
|
|
|
<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: [
|
2024-05-02 06:40:16 +12:00
|
|
|
{"README.md", title: "Home"},
|
|
|
|
"documentation/tutorials/get-started-with-ash-postgres.md",
|
|
|
|
"documentation/topics/about-ash-postgres/what-is-ash-postgres.md",
|
2024-04-10 12:21:04 +12:00
|
|
|
"documentation/topics/resources/references.md",
|
|
|
|
"documentation/topics/resources/polymorphic-resources.md",
|
|
|
|
"documentation/topics/development/migrations-and-tasks.md",
|
|
|
|
"documentation/topics/development/testing.md",
|
|
|
|
"documentation/topics/development/upgrading-to-2.0.md",
|
|
|
|
"documentation/topics/advanced/expressions.md",
|
|
|
|
"documentation/topics/advanced/schema-based-multitenancy.md",
|
|
|
|
"documentation/topics/advanced/manual-relationships.md",
|
2024-03-28 10:30:30 +13:00
|
|
|
"documentation/dsls/DSL:-AshPostgres.DataLayer.md",
|
|
|
|
"CHANGELOG.md"
|
2024-01-13 08:48:41 +13:00
|
|
|
],
|
|
|
|
groups_for_extras: [
|
2024-05-02 06:40:16 +12:00
|
|
|
Tutorials: ~r"documentation/tutorials",
|
|
|
|
Resources: ~r"documentation/topics",
|
|
|
|
Development: ~r"documentation/topics/development",
|
|
|
|
"About AshPostgres": ["CHANGELOG.md"],
|
|
|
|
Advanced: ~r"documentation/topics/advanced",
|
|
|
|
Reference: ~r"documentation/topics/dsls",
|
|
|
|
DSLs: ~r"documentation/dsls"
|
2024-04-10 12:21:04 +12:00
|
|
|
],
|
|
|
|
skip_undefined_reference_warnings_on: [
|
|
|
|
"CHANGELOG.md",
|
|
|
|
"documentation/development/upgrading-to-2.0.md"
|
2024-01-13 08:48:41 +13:00
|
|
|
],
|
2024-01-13 08:27:14 +13:00
|
|
|
nest_modules_by_prefix: [
|
|
|
|
AshPostgres.Functions
|
|
|
|
],
|
2020-06-14 19:04:18 +12:00
|
|
|
groups_for_modules: [
|
2022-08-24 11:56:46 +12:00
|
|
|
AshPostgres: [
|
2023-02-09 16:56:00 +13:00
|
|
|
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,
|
2024-05-05 22:08:21 +12:00
|
|
|
AshPostgres.Tsvector,
|
|
|
|
AshPostgres.Timestamptz,
|
|
|
|
AshPostgres.TimestamptzUsec
|
2023-09-23 08:14:25 +12:00
|
|
|
],
|
|
|
|
Extensions: [
|
2023-09-23 09:16:47 +12:00
|
|
|
AshPostgres.Extensions.Vector
|
2022-08-24 11:56:46 +12:00
|
|
|
],
|
2022-12-08 14:32:38 +13: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.TrigramSimilarity,
|
|
|
|
AshPostgres.Functions.ILike,
|
|
|
|
AshPostgres.Functions.Like,
|
|
|
|
AshPostgres.Functions.VectorCosineDistance
|
2024-01-13 08:27:14 +13:00
|
|
|
]
|
2020-06-14 19:04:18 +12:00
|
|
|
]
|
|
|
|
]
|
|
|
|
end
|
|
|
|
|
2019-10-07 09:36:18 +13:00
|
|
|
# Run "mix help deps" to learn about dependencies.
|
|
|
|
defp deps do
|
|
|
|
[
|
2024-05-24 17:14:55 +12:00
|
|
|
{:ash, ash_version("~> 3.0 and >= 3.0.7")},
|
2024-06-14 01:41:13 +12:00
|
|
|
{:ash_sql, ash_sql_version("~> 0.2 and >= 0.2.4")},
|
2022-10-08 08:50:20 +13:00
|
|
|
{:ecto_sql, "~> 3.9"},
|
|
|
|
{:ecto, "~> 3.9"},
|
2020-10-01 13:57:22 +13:00
|
|
|
{:jason, "~> 1.0"},
|
2019-10-07 09:36:18 +13:00
|
|
|
{:postgrex, ">= 0.0.0"},
|
2024-03-28 09:52:28 +13:00
|
|
|
# dev/test dependencies
|
2024-03-30 01:55:16 +13:00
|
|
|
{:simple_sat, "~> 0.1", only: [:dev, :test]},
|
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]},
|
2023-09-27 16:17:47 +13:00
|
|
|
{: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},
|
2024-04-22 01:56:19 +12:00
|
|
|
{:mix_audit, ">= 0.0.0", only: [:dev, :test], runtime: false},
|
2023-02-01 16:35:12 +13:00
|
|
|
{:dialyxir, ">= 0.0.0", only: [:dev, :test], runtime: false},
|
2024-04-12 03:39:49 +12:00
|
|
|
{:sobelow, ">= 0.0.0", only: [:dev, :test], runtime: false}
|
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" ->
|
2024-04-02 06:58:44 +13:00
|
|
|
[path: "../ash", override: true]
|
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-08-22 04:35:05 +12:00
|
|
|
|
2024-04-23 03:31:13 +12:00
|
|
|
defp ash_sql_version(default_version) do
|
|
|
|
case System.get_env("ASH_SQL_VERSION") do
|
|
|
|
nil ->
|
|
|
|
default_version
|
|
|
|
|
|
|
|
"local" ->
|
|
|
|
[path: "../ash_sql", override: true]
|
|
|
|
|
|
|
|
"main" ->
|
|
|
|
[git: "https://github.com/ash-project/ash_sql.git"]
|
|
|
|
|
|
|
|
version when is_binary(version) ->
|
|
|
|
"~> #{version}"
|
|
|
|
|
|
|
|
version ->
|
|
|
|
version
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-06-03 14:47:41 +12:00
|
|
|
defp aliases do
|
|
|
|
[
|
2020-09-11 12:26:47 +12:00
|
|
|
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",
|
2023-09-27 16:17:47 +13:00
|
|
|
"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",
|
2021-02-25 07:59:49 +13:00
|
|
|
"test.generate_migrations": "ash_postgres.generate_migrations",
|
2022-05-19 05:21:58 +12:00
|
|
|
"test.check_migrations": "ash_postgres.generate_migrations --check",
|
2021-02-25 07:59:49 +13:00
|
|
|
"test.migrate_tenants": "ash_postgres.migrate --tenants",
|
|
|
|
"test.migrate": "ash_postgres.migrate",
|
2023-09-06 17:18:57 +12:00
|
|
|
"test.rollback": "ash_postgres.rollback",
|
2021-02-25 07:59:49 +13:00
|
|
|
"test.create": "ash_postgres.create",
|
2021-11-14 07:56:14 +13:00
|
|
|
"test.reset": ["test.drop", "test.create", "test.migrate", "ash_postgres.migrate --tenants"],
|
2021-02-25 07:59:49 +13:00
|
|
|
"test.drop": "ash_postgres.drop"
|
2019-10-07 09:36:18 +13:00
|
|
|
]
|
|
|
|
end
|
|
|
|
end
|