-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathmix.exs
71 lines (61 loc) · 1.44 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
defmodule XLA.MixProject do
use Mix.Project
@version "0.8.0"
def project do
[
app: :xla,
version: @version,
description: "Precompiled XLA binaries",
elixir: "~> 1.12",
aliases: aliases(),
deps: deps(),
compilers: Mix.compilers() ++ if(build?(), do: [:elixir_make], else: []),
make_env: &XLA.make_env/0,
package: package(),
docs: docs()
]
end
def application do
[extra_applications: [:logger, :inets, :ssl, :public_key, :crypto]]
end
def aliases do
[
"hex.publish": [&ensure_checksum_file/1, "hex.publish"]
]
end
defp ensure_checksum_file(_) do
valid? =
case File.read("checksum.txt") do
{:ok, content} -> content =~ @version
{:error, :enoent} -> false
end
if not valid? do
raise "run mix xla.checksum before releasing"
end
end
defp deps do
[
{:elixir_make, "~> 0.4", runtime: false},
{:ex_doc, "~> 0.25", only: :dev, runtime: false}
]
end
def package do
[
licenses: ["Apache-2.0"],
links: %{
"GitHub" => "https://github.com/elixir-nx/xla"
},
files: ~w(extension lib Makefile mix.exs README.md LICENSE CHANGELOG.md checksum.txt)
]
end
def docs do
[
main: "XLA",
source_url: "https://github.com/elixir-nx/xla",
source_ref: "v#{@version}"
]
end
defp build?() do
System.get_env("XLA_BUILD") in ~w(1 true)
end
end