forked from FarmBot/farmbot_os
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mix.exs
123 lines (106 loc) · 2.47 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
defmodule Fw.Mixfile do
use Mix.Project
@target System.get_env("NERVES_TARGET") || "rpi3"
@version Path.join(__DIR__, "VERSION")
|> File.read!
|> String.strip
def project do
[app: :fw,
version: @version,
target: @target,
archives: [nerves_bootstrap: "~> 0.1.4"],
deps_path: "deps/#{@target}",
build_path: "_build/#{@target}",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
config_path: "config/config.exs",
aliases: aliases(Mix.env),
deps: deps(Mix.env) ]
end
def application do
[mod: {Fw, []},
applications: apps(Mix.env)]
end
# common for test, prod, and dev
def apps do
[:logger,
:nerves_uart,
:httpotion,
:poison,
:gen_stage,
:nerves_lib,
:rsa,
:cowboy,
:plug,
:cors_plug,
:hulaaki,
:runtime_tools
]
end
# on device
def apps(:prod) do
apps ++ platform_apps(@target) ++
[
:nerves,
:nerves_firmware_http
]
end
# dev
def apps(:dev) do
apps ++ [:fake_nerves]
end
# test
def apps(:test) do
apps
end
def deps do
[
{:nerves_uart, "~> 0.1.0"},
{:httpotion, "~> 3.0.0"},
{:poison, "~> 2.0"},
{:gen_stage, "~> 0.4"},
{:nerves_lib, github: "nerves-project/nerves_lib"},
{:rsa, "~> 0.0.1"},
{:cowboy, "~> 1.0.0"},
{:plug, "~> 1.0"},
{:cors_plug, "~> 1.1"},
{:hulaaki, github: "ConnorRigby/hulaaki"}
]
end
def deps(:prod) do
deps ++ platform_deps(@target) ++ system(@target) ++
[
{:nerves, "~> 0.3.0"},
{:nerves_firmware_http, github: "nerves-project/nerves_firmware_http"}
]
end
def deps(:test) do
deps ++ deps(:dev)
end
def deps(:dev) do
deps ++ [{:fake_nerves, github: "ConnorRigby/fake_nerves"}]
end
def platform_deps("rpi3") do
[
{:nerves_networking, github: "nerves-project/nerves_networking"},
{:nerves_interim_wifi, github: "nerves-project/nerves_interim_wifi" }
]
end
def platform_apps("rpi3") do
[ :nerves_networking,
:nerves_interim_wifi ]
end
def aliases(:prod) do
["deps.precompile": ["nerves.precompile", "deps.precompile"],
"deps.loadpaths": ["deps.loadpaths", "nerves.loadpaths"]]
end
def aliases(:test) do
[]
end
def aliases(:dev) do
[]
end
def system("rpi3") do
[{:"nerves_system_rpi3", git: "https://github.com/ConnorRigby/nerves_system_rpi3.git", tag: "v0.7.2-farmbot" }]
end
end