forked from apache/couchdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmix.exs
61 lines (53 loc) · 1.83 KB
/
mix.exs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
defmodule CouchDBTest.Mixfile do
use Mix.Project
def project do
[
app: :couchdbtest,
version: "0.1.0",
elixir: "~> 1.5",
lockfile: Path.expand("mix.lock", __DIR__),
deps_path: Path.expand("src", __DIR__),
build_path: Path.expand("_build", __DIR__),
compilers: [:elixir, :app],
start_permanent: Mix.env() == :prod,
build_embedded: Mix.env() == :prod,
deps: deps(),
consolidate_protocols: Mix.env() not in [:test, :dev, :integration],
test_paths: get_test_paths(Mix.env()),
elixirc_paths: elixirc_paths(Mix.env())
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger],
applications: [:httpotion]
]
end
# Specifies which paths to compile per environment.
defp elixirc_paths(:test), do: ["test/elixir/lib", "test/elixir/test/support"]
defp elixirc_paths(:integration), do: ["test/elixir/lib", "test/elixir/test/support"]
defp elixirc_paths(_), do: ["test/elixir/lib"]
# Run "mix help deps" to learn about dependencies.
defp deps() do
[
{:junit_formatter, "~> 3.0", only: [:dev, :test, :integration]},
{:httpotion, ">= 3.1.3", only: [:dev, :test, :integration], runtime: false},
{:jiffy, path: Path.expand("src/jiffy", __DIR__)},
{:ibrowse,
path: Path.expand("src/ibrowse", __DIR__), override: true, compile: false},
{:credo, "~> 1.0.0", only: [:dev, :test, :integration], runtime: false}
]
end
def get_test_paths(:test) do
Path.wildcard("src/*/test/exunit") |> Enum.filter(&File.dir?/1)
end
def get_test_paths(:integration) do
integration_tests =
Path.wildcard("src/*/test/integration") |> Enum.filter(&File.dir?/1)
["test/elixir/test" | integration_tests]
end
def get_test_paths(_) do
[]
end
end