1defmodule Joken.Mixfile do
2  use Mix.Project
3
4  @source_url "https://github.com/joken-elixir/joken"
5  @version "2.4.1"
6
7  def project do
8    [
9      app: :joken,
10      version: @version,
11      name: "Joken",
12      elixir: "~> 1.8",
13      elixirc_paths: elixirc_paths(Mix.env()),
14      start_permanent: Mix.env() == :prod,
15      consolidate_protocols: Mix.env() != :test,
16      description: description(),
17      package: package(),
18      docs: docs(),
19      dialyzer: [plt_add_deps: :apps_direct, plt_add_apps: [:jason]],
20      test_coverage: [tool: ExCoveralls],
21      preferred_cli_env: [
22        coveralls: :test,
23        "coveralls.github": :test,
24        "coveralls.detail": :test,
25        "coveralls.post": :test,
26        "coveralls.html": :test
27      ]
28    ]
29  end
30
31  def application do
32    [
33      extra_applications: [:logger, :crypto]
34    ]
35  end
36
37  defp elixirc_paths(:test), do: ["lib", "test/support"]
38  defp elixirc_paths(_), do: ["lib"]
39
40  defp deps do
41    [
42      {:jose, "~> 1.11.2"},
43      {:jason, "~> 1.2", only: [:dev, :test]},
44      {:benchee, "~> 1.0", only: :dev},
45
46      # Docs
47      {:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
48
49      # Dialyzer
50      {:dialyxir, "~> 1.1.0", only: [:dev, :test], runtime: false},
51
52      # Credo
53      {:credo, "~> 1.5", only: :test, runtime: false},
54
55      # Test
56      {:junit_formatter, "~> 3.1", only: :test},
57      {:stream_data, "~> 0.5", only: :test},
58      {:excoveralls, "~> 0.14", only: :test}
59    ]
60  end
61
62  defp description do
63    """
64    JWT (JSON Web Token) library for Elixir.
65    """
66  end
67
68  defp package do
69    [
70      files: ["lib", "mix.exs", "README.md", "LICENSE.txt", "CHANGELOG.md"],
71      maintainers: ["Bryan Joseph", "Victor Nascimento"],
72      licenses: ["Apache-2.0"],
73      links: %{
74        "Changelog" => "https://hexdocs.pm/joken/changelog.html",
75        "GitHub" => @source_url
76      }
77    ]
78  end
79
80  defp docs do
81    [
82      extra_section: "GUIDES",
83      extras: [
84        {:"CHANGELOG.md", [title: "Changelog"]},
85        {:"README.md", [title: "Readme"]},
86        "guides/introduction.md",
87        "guides/configuration.md",
88        "guides/signers.md",
89        "guides/asymmetric_cryptography_signers.md",
90        "guides/testing.md",
91        "guides/common_use_cases.md",
92        "guides/migration_from_1.md",
93        "guides/custom_header_arguments.md"
94      ],
95      main: "readme",
96      source_url: @source_url,
97      source_ref: "v#{@version}"
98    ]
99  end
100end
101