Permalink
Browse files

Read version from VERSION file and convert Elixir to a raw rebar dep

  • Loading branch information...
1 parent ded1747 commit 921a3b4dfa2b464b6203fcc581952f1596c76c24 @devinus committed Jan 24, 2013
Showing with 109 additions and 118 deletions.
  1. +1 −6 Makefile
  2. +1 −6 RELEASE.md
  3. +1 −0 VERSION
  4. +6 −1 lib/elixir/lib/system.ex
  5. +1 −1 package.exs
  6. +8 −6 rebar.config
  7. +0 −88 rel/reltool.config
  8. +91 −0 rel/reltool.config.script
  9. +0 −10 src/elixir.app.src
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
@@ -34,10 +34,6 @@ default: compile
compile: lib/elixir/src/elixir.app.src erlang elixir
-lib/elixir/src/elixir.app.src: src/elixir.app.src
- @ rm -rf lib/elixir/src/elixir.app.src
- @ cp src/elixir.app.src lib/elixir/src/elixir.app.src
-
erlang:
@ cd lib/elixir && $(REBAR) compile
@@ -86,7 +82,6 @@ clean:
rm -rf lib/*/test/tmp
rm -rf lib/mix/test/fixtures/git_repo
rm -rf lib/*/tmp
- rm -rf lib/elixir/src/elixir.app.src
rm -rf lib/elixir/src/*_lexer.erl
rm -rf lib/elixir/src/*_parser.erl
rm -rf lib/elixir/test/ebin
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
+* VERSION
* CHANGELOG
-* package.exs
View
@@ -0,0 +1 @@
+0.8.0.dev
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.
View
@@ -1,7 +1,7 @@
Expm.Package.new(
name: "elixir",
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"]],
View
@@ -1,17 +1,19 @@
%% Using elixir as a rebar dependency
%% This configuration file only exists so Elixir can be used
-%% as a rebar dependency, the same happens for the file
-%% src/elixir.app.src.
-
+%% as a raw rebar dependency:
+%%
+%% {elixir, ".*",
+%% {git, "git://github.com/elixir-lang/elixir.git"},
+%% [raw]}.
+%%
+%%
%% In practice, Elixir is structured as OTP where many applications
%% are placed in the lib directory. Since this structure is not
%% supported by default by rebar, after adding Elixir as a dependency
%% you need to explicitly add it to lib_dirs:
%%
-%% {lib_dirs, [
-%% "deps/elixir/lib"
-%% ]}.
+%% {lib_dirs, ["deps/elixir/lib"]}.
%%
%% Run make as the proper compilation step
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"}
- ]}.
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"}
+ ]}
+].
View
@@ -1,10 +0,0 @@
-{application, elixir,
-[{description, "elixir"},
- {vsn, "0.8.0.dev"},
- {modules, [
- elixir
- ]},
- {registered,[elixir_code_server]},
- {applications, [kernel,stdlib]},
- {mod, {elixir,[]}}
-]}.

0 comments on commit 921a3b4

Please sign in to comment.