Merge pull request #82 from tsloughter/rebar3

move to rebar3 and bump version
This commit is contained in:
Jordan Wilberding 2015-06-22 15:32:34 -07:00
commit cbe494b1cb
7 changed files with 18 additions and 174 deletions

View file

@ -7,12 +7,7 @@ otp_release:
- R16B01 - R16B01
- R16B - R16B
- R15B02 - R15B02
- R15B01 script: "./rebar3 compile && ./rebar3 ct"
- R15B
- R14B04
- R14B03
- R14B02
script: "make rebuild"
branches: branches:
only: only:
- master - master

119
Makefile
View file

@ -1,119 +0,0 @@
# Copyright 2012 Erlware, LLC. All Rights Reserved.
#
# BSD License see COPYING
ERL = $(shell which erl)
ERL_VER = $(shell erl -eval 'io:format("~s", [erlang:system_info(otp_release)]), halt().' -noshell)
ERLWARE_COMMONS_PLT=$(CURDIR)/.erlware_commons_plt
ERLFLAGS= -pa $(CURDIR)/.eunit -pa $(CURDIR)/ebin -pa $(CURDIR)/*/ebin
# =============================================================================
# Verify that the programs we need to run are installed on this system
# =============================================================================
REBAR ?= $(shell which rebar)
ifeq ($(REBAR),)
$(error "Rebar not available on this system")
endif
# =============================================================================
# Handle version discovery
# =============================================================================
# We have a problem that we only have 10 minutes to build on travis
# and those travis boxes are quite small. This is ok for the fast
# dialyzer on R15 and above. However on R14 and below we have the
# problem that travis times out. The code below lets us not run
# dialyzer on R14
OTP_VSN=$(shell erl -noshell -eval '{match, [Major]} = re:run(erlang:system_info(otp_release), "^R?([0-9]+).*", [{capture, all_but_first, list}]), io:format("~p", [Major]), erlang:halt(0).')
TRAVIS_SLOW=$(shell expr $(OTP_VSN) \<= 15 )
ifeq ($(TRAVIS_SLOW), 0)
DIALYZER=$(shell which dialyzer)
else
DIALYZER=: not running dialyzer on R14 or R15
endif
# =============================================================================
# Rules to build the system
# =============================================================================
.PHONY: all compile doc clean test shell distclean pdf get-deps rebuild dialyzer typer
all: compile doc test
rebuild: distclean deps compile dialyzer test
deps: .DEV_MODE
$(REBAR) get-deps compile
.DEV_MODE:
touch $@
cp priv/ec_semver_parser.peg src
get-deps:
$(REBAR) get-deps compile
compile: deps
$(REBAR) skip_deps=true compile
doc: compile
- $(REBAR) skip_deps=true doc
test: compile
$(REBAR) skip_deps=true eunit
$(ERLWARE_COMMONS_PLT).$(ERL_VER).erts:
@echo Building local plt at $(ERLWARE_COMMONS_PLT).$(ERL_VER).base
@echo
- $(DIALYZER) --fullpath --verbose --output_plt $(ERLWARE_COMMONS_PLT).$(ERL_VER).erts --build_plt \
--apps erts
$(ERLWARE_COMMONS_PLT).$(ERL_VER).kernel:$(ERLWARE_COMMONS_PLT).$(ERL_VER).erts
@echo Building local plt at $(ERLWARE_COMMONS_PLT).$(ERL_VER).base
@echo
- $(DIALYZER) --fullpath --verbose --output_plt $(ERLWARE_COMMONS_PLT).$(ERL_VER).kernel --build_plt \
--apps kernel
$(ERLWARE_COMMONS_PLT).$(ERL_VER).base:$(ERLWARE_COMMONS_PLT).$(ERL_VER).kernel
@echo Building local plt at $(ERLWARE_COMMONS_PLT).$(ERL_VER).base
@echo
- $(DIALYZER) --fullpath --verbose --output_plt $(ERLWARE_COMMONS_PLT).$(ERL_VER).base --build_plt \
--apps stdlib
$(ERLWARE_COMMONS_PLT).$(ERL_VER): $(ERLWARE_COMMONS_PLT).$(ERL_VER).base
@echo Building local plt at $(ERLWARE_COMMONS_PLT).$(ERL_VER)
@echo
- $(DIALYZER) --fullpath --verbose --output_plt $(ERLWARE_COMMONS_PLT).$(ERL_VER) --add_to_plt --plt $(ERLWARE_COMMONS_PLT).$(ERL_VER).base \
--apps eunit -r deps
dialyzer: compile $(ERLWARE_COMMONS_PLT).$(ERL_VER)
$(DIALYZER) --fullpath --plt $(ERLWARE_COMMONS_PLT).$(ERL_VER) -Wrace_conditions -r ./ebin
typer: $(ERLWARE_COMMONS_PLT).$(ERL_VER)
typer --plt $(ERLWARE_COMMONS_PLT).$(ERL_VER) -r ./src
shell: compile
# You often want *rebuilt* rebar tests to be available to the
# shell you have to call eunit (to get the tests
# rebuilt). However, eunit runs the tests, which probably
# fails (thats probably why You want them in the shell). This
# runs eunit but tells make to ignore the result.
- @$(REBAR) skip_deps=true eunit
@$(ERL) $(ERLFLAGS)
clean:
$(REBAR) skip_deps=true clean
- rm $(CURDIR)/doc/*.html
- rm $(CURDIR)/doc/*.css
- rm $(CURDIR)/doc/*.png
- rm $(CURDIR)/doc/edoc-info
distclean: clean
rm -rf $(ERLWARE_COMMONS_PLT).$(ERL_VER)
rm -rvf $(CURDIR)/deps
rm -rvf .DEV_MODE

View file

@ -1,15 +1,14 @@
%% -*- mode: Erlang; fill-column: 80; comment-column: 75; -*- %% -*- mode: Erlang; fill-column: 80; comment-column: 75; -*-
%% Dependencies ================================================================ %% Dependencies ================================================================
{deps, [{rebar_vsn_plugin, ".*", {deps, []}.
{git, "https://github.com/erlware/rebar_vsn_plugin.git",
{branch, "master"}}}]}.
{erl_first_files, ["ec_dictionary", "ec_vsn"]}. {erl_first_files, ["ec_dictionary", "ec_vsn"]}.
%% Compiler Options ============================================================ %% Compiler Options ============================================================
{erl_opts, {erl_opts,
[{platform_define, "^[0-9]+", namespaced_types}, [{platform_define, "^[0-9]+", namespaced_types},
{platform_define, "^[0-9]+", have_callback_support},
{platform_define, "^R1[4|5]", deprecated_crypto}, {platform_define, "^R1[4|5]", deprecated_crypto},
debug_info, debug_info,
warnings_as_errors]}. warnings_as_errors]}.
@ -21,5 +20,9 @@
{cover_enabled, true}. {cover_enabled, true}.
{cover_print_enabled, true}. {cover_print_enabled, true}.
%% Rebar Plugins ============================================================== %% Profiles ====================================================================
{plugins, [rebar_vsn_plugin]}. {profiles, [{dev, [{deps, [{neotoma, "",
{git, "https://github.com/seancribbs/neotoma.git", {branch, master}}},
{proper, "",
{git, "https://github.com/bkearns/proper.git", {branch, master}}}]}]}
]}.

View file

@ -1,42 +0,0 @@
%% Merge the list values in `ToAdd' into the list found at key `Key'
%% in proplist `C'. Don't duplicate items. New Items are added to the
%% front of existing items. It is an error if the value at `Key' is
%% not a list in `C'.
MergeConfig = fun({Key, ToAdd}, C) ->
case lists:keyfind(Key, 1, C) of
false ->
lists:keystore(Key, 1, C, {Key, ToAdd});
{Key, List} when is_list(List) ->
%% remove items in ToAdd already in List
ToAdd1 = [ I || I <- ToAdd, not lists:member(I, List) ],
lists:keystore(Key, 1, C, {Key, ToAdd1 ++ List })
end
end.
{match, [ErtsNumber]} = re:run(erlang:system_info(otp_release), "(\\d+)", [{capture, [0], list}]),
ErtsVsn = erlang:list_to_integer(ErtsNumber),
AddErlOpts = if
ErtsVsn >= 15 ->
[{d, have_callback_support}];
true ->
[]
end,
DevOnlyDeps = [{neotoma, "",
{git, "https://github.com/seancribbs/neotoma.git", {branch, master}}},
{proper, "",
{git, "https://github.com/bkearns/proper.git", {branch, master}}}],
Config1 = MergeConfig({erl_opts, AddErlOpts}, CONFIG),
ConfigPath = filename:dirname(SCRIPT),
DevMarker = filename:join([ConfigPath, ".DEV_MODE"]),
case filelib:is_file(DevMarker) of
true ->
lists:foldl(MergeConfig, Config1,
[{deps, DevOnlyDeps},
{erl_opts, [{d, 'DEV_ONLY'}]}]);
false ->
Config1
end.

1
rebar.lock Normal file
View file

@ -0,0 +1 @@
[].

BIN
rebar3 Executable file

Binary file not shown.

View file

@ -1,7 +1,13 @@
%% -*- mode: Erlang; fill-column: 75; comment-column: 50; -*- %% -*- mode: Erlang; fill-column: 75; comment-column: 50; -*-
{application, erlware_commons, {application, erlware_commons,
[{description, "Additional standard library for Erlang"}, [{description, "Additional standard library for Erlang"},
{vsn, "semver"}, {vsn, "0.13.0"},
{modules, []}, {modules, []},
{registered, []}, {registered, []},
{applications, [kernel, stdlib]}]}. {applications, [kernel, stdlib]},
{contributors,["Eric Merritt", "Tristan Sloughter",
"Jordan Wilberding", "Martin Logan"]},
{licenses, ["Apache"]},
{links, [{"Github","https://github.com/erlware/erlware_commons"}]}
]}.