-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmix.exs
108 lines (98 loc) · 3.42 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
defmodule Drizzle.MixProject do
use Mix.Project
@app :drizzle
@target System.get_env("MIX_TARGET") || :host
@all_targets [:rpi, :rpi0, :rpi2, :rpi3, :rpi3a, :rpi4, :bbb, :x86_64]
def project do
[
app: @app,
version: "0.1.1",
elixir: "~> 1.9",
target: @target,
archives: [nerves_bootstrap: "~> 1.6"],
build_embedded: true,
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps: deps(),
releases: [{@app, release()}],
preferred_cli_target: [run: :host, test: :host]
]
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: {Drizzle.Application, []},
extra_applications: [:logger, :runtime_tools, :os_mon]
]
end
def release do
[
overwrite: true,
cookie: "#{@app}_cookie",
include_erts: &Nerves.Release.erts/0,
steps: [&Nerves.Release.init/1, :assemble],
strip_beams: Mix.env() == :prod,
#applications: [:drizzle_ui]
#applications: [drizzle_ui: :load]
]
end
defp aliases do
[
loadconfig: [&bootstrap/1],
setup: ["deps.get", "cmd npm install --prefix assets"],
assets: ["cmd npm run deploy --prefix assets"],
firmware: ["assets", "firmware"]
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:circuits_gpio, "~> 0.1"},
{:cubdb, "~> 1.0.0-rc.3"},
{:ecto, "~> 3.0"},
{:finch, "~> 0.2.0"},
{:jason, "~> 1.2.1"},
#{:drizzle_ui, path: "drizzle_ui", runtime: false},
# {:drizzle_ui, path: "drizzle_ui"},
{:nerves, "~> 1.6", runtime: false},
{:shoehorn, "~> 0.6"},
{:toolshed, "~> 0.2"},
{:vintage_net, "~> 0.7.9"},
{:vintage_net_wizard, "~> 0.2.3"},
# UI Dependencies
{:phoenix, "~> 1.5.1"},
{:phoenix_ecto, "~> 4.1"},
{:phoenix_live_view, "~> 0.13"},
{:floki, ">= 0.0.0", only: :test},
{:phoenix_html, "~> 2.11"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:phoenix_live_dashboard, "~> 0.2"},
{:telemetry_metrics, "~> 0.4"},
{:telemetry_poller, "~> 0.4"},
{:gettext, "~> 0.11"},
{:plug_cowboy, "~> 2.0"},
# Dependencies for all targets except :host
{:nerves_time, "~> 0.2", targets: @all_targets},
{:nerves_pack, "~> 0.3", targets: @all_targets},
{:nerves_firmware_ssh, "~> 0.3", targets: @all_targets},
{:nerves_runtime_shell, "~> 0.1.0", targets: @all_targets},
{:ring_logger, "~> 0.8", targets: @all_targets},
# Dependencies for specific targets
{:nerves_system_rpi, "~> 1.11", runtime: false, targets: :rpi},
{:nerves_system_rpi0, "~> 1.11", runtime: false, targets: :rpi0},
{:nerves_system_rpi2, "~> 1.11", runtime: false, targets: :rpi2},
{:nerves_system_rpi3, "~> 1.11", runtime: false, targets: :rpi3},
{:nerves_system_rpi3a, "~> 1.11", runtime: false, targets: :rpi3a},
{:nerves_system_rpi4, "~> 1.11", runtime: false, targets: :rpi4},
{:nerves_system_bbb, "~> 2.6", runtime: false, targets: :bbb},
{:nerves_system_x86_64, "~> 1.11", runtime: false, targets: :x86_64}
]
end
end