forked from kemonomachi/experhash
-
Notifications
You must be signed in to change notification settings - Fork 1
/
mix.exs
53 lines (42 loc) · 1 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
defmodule ExPerHash.Mixfile do
use Mix.Project
def project do
[app: :experhash,
name: "ExPerHash",
version: "0.1.0",
elixir: "~> 1.0",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
compilers: [:make, :elixir, :app],
aliases: aliases(),
deps: deps()]
end
def application do
[applications: [:logger, :cure]]
end
defp aliases do
[clean: ["clean", "clean.make"]]
end
defp deps do
[{:cure, "~> 0.5.0"}]
end
end
defmodule Mix.Tasks.Compile.Make do
@shortdoc "Compile C++ code"
use Mix.Task
def run(_) do
## for windows install GNUWin32 to compile
{result, _error_code} = System.cmd("make", [], stderr_to_stdout: true)
Mix.shell.info result
:ok
end
end
defmodule Mix.Tasks.Clean.Make do
@shortdoc "Delete generated C++ files"
use Mix.Task
def run(_) do
{result, _error_code} = System.cmd("make", ['clean'], stderr_to_stdout: true)
Mix.shell.info result
:ok
end
end