forked from elixir-tools/next-ls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mix.exs
114 lines (104 loc) · 3.3 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
defmodule NextLS.MixProject do
use Mix.Project
@version "0.22.8" # x-release-please-version
def project do
[
app: :next_ls,
description:
"The language server for Elixir that just works. No longer published to Hex, please see our GitHub Releases for downloads.",
version: @version,
elixir: "~> 1.13",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
releases: releases(),
default_release: :next_ls,
package: package(),
deps: deps(),
docs: [
# The main page in the docs
main: "README",
extras: ["README.md"]
],
dialyzer: [
plt_core_path: "priv/plts",
plt_local_path: "priv/plts",
ignore_warnings: ".dialyzer_ignore.exs"
]
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger, :crypto],
mod: {NextLS.Application, []}
]
end
def releases do
[
plain: [],
next_ls: [
steps: [:assemble, &Burrito.wrap/1],
burrito: [
targets:
inject_custom_erts(
darwin_arm64: [os: :darwin, cpu: :aarch64],
darwin_amd64: [os: :darwin, cpu: :x86_64],
linux_arm64: [os: :linux, cpu: :aarch64],
linux_amd64: [os: :linux, cpu: :x86_64],
windows_amd64: [os: :windows, cpu: :x86_64]
)
]
]
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:exqlite, "~> 0.13.14"},
{:gen_lsp, "~> 0.10"},
# {:gen_lsp, path: "../gen_lsp"},
{:req, "~> 0.3"},
{:schematic, "~> 0.2"},
{:spitfire, github: "elixir-tools/spitfire"},
# {:spitfire, path: "../spitfire"},
{:sourceror, "~> 1.0"},
{:opentelemetry, "~> 1.3"},
{:opentelemetry_api, "~> 1.2"},
{:opentelemetry_exporter, "~> 1.4"},
{:opentelemetry_process_propagator, "~> 0.2.2"},
{:opentelemetry_telemetry, "~> 1.0"},
{:burrito, "~> 1.0", only: [:dev, :prod]},
{:bypass, "~> 2.1", only: :test},
{:dialyxir, ">= 0.0.0", only: [:dev, :test], runtime: false},
{:credo, "~> 1.7.7", only: [:dev, :test], runtime: false},
{:ex_doc, ">= 0.0.0", only: :dev},
{:styler, "~> 1.0-rc.0", only: :dev}
]
end
defp package do
[
maintainers: ["Mitchell Hanberg"],
licenses: ["MIT"],
links: %{
GitHub: "https://github.com/elixir-tools/next-ls",
Sponsor: "https://github.com/sponsors/mhanberg",
Downloads: "https://github.com/elixir-tools/next-ls/releases"
},
files: ~w(lib LICENSE mix.exs priv README.md .formatter.exs)
]
end
defp inject_custom_erts(targets) do
# By default, Burrito downloads ERTS from https://burrito-otp.b-cdn.net.
# When building with Nix, side-effects like network access are not allowed,
# so we need to inject our own ERTS path.
erts_path = System.get_env("BURRITO_ERTS_PATH", "")
Enum.map(targets, fn {target_name, target_conf} ->
case erts_path do
"" -> {target_name, target_conf}
path -> {target_name, [{:custom_erts, path} | target_conf]}
end
end)
end
end