defmodule Retort.Mixfile do use Mix.Project def project do [ aliases: aliases(), app: :retort, build_embedded: Mix.env == :prod, deps: deps(), description: description(), docs: docs(), elixir: "~> 1.3", elixirc_paths: elixirc_paths(Mix.env), package: package(), preferred_cli_env: [ "ecto.create": :test, "ecto.drop": :test, "ecto.migrate": :test, "ecto.migrations": :test, "credo": :test, "dialyze": :test ], source_url: "https://github.com/C-S-D/retort", start_permanent: Mix.env == :prod, version: "1.1.0" ] end # Configuration for the OTP application # # Type "mix help compile.app" for more information def application do [ applications: applications(Mix.env), mod: {Retort, []} ] end ## Private Functions defp aliases do [ "test": ["ecto.drop", "ecto.create --quiet", "ecto.migrate", "test"] ] end defp applications(:test) do [:ex_machina, :faker, :postgrex, :tzdata | applications(:dev)] end defp applications(_) do ~w( amqp calcinator connection ecto ja_serializer logger poison )a end defp deps('19') do # Sorted by name [ # dependency of `amqp` that needs to be overriden for OTP 19 compatibility {:amqp_client, git: "https://github.com/dsrosario/amqp_client.git", branch: "erlang_otp_19", override: true} | deps('18') ] end defp deps(_) do # Sorted by name [ # JSONAPI document parsing and coding with automatic JSONAPI error document production {:alembic, ">= 3.1.1 and < 3.2.0"}, # connect to RabbitMQ {:amqp, "~> 0.1.4"}, {:calcinator, ">= 1.5.1 and < 3.0.0"}, # Connect, retry, and backoff for RabbitMQ connection {:connection, "~> 1.0"}, # Static analysis {:credo, "0.6.0", only: [:test]}, # Type checking {:dialyze, "~> 0.2.1", only: [:test]}, # Access database for interpreter-server owned schemas and decode/encode JSON for using schemas {:ecto, "~> 2.1"}, # Documentation {:ex_doc, "~> 0.14.5", only: [:dev, :test]}, # Build and create fake Ecto models (think FactoryGirl for Ecto) {:ex_machina, "~> 1.0", only: :test}, # Fake data for tests, so we don't have to come up with our own sequences for ExMachina {:faker, "~> 0.7.0", only: :test}, # `*View`s {:ja_serializer, "~> 0.11.0"}, # JUnit output for CircleCI parsing test results {:junit_formatter, "~> 1.0", only: :test}, # JSON decoding and encoding for JSONRPC and JSONAPI {:poison, "~> 2.0"}, # PostgreSQL DB access for Ecto for tests {:postgrex, "~> 0.13.0", only: :test}, # time calculations for `Factory` {:timex, "~> 3.0", only: :test}, # UUIDs for JSON RPC id / RabbitMQ correlation_id to match use of `SecureRandom.uuid` in Ruby {:uuid, "~> 1.1"} ] end defp deps do :otp_release |> :erlang.system_info() |> deps() end defp description do """ JSONAPI over JSONRPC over RabbitMQ. """ end defp docs do [ extras: extras() ] end # Specifies which paths to compile per environment. defp elixirc_paths(:test), do: ["lib", "test/support"] defp elixirc_paths(_), do: ["lib"] defp extras do [ "CHANGELOG.md", "CODE_OF_CONDUCT.md", "CONTRIBUTING.md", "LICENSE.md", "README.md", ] end defp package do [ files: ["lib", "mix.exs" | extras()], licenses: ["Apache 2.0"], links: %{ "Docs" => "https://hexdocs.pm/retort", "Github" => "https://github.com/C-S-D/retort" }, maintainers: ["Luke Imhoff"] ] end end