Packages

Environment configuration parser. Purely functional, server free.

Current section

Files

Jump to
Raw

mix.exs

defmodule Analytics3i.Mixfile do
use Mix.Project
@project_url "https://github.com/merqlove/analytics_3i"
@version "0.1.5"
def project do
[
app: :analytics_3i,
version: @version,
elixir: "~> 1.5",
elixirc_paths: elixirc_paths(Mix.env),
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
deps: deps(),
source_url: @project_url,
homepage_url: @project_url,
description: "Environment configuration parser. Purely functional, server free.",
package: package(),
test_coverage: [tool: ExCoveralls],
preferred_cli_env: cli_env_for(:test, [
"coveralls", "coveralls.detail", "coveralls.html", "coveralls.post",
]),
aliases: aliases(),
docs: docs()
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[applications: [:logger, :httpoison]]
end
defp elixirc_paths(:test), do: elixirc_paths() ++ ["test/support"]
defp elixirc_paths(_), do: elixirc_paths()
defp elixirc_paths, do: ["lib"]
defp cli_env_for(env, tasks) do
Enum.reduce(tasks, [], fn(key, acc) -> Keyword.put(acc, :"#{key}", env) end)
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:poison, "~> 3.0"},
{:httpoison, "~> 1.2.0"},
{:html_sanitize_ex, "~> 1.3.0", warn_missing: false},
{:envex, "~> 0.1"},
{:logger_file_backend, "~> 0.0.10", only: [:dev, :test]},
{:ex_doc, "~> 0.11", only: :dev, runtime: false},
{:earmark, ">= 0.0.0", only: :dev},
{:ex_spec, "~> 2.0.0", only: :test},
{:excoveralls, "~> 0.5", only: :test},
{:secure_random, "~> 0.5", only: :test},
{:meck, "~> 0.8.4", only: :test}
]
end
defp package do
[
name: :analytics_3i,
maintainers: ["Alexander Merkulov"],
files: ~w(lib/analytics_3i/entities/*.ex lib/analytics_3i/parsers/*.ex lib/analytics_3i/config.ex
lib/analytics_3i.ex README.* mix.exs),
licenses: ["MIT"],
links: %{
"GitHub" => @project_url
}
]
end
defp git_tag(_args) do
System.cmd "git", ["tag", "v" <> Mix.Project.config[:version]]
System.cmd "git", ["push", "--tags"]
end
defp docs do
[
main: "Analytics3i",
source_ref: "v#{@version}",
source_url: @project_url
]
end
defp aliases do
[
publish: ["hex.publish", "hex.publish docs", &git_tag/1],
tag: [&git_tag/1]
]
end
end