-
Notifications
You must be signed in to change notification settings - Fork 187
/
mix.exs
32 lines (28 loc) · 715 Bytes
/
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
# Provide aliases for running common tasks
defmodule NxRoot do
use Mix.Project
def project do
[
app: :nx_root,
version: "0.1.0",
deps: [{:nx, path: "nx"}],
aliases: [
setup: cmd("deps.get"),
compile: cmd("compile"),
test: cmd("test")
]
]
end
defp cmd(command) do
ansi = IO.ANSI.enabled?()
base = ["--erl", "-elixir ansi_enabled #{ansi}", "-S", "mix", command]
for app <- ~w(nx exla torchx) do
fn args ->
{_, res} = System.cmd("elixir", base ++ args, into: IO.binstream(:stdio, :line), cd: app)
if res > 0 do
System.at_exit(fn _ -> exit({:shutdown, 1}) end)
end
end
end
end
end