diff --git a/.travis.yml b/.travis.yml index bf58212..fcb6c23 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,12 +7,7 @@ otp_release: - R16B01 - R16B - R15B02 - - R15B01 - - R15B - - R14B04 - - R14B03 - - R14B02 -script: "make rebuild" +script: "./rebar3 compile && ./rebar3 ct" branches: only: - master diff --git a/Makefile b/Makefile deleted file mode 100644 index de0f3e7..0000000 --- a/Makefile +++ /dev/null @@ -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 diff --git a/rebar.config b/rebar.config index 3cd89c7..48d5b07 100644 --- a/rebar.config +++ b/rebar.config @@ -1,15 +1,14 @@ %% -*- mode: Erlang; fill-column: 80; comment-column: 75; -*- %% Dependencies ================================================================ -{deps, [{rebar_vsn_plugin, ".*", - {git, "https://github.com/erlware/rebar_vsn_plugin.git", - {branch, "master"}}}]}. +{deps, []}. {erl_first_files, ["ec_dictionary", "ec_vsn"]}. %% Compiler Options ============================================================ {erl_opts, [{platform_define, "^[0-9]+", namespaced_types}, + {platform_define, "^[0-9]+", have_callback_support}, {platform_define, "^R1[4|5]", deprecated_crypto}, debug_info, warnings_as_errors]}. @@ -21,5 +20,9 @@ {cover_enabled, true}. {cover_print_enabled, true}. -%% Rebar Plugins ============================================================== -{plugins, [rebar_vsn_plugin]}. +%% Profiles ==================================================================== +{profiles, [{dev, [{deps, [{neotoma, "", + {git, "https://github.com/seancribbs/neotoma.git", {branch, master}}}, + {proper, "", + {git, "https://github.com/bkearns/proper.git", {branch, master}}}]}]} + ]}. diff --git a/rebar.config.script b/rebar.config.script deleted file mode 100644 index 6519616..0000000 --- a/rebar.config.script +++ /dev/null @@ -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. - diff --git a/rebar.lock b/rebar.lock new file mode 100644 index 0000000..57afcca --- /dev/null +++ b/rebar.lock @@ -0,0 +1 @@ +[]. diff --git a/rebar3 b/rebar3 new file mode 100755 index 0000000..c44f808 Binary files /dev/null and b/rebar3 differ diff --git a/src/erlware_commons.app.src b/src/erlware_commons.app.src index 042c56a..0ccc457 100644 --- a/src/erlware_commons.app.src +++ b/src/erlware_commons.app.src @@ -1,7 +1,13 @@ %% -*- mode: Erlang; fill-column: 75; comment-column: 50; -*- {application, erlware_commons, [{description, "Additional standard library for Erlang"}, - {vsn, "semver"}, + {vsn, "0.13.0"}, {modules, []}, {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"}]} + ]}.