From 9bdf924ba2e0d728c4f1c1aa0de12410882ef4de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Wed, 20 Oct 2021 08:16:48 +0200 Subject: [PATCH 1/2] Add mix.exs This allows Elixir to compile the project without shelling out to Rebar 3, which is useful in low memory environments. Generally speaking, I wouldn't say this is a requirement for projects, but given telemetry usage is widespread, it makes sense to optimize it to different build tools. The only downside is that the vsn can no longer be hardcoded to "git". For this reason, we also introduce a "RELEASE.md" file with steps to release a new version (which already requires some extra steps due to the use of ExDoc for docs). --- RELEASE.md | 7 +++++++ mix.exs | 20 ++++++++++++++++++++ src/telemetry.app.src | 2 +- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 RELEASE.md create mode 100644 mix.exs diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 0000000..7d2aad2 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,7 @@ +# Steps for publishing new version + +1. Update version in `src/telemetry.app.src` +2. Update version in `docs.sh` +3. Run `./docs.sh` +4. Run `rebar3 hex publish` +5. Run `rebar3 hex docs` diff --git a/mix.exs b/mix.exs new file mode 100644 index 0000000..eb2c802 --- /dev/null +++ b/mix.exs @@ -0,0 +1,20 @@ +# This file is only used by Telemetry as a dependency. +# Use rebar3 instead for compiling, running tests, etc. +defmodule Telemetry.MixProject do + use Mix.Project + + {:ok, [{:application, :telemetry, props}]} = :file.consult("src/telemetry.app.src") + @props props + + def application do + @props + end + + def project do + [ + app: :telemetry, + version: to_string(application()[:vsn]), + language: :erlang + ] + end +end diff --git a/src/telemetry.app.src b/src/telemetry.app.src index 9b6c9eb..cbbe8e6 100644 --- a/src/telemetry.app.src +++ b/src/telemetry.app.src @@ -1,6 +1,6 @@ {application, telemetry, [{description, "Dynamic dispatching library for metrics and instrumentations"}, - {vsn, "git"}, + {vsn, "1.0.0"}, {registered, []}, {mod, {telemetry_app, []}}, {applications, From d60686e406960c8df5defb83b6ed8e8554f22bf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Thu, 21 Oct 2021 21:32:58 +0200 Subject: [PATCH 2/2] Update RELEASE.md --- RELEASE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 7d2aad2..2318daf 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -3,5 +3,5 @@ 1. Update version in `src/telemetry.app.src` 2. Update version in `docs.sh` 3. Run `./docs.sh` -4. Run `rebar3 hex publish` -5. Run `rebar3 hex docs` +4. Run `rebar3 as docs hex publish` +5. Run `rebar3 as docs hex docs`