-
Notifications
You must be signed in to change notification settings - Fork 267
/
mix.exs
175 lines (163 loc) · 4.95 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
defmodule FarmbotOS.MixProject do
use Mix.Project
@all_targets [:rpi4, :rpi3, :rpi]
@version Path.join([__DIR__, "VERSION"])
|> File.read!()
|> String.trim()
@branch System.cmd("git", ~w"rev-parse --abbrev-ref HEAD")
|> elem(0)
|> String.trim()
@commit System.cmd("git", ~w"rev-parse --verify HEAD")
|> elem(0)
|> String.trim()
System.put_env("NERVES_FW_VCS_IDENTIFIER", @commit)
System.put_env("NERVES_FW_MISC", @branch)
@elixir_version Path.join([__DIR__, "ELIXIR_VERSION"])
|> File.read!()
|> String.trim()
System.put_env("NERVES_FW_VCS_IDENTIFIER", @commit)
def project do
[
aliases: aliases(),
app: :farmbot,
archives: [nerves_bootstrap: "~> 1.12"],
branch: @branch,
build_embedded: false,
build_path: "_build/#{Mix.target()}",
commit: @commit,
compilers: Mix.compilers(),
deps_path: "deps/#{Mix.target()}",
deps: deps(),
description: "The Brains of the Farmbot Project",
docs: [
logo: "../farmbot_os/priv/static/farmbot_logo.png",
extras: Path.wildcard("../docs/**/*.md")
],
elixir: @elixir_version,
elixirc_options: [warnings_as_errors: true],
elixirc_paths: elixirc_paths(Mix.env(), Mix.target()),
homepage_url: "http://farmbot.io",
preferred_cli_env: [
coveralls: :test,
"coveralls.detail": :test,
"coveralls.post": :test,
"coveralls.html": :test
],
preferred_cli_target: [run: :host, test: :host],
releases: [{:farmbot, release()}],
source_url: "https://github.com/Farmbot/farmbot_os",
start_permanent: Mix.env() == :prod,
target: Mix.target(),
test_coverage: [tool: ExCoveralls],
version: @version
]
end
def release do
[
overwrite: true,
cookie: "democookie",
include_erts: &Nerves.Release.erts/0,
strip_beams: false,
steps: [&Nerves.Release.init/1, :assemble]
]
end
# Starting nerves_bootstrap adds the required aliases to Mix.Project.config()
# Aliases are only added if MIX_TARGET is set.
def bootstrap(args) do
Application.start(:nerves_bootstrap)
Mix.Task.run("loadconfig", args)
end
# Run "mix help compile.app" to learn about applications.
def application do
[
mod: {FarmbotOS, []},
extra_applications: [
:certifi,
:crypto,
:eex,
:inets,
:logger,
:public_key,
:rollbax,
:runtime_tools,
:ssh
]
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:busybox, "~> 0.1", targets: @all_targets},
{:certifi, "~> 2.12"},
{:circuits_gpio, "~> 1.1", targets: @all_targets},
{:circuits_i2c, "~> 2.0", targets: @all_targets},
{:circuits_uart, "~> 1.5"},
{:cors_plug, "~> 3.0", targets: @all_targets},
{:dns, "~> 2.4"},
{:ecto_sqlite3, "~> 0.15"},
{:ecto, "~> 3.11"},
{:ex_doc, "~> 0.32", only: [:dev], targets: [:host], runtime: false},
{:excoveralls, "~> 0.18", only: [:test], targets: [:host]},
{:farmbot_system_rpi,
github: "FarmBot/farmbot_system_rpi",
tag: "v1.23.1-farmbot.1",
runtime: false,
targets: :rpi},
{:farmbot_system_rpi3,
github: "FarmBot/farmbot_system_rpi3",
tag: "v1.23.1-farmbot.1",
runtime: false,
targets: :rpi3},
{:farmbot_system_rpi4,
github: "FarmBot/farmbot_system_rpi4",
tag: "v1.23.1-farmbot.1",
runtime: false,
targets: :rpi4},
{:extty, "~> 0.3"},
{:hackney, "~> 1.20"},
{:jason, "~> 1.4"},
{:luerl, "~> 1.2"},
{:mdns_lite, "~> 0.8", targets: @all_targets},
{:mimic, "~> 1.7", only: :test},
{:mix_unused, "~> 0.4", only: :dev},
{:muontrap, "~> 1.5"},
{:nerves_runtime, "~> 0.13", targets: @all_targets},
{:nerves_time, "~> 0.4", targets: @all_targets},
{:nerves, "~> 1.10", runtime: false},
{:phoenix_html, "~> 4.1"},
{:phoenix_html_helpers, "~> 1.0"},
{:plug_cowboy, "~> 2.7"},
{:ring_logger, "~> 0.11"},
{:rollbax, "~> 0.11"},
{:shoehorn, "~> 0.8"},
{:telemetry, "~> 1.2"},
{:tesla, "~> 1.9"},
{:timex, "~> 3.7"},
{:toolshed, "~> 0.3", targets: @all_targets},
{:tortoise311, "~> 0.11"},
{:uuid, "~> 1.1"},
{:vintage_net_ethernet, "~> 0.11", targets: @all_targets},
{:vintage_net_wifi, "~> 0.12", targets: @all_targets},
{:vintage_net, "~> 0.13", targets: @all_targets}
]
end
defp elixirc_paths(:test, _) do
["./lib", "./platform/host", "./test"]
end
defp elixirc_paths(_, :host) do
["./lib", "./platform/host"]
end
defp elixirc_paths(_env, _target) do
["./lib", "./platform/target"]
end
def aliases do
[
loadconfig: [&bootstrap/1],
test: [
"ecto.drop",
"ecto.migrate",
"test"
]
]
end
end