forked from kafka4beam/kafka_protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
29 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Kafka protocol library for Erlang/Elixir | ||
Copyright 2014-2017 Klarna AB | ||
Copyright 2014-2018 Klarna AB | ||
|
||
This product includes software developed by | ||
Klarna AB (https://www.klarna.com) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,32 @@ | ||
{_, ErlOpts} = lists:keyfind(erl_opts, 1, CONFIG). | ||
Rel = try erlang:system_info(otp_release) of | ||
Vsn -> | ||
{match,[Maj]} = re:run(Vsn, "^R?([0-9]+)", [{capture,[1],list}]), | ||
list_to_integer(Maj) | ||
catch _:_ -> | ||
"OLD" | ||
end, | ||
Macros = if Rel < 19 -> | ||
[{d, 'OLD_TIME_UNITS'}]; | ||
true -> | ||
[] | ||
end, | ||
CONFIG1 = lists:keystore(erl_opts, 1, CONFIG, {erl_opts, Macros ++ ErlOpts}), | ||
|
||
IsRebar3 = erlang:function_exported(rebar3, main, 1), | ||
case IsRebar3 of | ||
true -> | ||
CONFIG; | ||
CONFIG1; | ||
false -> | ||
URLs = [ {snappyer, "https://github.com/zmstone/snappyer"} | ||
, {crc32cer, "https://github.com/zmstone/crc32cer"} | ||
], | ||
Rebar3Deps = proplists:get_value(deps, CONFIG), | ||
Rebar3Deps = proplists:get_value(deps, CONFIG1), | ||
Rebar2Deps = | ||
lists:map( | ||
fun({Name, URL}) -> | ||
Tag = proplists:get_value(Name, Rebar3Deps), | ||
{Name, ".*", {git, URL, {tag, Tag}}} | ||
end, URLs), | ||
lists:keyreplace(deps, 1, CONFIG, {deps, Rebar2Deps}) | ||
lists:keyreplace(deps, 1, CONFIG1, {deps, Rebar2Deps}) | ||
end. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters