Skip to content

Commit

Permalink
Remove Mix.Appsignal.Utils
Browse files Browse the repository at this point in the history
In the process of dropping Elixir versions before 1.11, remove
Mix.Appsignal.Utils, which was added to switch between
Application.compile_env/3 and Application.get_env/3.

[skip changeset]
  • Loading branch information
jeffkreeftmeijer committed Jun 26, 2024
1 parent 64053ae commit 7c56bf3
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions mix_helpers.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,16 @@ unless Code.ensure_loaded?(Appsignal.Agent) do
{_, _} = Code.eval_file("agent.exs")
end

defmodule Mix.Appsignal.Utils do
defmacro compile_env(app, key, default \\ nil) do
if Version.match?(System.version(), ">= 1.10.0") do
quote do
Application.compile_env(unquote(app), unquote(key), unquote(default))
end
else
quote do
Application.get_env(unquote(app), unquote(key), unquote(default))
end
end
end
end

defmodule Mix.Appsignal.Helper do
@moduledoc """
Helper functions for downloading and compiling the AppSignal agent library.
"""

require Mix.Appsignal.Utils

@erlang Mix.Appsignal.Utils.compile_env(:appsignal, :erlang, :erlang)
@os Mix.Appsignal.Utils.compile_env(:appsignal, :os, :os)
@system Mix.Appsignal.Utils.compile_env(:appsignal, :mix_system, System)
@erlang Application.compile_env(:appsignal, :erlang, :erlang)
@os Application.compile_env(:appsignal, :os, :os)
@system Application.compile_env(:appsignal, :mix_system, System)

@proxy_env_vars [
"APPSIGNAL_HTTP_PROXY",
Expand Down

0 comments on commit 7c56bf3

Please sign in to comment.