Skip to content

Commit da4654d

Browse files
author
José Valim
committed
Merge pull request #793 from devinus/consolidated-version
Consolidate Elixir's version into a VERSION file
2 parents 1c9b540 + 6f43989 commit da4654d

File tree

8 files changed

+103
-99
lines changed

8 files changed

+103
-99
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ REBAR := $(shell echo `pwd`/rebar)
22
ELIXIRC := bin/elixirc --ignore-module-conflict $(ELIXIRC_OPTS)
33
ERLC := erlc -I lib/elixir/include
44
ERL := erl -I lib/elixir/include -noshell -pa lib/elixir/ebin
5-
VERSION := 0.8.0.dev
5+
VERSION := $(strip $(shell cat VERSION))
66
INSTALL_PATH := /usr/local
77

88
.PHONY: install compile erlang elixir dialyze test clean docs release_docs release_zip release_erl

RELEASE.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,5 @@ This document simply outlines the release process:
2222

2323
## Places where version is mentioned
2424

25-
* src/elixir.app.src
26-
* lib/elixir/src/elixir.app.src
27-
* lib/elixir/lib/system.ex
28-
* rel/reltool.config
29-
* Makefile
30-
* CHANGELOG
31-
* package.exs
25+
* VERSION
26+
* CHANGELOG

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.8.0.dev

lib/elixir/lib/system.ex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ defmodule System do
1414
with the VM or the host system.
1515
"""
1616

17+
# Read and strip the version from the `VERSION` file.
18+
defmacrop get_version do
19+
Regex.replace %r/^\s+|\s+$/, File.read!("VERSION"), ""
20+
end
21+
1722
# Tries to run `git describe --always --tags`. In case of success
1823
# returns the most recent tag, otherwise returns an empty string.
1924
defmacrop get_describe do
@@ -35,7 +40,7 @@ defmodule System do
3540
Returns Elixir's version as binary.
3641
"""
3742
@spec version() :: String.t
38-
def version, do: "0.8.0.dev"
43+
def version, do: get_version
3944
4045
@doc """
4146
Returns a keywords list with version, git tag info and date.

package.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Expm.Package.new(
22
name: "elixir",
33
description: "Elixir is a functional meta-programming aware language built on top of the Erlang VM",
4-
version: "0.8.0.dev",
4+
version: String.strip(File.read!("VERSION")),
55
keywords: [],
66
homepage: "http://elixir-lang.org/",
77
maintainers: [[name: "José Valim", email: "[email protected]"]],

rel/reltool.config

Lines changed: 0 additions & 88 deletions
This file was deleted.

rel/reltool.config.script

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
{ok, VsnData} = file:read_file("../VERSION"),
2+
Vsn = re:replace(VsnData, "^\\s+|\\s+$", "", [global, {return, list}]),
3+
4+
[
5+
{sys, [
6+
{lib_dirs, []},
7+
{erts, [{mod_cond, derived}, {app_file, strip}]},
8+
{app_file, strip},
9+
{rel, "elixir", Vsn, [
10+
kernel,
11+
stdlib,
12+
elixir
13+
]},
14+
{rel, "start_clean", "1", [
15+
kernel,
16+
stdlib
17+
]},
18+
{boot_rel, "elixir"},
19+
{profile, development},
20+
{excl_archive_filters, [".*"]}, %% Do not archive built libs
21+
{excl_app_filters, ["\.gitignore"]},
22+
23+
{app, elixir, [{lib_dir, "../lib/elixir"}]},
24+
{app, eex, [{lib_dir, "../lib/eex"},{incl_cond, include}]},
25+
{app, ex_unit, [{lib_dir, "../lib/ex_unit"},{incl_cond, include}]},
26+
{app, iex, [{lib_dir, "../lib/iex"},{incl_cond, include}]},
27+
{app, mix, [{lib_dir, "../lib/mix"},{incl_cond, include}]},
28+
29+
{app, appmon, [{incl_cond, include}]},
30+
{app, asn1, [{incl_cond, include}]},
31+
{app, common_test, [{incl_cond, include}]},
32+
{app, compiler, [{incl_cond, include}]},
33+
34+
{app, cosEvent, [{incl_cond, include}]},
35+
{app, cosEventDomain, [{incl_cond, include}]},
36+
{app, cosFileTransfer, [{incl_cond, include}]},
37+
{app, cosNotification, [{incl_cond, include}]},
38+
{app, cosProperty, [{incl_cond, include}]},
39+
{app, cosTime, [{incl_cond, include}]},
40+
{app, cosTransactions, [{incl_cond, include}]},
41+
42+
{app, crypto, [{incl_cond, include}]},
43+
{app, debugger, [{incl_cond, include}]},
44+
{app, dialyzer, [{incl_cond, include}]},
45+
{app, diameter, [{incl_cond, include}]},
46+
{app, et, [{incl_cond, include}]},
47+
{app, gs, [{incl_cond, include}]},
48+
{app, hipe, [{incl_cond, include}]},
49+
{app, ic, [{incl_cond, include}]},
50+
{app, inets, [{incl_cond, include}]},
51+
{app, megaco, [{incl_cond, include}]},
52+
{app, mnesia, [{incl_cond, include}]},
53+
{app, observer, [{incl_cond, include}]},
54+
{app, odbc, [{incl_cond, include}]},
55+
{app, orber, [{incl_cond, include}]},
56+
{app, os_mon, [{incl_cond, include}]},
57+
{app, otp_mibs, [{incl_cond, include}]},
58+
{app, parsetools, [{incl_cond, include}]},
59+
{app, percept, [{incl_cond, include}]},
60+
{app, pman, [{incl_cond, include}]},
61+
{app, public_key, [{incl_cond, include}]},
62+
{app, reltool, [{incl_cond, include}]},
63+
{app, runtime_tools, [{incl_cond, include}]},
64+
{app, sasl, [{incl_cond, include}]},
65+
{app, snmp, [{incl_cond, include}]},
66+
{app, ssh, [{incl_cond, include}]},
67+
{app, ssl, [{incl_cond, include}]},
68+
{app, syntax_tools, [{incl_cond, include}]},
69+
{app, test_server, [{incl_cond, include}]},
70+
{app, toolbar, [{incl_cond, include}]},
71+
{app, tools, [{incl_cond, include}]},
72+
{app, tv, [{incl_cond, include}]},
73+
{app, typer, [{incl_cond, include}]},
74+
{app, webtool, [{incl_cond, include}]},
75+
{app, xmerl, [{incl_cond, include}]}
76+
]},
77+
78+
{target_dir, "elixir"},
79+
80+
{overlay, [
81+
{copy, "files/sys.config", "releases/\{\{rel_vsn\}\}/sys.config"},
82+
{copy, "../bin/elixir", "bin/elixir"},
83+
{copy, "../bin/elixir.bat", "bin/elixir.bat"},
84+
{copy, "../bin/elixirc", "bin/elixirc"},
85+
{copy, "../bin/elixirc.bat", "bin/elixirc.bat"},
86+
{copy, "../bin/iex", "bin/iex"},
87+
{copy, "../bin/iex.bat", "bin/iex.bat"},
88+
{copy, "../bin/mix", "bin/mix"},
89+
{copy, "../bin/mix.bat", "bin/mix.bat"}
90+
]}
91+
].

src/elixir.app.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{application, elixir,
22
[{description, "elixir"},
3-
{vsn, "0.8.0.dev"},
3+
{vsn, {cmd, "echo `cat ../../VERSION`"}},
44
{modules, [
55
elixir
66
]},

0 commit comments

Comments
 (0)