Current section

Files

Jump to
ical mix.exs
Raw

mix.exs

defmodule ICal.Mixfile do
  use Mix.Project

  @source_url "https://github.com/expothecary/ical"
  @version "3.2.1"

  def project do
    [
      app: :ical,
      name: "iCal",
      version: @version,
      elixir: "~> 1.17",
      elixirc_paths: elixirc_paths(Mix.env()),
      deps: deps(),
      docs: docs(),
      package: package(),
      preferred_cli_env: cli(),
      test_coverage: [tool: ExCoveralls]
    ]
  end

  # Run "mix help compile.app" to learn about applications.
  def application do
    [
      extra_applications: [:logger, :tools, :runtime_tools],
      mod: {ICal.Application, []}
    ]
  end

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

  defp deps do
    [
      {:time_zone_info, "~> 0.7", optional: true},
      {:mint, "~>1.7", optional: true},

      # saxy is used to generate the windows tz -> olson names code
      # see priv/generate_win32_tz_mapping.exs
      {:saxy, "~>1.6", only: :dev},
      {:sourceror, "~>1.11", only: :dev},

      # general dev and testing dependencies
      {:mix_test_watch, ">= 0.0.0", only: [:dev, :test], runtime: false},
      {:credo, "~> 1.6", only: [:dev, :test], runtime: false},
      {:excoveralls, "~> 0.14", only: :test, runtime: false},
      {:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},
      {:ex_doc, ">= 0.0.0", only: [:dev, :test], runtime: false},

      # benchmarking...
      {:bunt, "~> 1.0", only: [:dev, :test]},
      {:benchee, "~> 1.0", only: [:dev, :test]},
      {:benchee_json, "~> 1.0", only: [:dev, :test]},
      {:xfile, "~>0.4", only: [:dev, :test]},
      {:verl, "~>1.1", only: [:dev, :test]}
    ]
  end

  def cli do
    [
      preferred_envs: [
        coveralls: :test,
        "coveralls.detail": :test,
        "coveralls.github": :test,
        "coveralls.html": :test,
        "test.watch": :test
      ]
    ]
  end

  defp package do
    [
      description: "iCalendar parsing, serialization, and recurrence generation.",
      maintainers: ["Max Salminen", "Aaron Seigo"],
      licenses: ["MIT"],
      links: %{
        "Changelog" => "https://hexdocs.pm/ical/changelog.html",
        "GitHub" => @source_url
      }
    ]
  end

  defp docs do
    [
      extras: ["CHANGELOG.md", "README.md"],
      main: "readme",
      source_url: @source_url,
      source_ref: "v#{@version}",
      formatters: ["html"],
      groups_for_modules: [
        Components: [ICal.Alarm, ICal.Event, ICal.Journal, ICal.Timezone, ICal.Todo],
        Recurrences: [ICal.Recurrence],
        Alarms: [~r/ICal.Alarm.*/],
        Properties: [
          ICal.Attachment,
          ICal.Attendee,
          ICal.Contact,
          ICal.Duration,
          ICal.RequestStatus,
          ICal.Timezone.Properties
        ]
      ]
    ]
  end
end