1
1
defmodule DBConnection.Mixfile do
2
2
use Mix.Project
3
3
4
+ @ source_url "https://github.com/elixir-ecto/db_connection"
4
5
@ pools [ :connection_pool , :ownership ]
5
6
@ version "2.3.1"
6
7
7
8
def project do
8
- [ app: :db_connection ,
9
- version: @ version ,
10
- elixir: "~> 1.7" ,
11
- deps: deps ( ) ,
12
- docs: docs ( ) ,
13
- description: description ( ) ,
14
- package: package ( ) ,
15
- build_per_environment: false ,
16
- consolidate_protocols: false ,
17
- test_paths: test_paths ( Mix . env ( ) ) ,
18
- aliases: [ "test.all": [ "test" , "test.pools" ] ,
19
- "test.pools": & test_pools / 1 ] ,
20
- preferred_cli_env: [ "test.all": :test ] ]
9
+ [
10
+ app: :db_connection ,
11
+ version: @ version ,
12
+ elixir: "~> 1.7" ,
13
+ deps: deps ( ) ,
14
+ docs: docs ( ) ,
15
+ description: description ( ) ,
16
+ package: package ( ) ,
17
+ build_per_environment: false ,
18
+ consolidate_protocols: false ,
19
+ test_paths: test_paths ( Mix . env ( ) ) ,
20
+ aliases: [ "test.all": [ "test" , "test.pools" ] , "test.pools": & test_pools / 1 ] ,
21
+ preferred_cli_env: [ "test.all": :test ]
22
+ ]
21
23
end
22
24
23
25
def application do
24
- [ applications: [ :logger , :connection ] ,
25
- mod: { DBConnection.App , [ ] } ]
26
+ [
27
+ applications: [ :logger , :connection ] ,
28
+ mod: { DBConnection.App , [ ] }
29
+ ]
26
30
end
27
31
28
32
defp deps do
29
- [ { :connection , "~> 1.0" } ,
30
- { :ex_doc , "~> 0.12" , only: :dev } ]
33
+ [
34
+ { :connection , "~> 1.0" } ,
35
+ { :ex_doc , ">= 0.0.0" , only: :dev , runtime: false }
36
+ ]
31
37
end
32
38
33
39
defp docs do
34
- [ source_url: "https://github.com/elixir-ecto/db_connection" ,
35
- source_ref: "v#{ @ version } " ,
36
- main: DBConnection ]
40
+ [
41
+ source_url: @ source_url ,
42
+ source_ref: "v#{ @ version } " ,
43
+ main: DBConnection ,
44
+ extras: [ "CHANGELOG.md" ]
45
+ ]
37
46
end
38
47
39
48
defp description do
@@ -43,9 +52,11 @@ defmodule DBConnection.Mixfile do
43
52
end
44
53
45
54
defp package do
46
- % { licenses: [ "Apache-2.0" ] ,
55
+ % {
56
+ licenses: [ "Apache-2.0" ] ,
47
57
maintainers: [ "James Fish" ] ,
48
- links: % { "Github" => "https://github.com/elixir-ecto/db_connection" } }
58
+ links: % { "GitHub" => @ source_url }
59
+ }
49
60
end
50
61
51
62
defp test_paths ( pool ) when pool in @ pools , do: [ "integration_test/#{ pool } " ]
@@ -56,12 +67,15 @@ defmodule DBConnection.Mixfile do
56
67
end
57
68
58
69
defp env_run ( env , args ) do
59
- args = if IO.ANSI . enabled? ( ) , do: [ "--color" | args ] , else: [ "--no-color" | args ]
70
+ args = if IO.ANSI . enabled? ( ) , do: [ "--color" | args ] , else: [ "--no-color" | args ]
60
71
61
- IO . puts "==> Running tests for MIX_ENV=#{ env } mix test"
62
- { _ , res } = System . cmd "mix" , [ "test" | args ] ,
63
- into: IO . binstream ( :stdio , :line ) ,
64
- env: [ { "MIX_ENV" , to_string ( env ) } ]
72
+ IO . puts ( "==> Running tests for MIX_ENV=#{ env } mix test" )
73
+
74
+ { _ , res } =
75
+ System . cmd ( "mix" , [ "test" | args ] ,
76
+ into: IO . binstream ( :stdio , :line ) ,
77
+ env: [ { "MIX_ENV" , to_string ( env ) } ]
78
+ )
65
79
66
80
if res > 0 do
67
81
System . at_exit ( fn _ -> exit ( { :shutdown , 1 } ) end )
0 commit comments