forked from keichan34/exfile
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmix.exs
97 lines (90 loc) · 2.37 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
defmodule Exfile.Mixfile do
use Mix.Project
def project do
[
app: :exfile,
version: "0.3.4",
elixir: "~> 1.2",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
deps: deps(),
elixirc_paths: elixirc_paths(Mix.env),
source_url: "https://github.com/keichan34/exfile",
docs: [
extras: ["README.md"]
],
package: package(),
description: description(),
dialyzer: [
plt_file: ".local.plt",
plt_add_apps: [
:plug,
:ecto,
:phoenix,
:phoenix_html,
:inets
]
],
aliases: [
"test": ["ecto.create --quiet", "ecto.migrate", "test"],
"publish": [&git_tag/1, "hex.publish", "hex.docs"]
]
]
end
# Configuration for the OTP application
#
# Type "mix help compile.app" for more information
def application do
[
mod: {Exfile, []},
applications: [
:logger,
:plug,
:crypto,
:inets
]
]
end
# Specifies which paths to compile per environment.
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
defp deps do
[
{:plug, "~> 1.0"},
{:ecto, "~> 1.0 or ~> 2.0", optional: true},
{:phoenix, "~> 1.1", optional: true},
{:phoenix_html, "~> 2.3", optional: true},
{:poison, "~> 1.5 or ~> 2.0", optional: true},
{:timex, "~> 2.0", only: [:dev, :test]},
{:postgrex, "~> 0.11", only: [:dev, :test]},
{:earmark, "~> 1.1", only: :dev},
{:ex_doc, "~> 0.15", only: :dev}
]
end
defp package do
[
files: ["lib", "priv", "mix.exs", "README*", "LICENSE*"],
maintainers: ["Keitaroh Kobayashi"],
licenses: ["MIT"],
links: %{
"GitHub" => "https://github.com/keichan34/exfile",
"Docs" => "http://hexdocs.pm/exfile/readme.html"
}
]
end
defp description do
"""
File upload persistence and processing for Phoenix / Plug.
"""
end
defp git_tag(_args) do
version_tag = case Version.parse(project()[:version]) do
{:ok, %Version{pre: []}} ->
"v" <> project()[:version]
_ ->
raise "Version should be a release version."
end
System.cmd "git", ["tag", "-a", version_tag, "-m", "Release #{version_tag}"]
System.cmd "git", ["push", "--tags"]
end
end