Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Consolidate Elixir's version into a VERSION file

  • Loading branch information...
commit 6f4398902fd2da2f20ea97931485d09050e34525 1 parent ded1747
Devin Torres devinus authored
2  Makefile
View
@@ -2,7 +2,7 @@ REBAR := $(shell echo `pwd`/rebar)
ELIXIRC := bin/elixirc --ignore-module-conflict $(ELIXIRC_OPTS)
ERLC := erlc -I lib/elixir/include
ERL := erl -I lib/elixir/include -noshell -pa lib/elixir/ebin
-VERSION := 0.8.0.dev
+VERSION := $(strip $(shell cat VERSION))
INSTALL_PATH := /usr/local
.PHONY: install compile erlang elixir dialyze test clean docs release_docs release_zip release_erl
9 RELEASE.md
View
@@ -22,10 +22,5 @@ This document simply outlines the release process:
## Places where version is mentioned
-* src/elixir.app.src
-* lib/elixir/src/elixir.app.src
-* lib/elixir/lib/system.ex
-* rel/reltool.config
-* Makefile
-* CHANGELOG
-* package.exs
+* VERSION
+* CHANGELOG
1  VERSION
View
@@ -0,0 +1 @@
+0.8.0.dev
7 lib/elixir/lib/system.ex
View
@@ -14,6 +14,11 @@ defmodule System do
with the VM or the host system.
"""
+ # Read and strip the version from the `VERSION` file.
+ defmacrop get_version do
+ Regex.replace %r/^\s+|\s+$/, File.read!("VERSION"), ""
+ end
+
# Tries to run `git describe --always --tags`. In case of success
# returns the most recent tag, otherwise returns an empty string.
defmacrop get_describe do
@@ -35,7 +40,7 @@ defmodule System do
Returns Elixir's version as binary.
"""
@spec version() :: String.t
- def version, do: "0.8.0.dev"
+ def version, do: get_version
@doc """
Returns a keywords list with version, git tag info and date.
2  package.exs
View
@@ -1,7 +1,7 @@
Expm.Package.new(
name: "elixir",
Yurii Rashkovskii
yrashk added a note

shouldn't this change also modify the tag in package.exs?

Devin Torres
devinus added a note

How do you mean?

Yurii Rashkovskii
yrashk added a note
Devin Torres
devinus added a note

Indeed, but isn't that something else? For instance, a 0.8.0.dev tag doesn't exist

Yurii Rashkovskii
yrashk added a note
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
description: "Elixir is a functional meta-programming aware language built on top of the Erlang VM",
- version: "0.8.0.dev",
+ version: String.strip(File.read!("VERSION")),
keywords: [],
homepage: "http://elixir-lang.org/",
maintainers: [[name: "José Valim", email: "jose.valim@plataformatec.com.br"]],
88 rel/reltool.config
View
@@ -1,88 +0,0 @@
-{sys, [
- {lib_dirs, []},
- {erts, [{mod_cond, derived}, {app_file, strip}]},
- {app_file, strip},
- {rel, "elixir", "0.8.0.dev",
- [
- kernel,
- stdlib,
- elixir
- ]},
- {rel, "start_clean", "1",
- [
- kernel,
- stdlib
- ]},
- {boot_rel, "elixir"},
- {profile, development},
- {excl_archive_filters, [".*"]}, %% Do not archive built libs
- {excl_app_filters, ["\.gitignore"]},
-
- {app, elixir, [{lib_dir, "../lib/elixir"}]},
- {app, eex, [{lib_dir, "../lib/eex"},{incl_cond, include}]},
- {app, ex_unit, [{lib_dir, "../lib/ex_unit"},{incl_cond, include}]},
- {app, iex, [{lib_dir, "../lib/iex"},{incl_cond, include}]},
- {app, mix, [{lib_dir, "../lib/mix"},{incl_cond, include}]},
-
- {app, appmon, [{incl_cond, include}]},
- {app, asn1, [{incl_cond, include}]},
- {app, common_test, [{incl_cond, include}]},
- {app, compiler, [{incl_cond, include}]},
-
- {app, cosEvent, [{incl_cond, include}]},
- {app, cosEventDomain, [{incl_cond, include}]},
- {app, cosFileTransfer, [{incl_cond, include}]},
- {app, cosNotification, [{incl_cond, include}]},
- {app, cosProperty, [{incl_cond, include}]},
- {app, cosTime, [{incl_cond, include}]},
- {app, cosTransactions, [{incl_cond, include}]},
-
- {app, crypto, [{incl_cond, include}]},
- {app, debugger, [{incl_cond, include}]},
- {app, dialyzer, [{incl_cond, include}]},
- {app, diameter, [{incl_cond, include}]},
- {app, et, [{incl_cond, include}]},
- {app, gs, [{incl_cond, include}]},
- {app, hipe, [{incl_cond, include}]},
- {app, ic, [{incl_cond, include}]},
- {app, inets, [{incl_cond, include}]},
- {app, megaco, [{incl_cond, include}]},
- {app, mnesia, [{incl_cond, include}]},
- {app, observer, [{incl_cond, include}]},
- {app, odbc, [{incl_cond, include}]},
- {app, orber, [{incl_cond, include}]},
- {app, os_mon, [{incl_cond, include}]},
- {app, otp_mibs, [{incl_cond, include}]},
- {app, parsetools, [{incl_cond, include}]},
- {app, percept, [{incl_cond, include}]},
- {app, pman, [{incl_cond, include}]},
- {app, public_key, [{incl_cond, include}]},
- {app, reltool, [{incl_cond, include}]},
- {app, runtime_tools, [{incl_cond, include}]},
- {app, sasl, [{incl_cond, include}]},
- {app, snmp, [{incl_cond, include}]},
- {app, ssh, [{incl_cond, include}]},
- {app, ssl, [{incl_cond, include}]},
- {app, syntax_tools, [{incl_cond, include}]},
- {app, test_server, [{incl_cond, include}]},
- {app, toolbar, [{incl_cond, include}]},
- {app, tools, [{incl_cond, include}]},
- {app, tv, [{incl_cond, include}]},
- {app, typer, [{incl_cond, include}]},
- {app, webtool, [{incl_cond, include}]},
- {app, xmerl, [{incl_cond, include}]}
- ]}.
-
-{target_dir, "elixir"}.
-
-{overlay, [
- {copy, "files/sys.config", "releases/\{\{rel_vsn\}\}/sys.config"},
- {copy, "../bin/elixir", "bin/elixir"},
- {copy, "../bin/elixir.bat", "bin/elixir.bat"},
- {copy, "../bin/elixirc", "bin/elixirc"},
- {copy, "../bin/elixirc.bat", "bin/elixirc.bat"},
- {copy, "../bin/iex", "bin/iex"},
- {copy, "../bin/iex.bat", "bin/iex.bat"},
- {copy, "../bin/mix", "bin/mix"},
- {copy, "../bin/mix.bat", "bin/mix.bat"}
- ]}.
91 rel/reltool.config.script
View
@@ -0,0 +1,91 @@
+{ok, VsnData} = file:read_file("../VERSION"),
+Vsn = re:replace(VsnData, "^\\s+|\\s+$", "", [global, {return, list}]),
+
+[
+ {sys, [
+ {lib_dirs, []},
+ {erts, [{mod_cond, derived}, {app_file, strip}]},
+ {app_file, strip},
+ {rel, "elixir", Vsn, [
+ kernel,
+ stdlib,
+ elixir
+ ]},
+ {rel, "start_clean", "1", [
+ kernel,
+ stdlib
+ ]},
+ {boot_rel, "elixir"},
+ {profile, development},
+ {excl_archive_filters, [".*"]}, %% Do not archive built libs
+ {excl_app_filters, ["\.gitignore"]},
+
+ {app, elixir, [{lib_dir, "../lib/elixir"}]},
+ {app, eex, [{lib_dir, "../lib/eex"},{incl_cond, include}]},
+ {app, ex_unit, [{lib_dir, "../lib/ex_unit"},{incl_cond, include}]},
+ {app, iex, [{lib_dir, "../lib/iex"},{incl_cond, include}]},
+ {app, mix, [{lib_dir, "../lib/mix"},{incl_cond, include}]},
+
+ {app, appmon, [{incl_cond, include}]},
+ {app, asn1, [{incl_cond, include}]},
+ {app, common_test, [{incl_cond, include}]},
+ {app, compiler, [{incl_cond, include}]},
+
+ {app, cosEvent, [{incl_cond, include}]},
+ {app, cosEventDomain, [{incl_cond, include}]},
+ {app, cosFileTransfer, [{incl_cond, include}]},
+ {app, cosNotification, [{incl_cond, include}]},
+ {app, cosProperty, [{incl_cond, include}]},
+ {app, cosTime, [{incl_cond, include}]},
+ {app, cosTransactions, [{incl_cond, include}]},
+
+ {app, crypto, [{incl_cond, include}]},
+ {app, debugger, [{incl_cond, include}]},
+ {app, dialyzer, [{incl_cond, include}]},
+ {app, diameter, [{incl_cond, include}]},
+ {app, et, [{incl_cond, include}]},
+ {app, gs, [{incl_cond, include}]},
+ {app, hipe, [{incl_cond, include}]},
+ {app, ic, [{incl_cond, include}]},
+ {app, inets, [{incl_cond, include}]},
+ {app, megaco, [{incl_cond, include}]},
+ {app, mnesia, [{incl_cond, include}]},
+ {app, observer, [{incl_cond, include}]},
+ {app, odbc, [{incl_cond, include}]},
+ {app, orber, [{incl_cond, include}]},
+ {app, os_mon, [{incl_cond, include}]},
+ {app, otp_mibs, [{incl_cond, include}]},
+ {app, parsetools, [{incl_cond, include}]},
+ {app, percept, [{incl_cond, include}]},
+ {app, pman, [{incl_cond, include}]},
+ {app, public_key, [{incl_cond, include}]},
+ {app, reltool, [{incl_cond, include}]},
+ {app, runtime_tools, [{incl_cond, include}]},
+ {app, sasl, [{incl_cond, include}]},
+ {app, snmp, [{incl_cond, include}]},
+ {app, ssh, [{incl_cond, include}]},
+ {app, ssl, [{incl_cond, include}]},
+ {app, syntax_tools, [{incl_cond, include}]},
+ {app, test_server, [{incl_cond, include}]},
+ {app, toolbar, [{incl_cond, include}]},
+ {app, tools, [{incl_cond, include}]},
+ {app, tv, [{incl_cond, include}]},
+ {app, typer, [{incl_cond, include}]},
+ {app, webtool, [{incl_cond, include}]},
+ {app, xmerl, [{incl_cond, include}]}
+ ]},
+
+ {target_dir, "elixir"},
+
+ {overlay, [
+ {copy, "files/sys.config", "releases/\{\{rel_vsn\}\}/sys.config"},
+ {copy, "../bin/elixir", "bin/elixir"},
+ {copy, "../bin/elixir.bat", "bin/elixir.bat"},
+ {copy, "../bin/elixirc", "bin/elixirc"},
+ {copy, "../bin/elixirc.bat", "bin/elixirc.bat"},
+ {copy, "../bin/iex", "bin/iex"},
+ {copy, "../bin/iex.bat", "bin/iex.bat"},
+ {copy, "../bin/mix", "bin/mix"},
+ {copy, "../bin/mix.bat", "bin/mix.bat"}
+ ]}
+].
2  src/elixir.app.src
View
@@ -1,6 +1,6 @@
{application, elixir,
[{description, "elixir"},
- {vsn, "0.8.0.dev"},
+ {vsn, {cmd, "echo `cat ../../VERSION`"}},
{modules, [
elixir
]},
Yurii Rashkovskii

shouldn't this change also modify the tag in package.exs?

Devin Torres

How do you mean?

Yurii Rashkovskii
Devin Torres

Indeed, but isn't that something else? For instance, a 0.8.0.dev tag doesn't exist

Yurii Rashkovskii
Please sign in to comment.
Something went wrong with that request. Please try again.