opentelemetry-erlang-contrib/utilities/opentelemetry_telemetry/mix.exs

92 lines
2.6 KiB
Elixir
Raw Normal View History

defmodule OpentelemetryTelemetry.MixProject do
use Mix.Project
def project do
{app, desc} = load_app()
config = load_config()
[
app: app,
2022-04-14 01:22:28 +00:00
version: to_string(Keyword.fetch!(desc, :vsn)),
description: to_string(Keyword.fetch!(desc, :description)),
elixir: "~> 1.10",
start_permanent: Mix.env() == :prod,
deps: deps(Keyword.fetch!(config, :deps)),
name: "Opentelemetry Telemetry",
source_url:
"https://github.com/open-telemetry/opentelemetry-erlang-contrib/tree/main/utilities/opentelemetry_telemetry",
docs: [
markdown_processor: ExDoc.Markdown.Earmark,
main: "OpentelemetryTelemetry",
# logo: "path/to/logo.png",
# erlang_docs()
extras: []
],
aliases: [
# when build docs first build edocs with rebar3
docs: ["cmd rebar3 edoc", "docs"]
],
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([
{:dialyxir, "~> 1.1", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.29", only: :dev, runtime: false},
2022-01-05 01:58:06 +00:00
{:opentelemetry, "~> 1.0", only: [:dev, :test]},
{:opentelemetry_exporter, "~> 1.0", only: [:dev, :test]}
])
end
defp package() do
[
description: "Bridge library between Telemetry events and OpenTelemetry Erlang",
build_tools: ["rebar3", "mix"],
2022-04-14 01:22:28 +00:00
files: ~w(lib mix.exs README.md LICENSE rebar.config rebar.lock src),
licenses: ["Apache-2.0"],
links: %{
"GitHub" =>
"https://github.com/open-telemetry/opentelemetry-erlang-contrib/tree/main/utilities/opentelemetry_telemetry",
"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
Improve test matrix and add support for Elixir 1.15 and OTP 26 (#188) * Use test matrix from file * Only check formatting on specific Elixir version * Use latest patch version of each Elixir/OTP release in test matrix * Test on Elixir 1.15 and OTP 26 * Run formatter on opentelemetry_httpoison * Run formatter on opentelemetry_phoenix * Run formatter on opentelemetry_tesla * Fix building opentelemetry_ecto on Elixir 1.15 Upgraded deps to fix ssl_verify_fun not compiling * Fix building opentelemetry_dataloader on Elixir 1.15 Upgraded deps to fix ssl_verify_fun and ecto_sql not compiling * Upgrade opentelemetry_finch to build on Elixir 1.15 * Upgrade opentelemetry_httpoison deps to build on 1.15 * Upgrade opentelemetry_nebulex to build on Elixir 1.15 * Upgrade opentelemetry_oban to build on Elixir 1.15 * Upgrade opentelemetry_phoenix deps to build on 1.15 * Upgrade opentelemetry_redix deps to build on 1.15 * Fix warning about <> being ambiguous * Fix assertion on attributes keys These are always atoms, not strings. * Upgrade ssl_verify_fun in opentelemetry_telemetry * Deterministically sort keys before asserting in tests * Upgrade opentelemetry_process_propogator to build on Elixir 1.15 * Run mix format on opentelemetry_process_propogator * Assert keys are atoms, not strings * Use matrix.os to define runs-on parameter * Pin test matrix to specific OTP + Elixir versions * Run formatter on telemetry and process_propagator * Run formatter over opentelemetry_phoenix --------- Co-authored-by: Tristan Sloughter <t@crashfast.com>
2023-08-25 20:11:23 +00:00
{:ok, config} = :file.consult(~c"rebar.config")
config
end
defp load_app do
Improve test matrix and add support for Elixir 1.15 and OTP 26 (#188) * Use test matrix from file * Only check formatting on specific Elixir version * Use latest patch version of each Elixir/OTP release in test matrix * Test on Elixir 1.15 and OTP 26 * Run formatter on opentelemetry_httpoison * Run formatter on opentelemetry_phoenix * Run formatter on opentelemetry_tesla * Fix building opentelemetry_ecto on Elixir 1.15 Upgraded deps to fix ssl_verify_fun not compiling * Fix building opentelemetry_dataloader on Elixir 1.15 Upgraded deps to fix ssl_verify_fun and ecto_sql not compiling * Upgrade opentelemetry_finch to build on Elixir 1.15 * Upgrade opentelemetry_httpoison deps to build on 1.15 * Upgrade opentelemetry_nebulex to build on Elixir 1.15 * Upgrade opentelemetry_oban to build on Elixir 1.15 * Upgrade opentelemetry_phoenix deps to build on 1.15 * Upgrade opentelemetry_redix deps to build on 1.15 * Fix warning about <> being ambiguous * Fix assertion on attributes keys These are always atoms, not strings. * Upgrade ssl_verify_fun in opentelemetry_telemetry * Deterministically sort keys before asserting in tests * Upgrade opentelemetry_process_propogator to build on Elixir 1.15 * Run mix format on opentelemetry_process_propogator * Assert keys are atoms, not strings * Use matrix.os to define runs-on parameter * Pin test matrix to specific OTP + Elixir versions * Run formatter on telemetry and process_propagator * Run formatter over opentelemetry_phoenix --------- Co-authored-by: Tristan Sloughter <t@crashfast.com>
2023-08-25 20:11:23 +00:00
{:ok, [{:application, name, desc}]} = :file.consult(~c"src/opentelemetry_telemetry.app.src")
{name, desc}
end
end