2022-03-23 13:02:28 -06:00
|
|
|
defmodule OpentelemetryProcessPropagator.MixProject do
|
|
|
|
use Mix.Project
|
|
|
|
|
|
|
|
def project do
|
|
|
|
{app, desc} = load_app()
|
|
|
|
config = load_config()
|
|
|
|
|
|
|
|
[
|
|
|
|
app: app,
|
2022-03-25 14:53:37 -06:00
|
|
|
version: to_string(Keyword.fetch!(desc, :vsn)),
|
2022-03-23 13:02:28 -06:00
|
|
|
description: to_string(Keyword.fetch!(desc, :description)),
|
2023-11-09 06:26:29 -03:00
|
|
|
elixir: "~> 1.12",
|
2022-03-23 13:02:28 -06:00
|
|
|
start_permanent: Mix.env() == :prod,
|
|
|
|
deps: deps(Keyword.fetch!(config, :deps)),
|
|
|
|
name: "Opentelemetry Process Propagator",
|
|
|
|
source_url:
|
|
|
|
"https://github.com/open-telemetry/opentelemetry-erlang-contrib/tree/main/propagators/opentelemetry_process_propagator",
|
|
|
|
docs: [
|
|
|
|
markdown_processor: ExDoc.Markdown.Earmark,
|
2022-03-25 14:53:37 -06:00
|
|
|
main: "OpentelemetryProcessPropagator",
|
2022-03-23 13:02:28 -06:00
|
|
|
# logo: "path/to/logo.png",
|
|
|
|
# erlang_docs()
|
|
|
|
extras: []
|
|
|
|
],
|
|
|
|
aliases: [
|
|
|
|
# when build docs first build edocs with rebar3
|
|
|
|
docs: ["cmd rebar3 edoc", "docs"]
|
|
|
|
],
|
2023-11-09 06:26:29 -03:00
|
|
|
plt_file: {:no_warn, "priv/plts/opentelemetry_process_propagator.plt"},
|
2022-03-23 13:02:28 -06:00
|
|
|
package: package()
|
|
|
|
]
|
|
|
|
end
|
|
|
|
|
|
|
|
# Run "mix help compile.app" to learn about applications.
|
|
|
|
def application do
|
|
|
|
[
|
|
|
|
extra_applications: [:logger]
|
|
|
|
]
|
|
|
|
end
|
|
|
|
|
|
|
|
defp deps(rebar) do
|
|
|
|
rebar
|
|
|
|
|> Enum.map(fn
|
|
|
|
{dep, version} -> {dep, to_string(version)}
|
|
|
|
dep when is_atom(dep) -> {dep, ">= 0.0.0"}
|
|
|
|
end)
|
|
|
|
|> Enum.concat([
|
2023-11-09 06:26:29 -03:00
|
|
|
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
|
2022-11-15 17:48:50 -07:00
|
|
|
{:ex_doc, "~> 0.29", only: :dev, runtime: false},
|
2022-03-23 13:02:28 -06:00
|
|
|
{:opentelemetry, "~> 1.0", only: [:dev, :test]},
|
|
|
|
{:opentelemetry_exporter, "~> 1.0", only: [:dev, :test]}
|
|
|
|
])
|
|
|
|
end
|
|
|
|
|
|
|
|
defp package() do
|
|
|
|
[
|
|
|
|
description: "Tools for opentelemetry context propagation across process boundaries",
|
|
|
|
build_tools: ["rebar3", "mix"],
|
2022-03-25 14:53:37 -06:00
|
|
|
files: ~w(lib mix.exs README.md LICENSE rebar.config rebar.lock src),
|
2022-03-23 13:02:28 -06:00
|
|
|
licenses: ["Apache-2.0"],
|
|
|
|
links: %{
|
|
|
|
"GitHub" =>
|
|
|
|
"https://github.com/open-telemetry/opentelemetry-erlang-contrib/tree/main/propagators/opentelemetry_process_propagator",
|
|
|
|
"OpenTelemetry Erlang" => "https://github.com/open-telemetry/opentelemetry-erlang",
|
|
|
|
"OpenTelemetry Erlang Contrib" => "https://github.com/open-telemetry/opentelemetry-erlang-contrib",
|
|
|
|
"OpenTelemetry.io" => "https://opentelemetry.io"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
end
|
|
|
|
|
|
|
|
def erlang_docs() do
|
|
|
|
files =
|
|
|
|
for file <- Path.wildcard("edoc/*.md"),
|
|
|
|
file != "edoc/README.md",
|
|
|
|
do: {String.to_atom(file), [title: Path.basename(file, ".md")]}
|
|
|
|
|
|
|
|
[{:"README.md", [title: "Overview"]} | files]
|
|
|
|
end
|
|
|
|
|
|
|
|
defp load_config do
|
2023-08-25 21:11:23 +01:00
|
|
|
{:ok, config} = :file.consult(~c"rebar.config")
|
2022-03-23 13:02:28 -06:00
|
|
|
|
|
|
|
config
|
|
|
|
end
|
|
|
|
|
|
|
|
defp load_app do
|
2023-08-25 21:11:23 +01:00
|
|
|
{:ok, [{:application, name, desc}]} = :file.consult(~c"src/opentelemetry_process_propagator.app.src")
|
2022-03-23 13:02:28 -06:00
|
|
|
|
|
|
|
{name, desc}
|
|
|
|
end
|
|
|
|
end
|