Skip to main content

mix.exs

defmodule AppleIntents.MixProject do
  use Mix.Project

  @version "0.1.1"
  @source_url "https://github.com/dl-alexandre/apple_intents"

  def project do
    [
      app: :apple_intents,
      version: @version,
      elixir: "~> 1.19",
      elixirc_paths: elixirc_paths(Mix.env()),
      start_permanent: Mix.env() == :prod,
      deps: deps(),
      description: description(),
      package: package(),
      docs: docs(),
      source_url: @source_url
    ]
  end

  def application do
    [
      extra_applications: [:logger, :crypto, :public_key]
    ]
  end

  defp elixirc_paths(:test), do: ["lib", "test/support"]
  defp elixirc_paths(_), do: ["lib"]

  defp deps do
    [
      {:ecto, "~> 3.12"},
      {:jason, "~> 1.4"},
      {:jose, "~> 1.11"},
      {:plug, "~> 1.14"},
      {:req, "~> 0.5"},
      {:x509, "~> 0.9"},
      {:bypass, "~> 2.1", only: :test},
      {:credo, "~> 1.7", only: [:dev, :test], runtime: false},
      {:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
      {:ex_doc, "~> 0.34", only: :dev, runtime: false},
      {:plug_cowboy, "~> 2.7", only: :test},
      {:stream_data, "~> 1.1", only: :test}
    ]
  end

  defp description do
    "Server-side App Intents fulfillment — JWS verification, typed handlers, orchestration"
  end

  defp package do
    [
      name: "apple_intents",
      files: ~w(lib priv mix.exs README.md LICENSE CHANGELOG.md),
      licenses: ["MIT"],
      links: %{"GitHub" => @source_url}
    ]
  end

  defp docs do
    [
      main: "readme",
      extras: ["README.md", "CHANGELOG.md"],
      groups_for_modules: [
        Core: [
          AppleIntents.Fulfillment,
          AppleIntents.Intent,
          AppleIntents.Delegated,
          AppleIntents.Approval,
          AppleIntents.Plug,
          AppleIntents.ApprovalPlug,
          AppleIntents.Response,
          AppleIntents.Orchestration,
          AppleIntents.Orchestrator
        ],
        Security: [AppleIntents.JWS, AppleIntents.PublicKeys],
        Types: [AppleIntents.Payload, AppleIntents.Context, AppleIntents.Schema],
        Privacy: [AppleIntents.Privacy],
        HTTP: [AppleIntents.HTTP],
        Config: [AppleIntents.Config],
        Errors: [AppleIntents.Error]
      ]
    ]
  end
end