-
Notifications
You must be signed in to change notification settings - Fork 0
/
mix.exs
94 lines (84 loc) · 2.07 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
defmodule Jaqex.MixProject do
use Mix.Project
@source_url "https://github.com/shaolang/jaqex"
@version "0.1.2"
def project do
[
app: :jaqex,
aliases: aliases(),
deps: deps(),
description: "Wrapper for Jaq (a jq clone focused on correctness, speed, and simplicity)",
docs: docs(),
elixir: "~> 1.16",
package: package(),
source_url: @source_url,
start_permanent: Mix.env() == :prod,
version: @version
]
end
def application, do: []
defp aliases do
[
"gen.checksums": &gen_checksums/1,
"test.local": &test_local/1,
"test.watch.local": &test_watch_local/1
]
end
defp deps do
[
{:ex_doc, "~> 0.35", only: :dev, runtime: false},
{:jason, "~> 1.4"},
{:mix_test_watch, "~> 1.0", only: [:dev, :test], runtime: false},
{:rustler, "~> 0.35", optional: true, runtime: false},
{:rustler_precompiled, "~> 0.8"}
]
end
defp docs do
[
main: "readme",
name: "Jaqex",
source_ref: "v#{@version}",
canonical: "https://hexdocs.pm/jaqex",
source_url: @source_url,
extras: ["README.md"]
]
end
defp package do
[
maintainers: ["Shaolang Ai"],
licenses: ["MIT"],
links: %{"GitHub" => "https://github.com/shaolang/jaqex"},
files: [
"README.md",
"checksum-*.exs",
"lib",
"mix.exs",
"native/jaqex/*.toml",
"native/jaqex/.cargo",
"native/jaqex/.gitignore",
"native/jaqex/Cargo.lock",
"native/jaqex/README.md",
"native/jaqex/src",
"priv/test.json"
]
]
end
defp gen_checksums(_) do
System.cmd(
"mix",
["rustler_precompiled.download", "Jaqex", "--all", "--print"],
into: IO.stream(),
env: [{"FORCE_JAQEX_BUILD", "true"}]
)
end
defp run_tests(cmd) do
System.cmd(
"mix",
[cmd],
into: IO.stream(),
env: [{"FORCE_JAQEX_BUILD", "true"}]
)
end
defp test_local(_), do: run_tests("test")
defp test_watch_local(_), do: run_tests("test.watch")
end