Current section
Files
Jump to
Current section
Files
mix.exs
defmodule Beaver.MixProject do
use Mix.Project
def project do
[
app: :beaver,
version: "0.4.8",
elixir: "~> 1.18",
start_permanent: Mix.env() == :prod,
elixirc_paths: elixirc_paths(Mix.env()),
deps: deps(),
description: description(),
docs: docs(),
package: package(),
compilers: [:elixir_make] ++ Mix.compilers(),
dialyzer: [
ignore_warnings: ".dialyzer_ignore.exs",
plt_core_path: ".dialyzer/core.plt",
plt_local_path: ".dialyzer/project.plt"
]
] ++
[
make_precompiler: {:nif, Kinda.Precompiler},
make_force_build: System.get_env("BEAVER_MAKE_FORCE_BUILD") in ["1", "true"],
make_precompiler_url:
System.get_env("BEAVER_ARTEFACT_URL") ||
"https://github.com/beaver-lodge/beaver/releases/download/v0.4.8/@{artefact_filename}",
make_precompiler_nif_versions: [
versions: fn _ -> ["2.16", "2.17"] end
],
make_precompiler_priv_paths: [
"lib/libmlir*",
"lib/libBeaver*",
"lib/libbeaver_*",
"lib/libMLIRBeaver*",
"*.ex",
"*.json",
"generated/ods_dump.json"
],
make_env: fn ->
%{
"KINDA_SOURCE_PATH" => Map.fetch!(Mix.Project.deps_paths(), :kinda)
}
end,
make_args: ~w{-j},
make_clean: ["clean"]
]
end
defp description() do
"Beaver, a MLIR Toolkit in Elixir"
end
defp docs() do
[
main: "Beaver",
extras: [
"guides/your-first-beaver-compiler.livemd",
"guides/incremental-compilation-runtime.md",
"guides/transform-autotuning.md",
"guides/slang.md",
"guides/dialect-conversion.md",
"guides/native-rewrite-patterns.md",
"guides/action-tracing.md",
"guides/enif-pointer-interop.md",
"guides/blocks.md",
"CONTRIBUTING.md",
"README.md"
],
filter_modules: fn m, _meta ->
name = Atom.to_string(m)
not String.contains?(name, "Beaver.MLIR.CAPI.")
end,
api_reference: false,
groups_for_modules: [
DSL: [
Beaver,
Beaver.Env,
Beaver.Pattern,
~r/^Beaver\.Pattern\.Native/,
Beaver.Slang,
~r"Beaver.Exterior.*",
Beaver.SSA
],
Utils: [
~r"Beaver.Walker.*",
~r"Beaver.Deferred.*",
~r"Beaver.Pass.*",
~r"Beaver.Printer.*",
~r"Beaver.Composer.*",
~r"Beaver.Sigils.*"
],
ENIF: [
~r"Beaver.ENIF.*"
],
MLIR: [
~r"Beaver.MLIR(?!\.Dialect).*"
],
Dialect: [
~r"Beaver.MLIR.Dialect.*"
],
Native: [
~r"Beaver.Native.*"
]
]
]
end
@external_files __DIR__ |> Path.join("external_files.txt") |> File.read!()
defp package() do
[
licenses: ["Apache-2.0", "MIT"],
links: %{"GitHub" => "https://github.com/beaver-lodge/beaver"},
files: ~w{
lib .formatter.exs mix.exs README*
checksum.exs
external_files.txt
#{@external_files}
}
]
end
def application do
[
mod: {Beaver.Application, []},
extra_applications: [:logger]
]
end
defp elixirc_paths(:dev), do: ~w{lib bench profile}
defp elixirc_paths(:test), do: ~w{lib bench profile test/support}
defp elixirc_paths(_), do: ["lib"]
defp deps do
[
{:elixir_make, "~> 0.4", runtime: false},
kinda_dep(),
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
{:benchee, "~> 1.0", only: :dev},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.4", only: :dev, runtime: false},
{:telemetry, "~> 1.0"}
]
end
defp kinda_dep do
case System.get_env("BEAVER_KINDA_PATH") do
nil ->
{:kinda, "~> 0.11.0"}
path ->
local_kinda = Path.expand(path)
unless File.dir?(local_kinda) do
raise "Kinda checkout not found at #{local_kinda}"
end
{:kinda, path: local_kinda}
end
end
end