Current section

113 Versions

Jump to

Compare versions

15 files changed
+146 additions
-95 deletions
  @@ -3,6 +3,9 @@ all: compile
3 3 compile:
4 4 @rebar3 compile
5 5
6 + lint:
7 + @rebar3 lint
8 +
6 9 test-env:
7 10 @./scripts/setup-test-env.sh
8 11
  @@ -21,7 +24,7 @@ clean:
21 24
22 25 hex-publish: clean
23 26 @rebar3 hex publish
24 - @rebar3 hex docs
27 + @rebar3 hex build
25 28
26 29 ## tests that require kafka running at localhost
27 30 INTEGRATION_CTS = brod_cg_commits brod_client brod_compression brod_consumer brod_producer brod_group_subscriber brod_topic_subscriber brod
  @@ -399,7 +399,7 @@ auth(Host :: string(), Sock :: gen_tcp:socket() | ssl:sslsocket(),
399 399 ```
400 400
401 401 If authentication is successful - callback function should return an atom `ok`, otherwise - error tuple with reason description.
402 - For example, you can use `brod_gssapi` plugin (https://github.com/ElMaxo/brod_gssapi) for SASL GSSAPI authentication.
402 + For example, you can use `brod_gssapi` plugin (https://github.com/kafka4beam/brod_gssapi) for SASL GSSAPI authentication.
403 403 To use it - add it as dependency to your top level project that uses brod.
404 404 Then add `{sasl, {callback, brod_gssapi, {gssapi, Keytab, Principal}}}` to client config.
405 405 Keytab should be the keytab file path, and Principal should be a byte-list or binary string.
  @@ -31,4 +31,4 @@
31 31 [{<<"app">>,<<"supervisor3">>},
32 32 {<<"optional">>,false},
33 33 {<<"requirement">>,<<"1.1.11">>}]}]}.
34 - {<<"version">>,<<"3.16.2">>}.
34 + {<<"version">>,<<"3.16.3">>}.
  @@ -2,19 +2,61 @@
2 2 , {kafka_protocol, "4.0.3"}
3 3 , {snappyer, "1.2.8"}
4 4 ]}.
5 + {project_plugins, [{rebar3_lint, "~> 1.0.2"}]}.
5 6 {edoc_opts, [{preprocess, true}, {macros, [{build_brod_cli, true}]}]}.
6 - {erl_opts, [warn_unused_vars,warn_shadow_vars,warn_obsolete_guard,debug_info]}.
7 + {erl_opts, [warnings_as_errors, warn_unused_vars,warn_shadow_vars,warn_obsolete_guard,debug_info]}.
7 8 {xref_checks, [undefined_function_calls, undefined_functions,
8 9 locals_not_used, deprecated_function_calls,
9 10 deprecated_functions]}.
10 -
11 + {profiles, [
12 + {brod_cli, [
13 + {deps, [ {docopt, {git, "https://github.com/zmstone/docopt-erl.git", {branch, "0.1.3"}}}
14 + , {jsone, "1.7.0"}
15 + ]},
16 + {erl_opts, [warnings_as_errors, {d, build_brod_cli}]},
17 + {escript_name, brod_cli},
18 + {relx, [{release, {brod, "i"}, % release the interactive shell as brod-i
19 + [brod, jsone, docopt]},
20 + {include_erts, true},
21 + {overlay, [{copy, "scripts/brod", "bin"},
22 + {copy, "{{lib_dirs}}/crc32cer/priv/crc32cer*.so", "bin"},
23 + {copy, "{{lib_dirs}}/snappyer/priv/snappyer.so", "bin"}
24 + ]}
25 + ]}]},
26 + {test, [
27 + {deps, [ {docopt, {git, "https://github.com/zmstone/docopt-erl.git", {branch, "0.1.3"}}}
28 + , {hut, "1.3.0"}
29 + , {jsone, "1.7.0"}
30 + , {meck, "0.9.2"}
31 + , {proper, "1.4.0"}
32 + , {snabbkaffe, "1.0.1"}
33 + ]},
34 + {erl_opts, [warnings_as_errors, {d, build_brod_cli}]}
35 + ]}
36 + ]}.
37 + {ex_doc,
38 + [ {extras,
39 + [ {"changelog.md", #{title => "Changelog"}}
40 + , {"README.md", #{title => "Overview"}}
41 + , {"LICENSE", #{title => "License"}}
42 + , "guides/examples/elixir/Publisher.md"
43 + , "guides/examples/elixir/Consumer.md"
44 + , "guides/examples/Authentication.md"
45 + ]}
46 + , {groups_for_extras, [{"Elixir", [ <<"guides/examples/elixir/Publisher.md">>
47 + , <<"guides/examples/elixir/Consumer.md">>
48 + ]}
49 + ,{"Usage", [<<"guides/examples/Authentication.md">>]}]}
50 + , {main, "README.md"}
51 + , {homepage_url, "https://hexdocs.pm/brod"}
52 + , {source_url, "https://github.com/kafka4beam/brod"}
53 + , {api_reference, false}
54 + ]}.
55 + {hex, [{doc, ex_doc}]}.
11 56 {escript_incl_apps, [docopt, brod]}.
12 -
13 57 {ct_opts, [{enable_builtin_hooks, false}]}.
14 -
15 58 {dialyzer, [{warnings, [unknown]}]}.
16 59 {cover_enabled, true}.
17 60 {cover_opts, [verbose]}.
18 61 {cover_export_enabled, true}.
19 -
20 62 {plugins, [coveralls]}.
  @@ -1,61 +1,22 @@
1 - IsRebar3 = erlang:function_exported(rebar3, main, 1),
2 - DocoptUrl = "https://github.com/zmstone/docopt-erl.git",
3 - DocOptTag = "0.1.3",
4 - DocoptDep = {docopt, {git, DocoptUrl, {branch, DocOptTag}}},
5 - Snabbkaffe = {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe", {tag, "0.6.0"}}},
6 - Profiles =
7 - {profiles, [
8 - {brod_cli, [
9 - {deps, [jsone, DocoptDep]},
10 - {erl_opts, [{d, build_brod_cli}]},
11 - {escript_name, brod_cli},
12 - {relx, [{release, {brod, "i"}, % release the interactive shell as brod-i
13 - [brod, jsone, docopt]},
14 - {include_erts, true},
15 - {overlay, [{copy, "scripts/brod", "bin"},
16 - {copy, "{{lib_dirs}}/crc32cer/priv/crc32cer*.so", "bin"},
17 - {copy, "{{lib_dirs}}/snappyer/priv/snappyer.so", "bin"}
18 - ]}
19 - ]}]},
20 - {test, [
21 - {deps, [meck, proper, jsone, DocoptDep, Snabbkaffe]},
22 - {erl_opts, [{d, build_brod_cli}]}
23 - ]}
24 - ]},
25 - CONFIG1 = case IsRebar3 of
26 - true ->
27 - [Profiles | CONFIG];
28 - false ->
29 - URLs = [ {supervisor3, "https://github.com/kafka4beam/supervisor3.git"}
30 - , {kafka_protocol, "https://github.com/kafka4beam/kafka_protocol.git"}
31 - ],
32 - Rebar3Deps = proplists:get_value(deps, CONFIG),
33 - Rebar2Deps =
34 - lists:map(
35 - fun({Name, URL}) ->
36 - case proplists:get_value(Name, Rebar3Deps) of
37 - {git, _, _} = Git -> {Name, ".*", Git};
38 - Vsn -> {Name, ".*", {git, URL, {tag, Vsn}}}
39 - end
40 - end, URLs),
41 - lists:keyreplace(deps, 1, CONFIG, {deps, Rebar2Deps})
42 - end,
43 -
44 - case {os:getenv("GITHUB_ACTIONS"), os:getenv("GITHUB_TOKEN")} of
1 + Plugins =
2 + case erlang:list_to_integer(erlang:system_info(otp_release)) of
3 + Version when Version > 23 ->
4 + ExtraPlugins = [{rebar3_ex_doc, "~> 0.2.9"},{rebar3_hex, "~> 7.0.1"}],
5 + {project_plugins, lists:merge(ExtraPlugins, proplists:get_value(project_plugins, CONFIG))};
6 + _ -> {project_plugins, proplists:get_value(project_plugins, CONFIG)}
7 + end,
8 + CoverallsConfigs = case {os:getenv("GITHUB_ACTIONS"), os:getenv("GITHUB_TOKEN")} of
45 9 {"true", Token} when is_list(Token) ->
46 - CONFIG2 = [{coveralls_repo_token, Token},
10 + Configs = [{coveralls_repo_token, Token},
47 11 {coveralls_coverdata, "_build/test/cover/*.coverdata"},
48 12 {coveralls_service_job_id, os:getenv("GITHUB_RUN_ID")},
49 13 {coveralls_commit_sha, os:getenv("GITHUB_SHA")},
50 14 {coveralls_service_name, "github"},
51 - {coveralls_service_number, os:getenv("GITHUB_RUN_NUMBER")} | CONFIG1],
52 - case os:getenv("GITHUB_EVENT_NAME") =:= "pull_request"
53 - andalso string:tokens(os:getenv("GITHUB_REF"), "/") of
54 - [_, "pull", PRNO, _] ->
55 - [{coveralls_service_pull_request, PRNO} | CONFIG2];
56 - _ ->
57 - CONFIG2
15 + {coveralls_service_number, os:getenv("GITHUB_RUN_NUMBER")}],
16 + case os:getenv("GITHUB_EVENT_NAME") =:= "pull_request" andalso string:tokens(os:getenv("GITHUB_REF"), "/") of
17 + [_, "pull", PRNO, _] -> [{coveralls_service_pull_request, PRNO} | Configs];
18 + _ -> Configs
58 19 end;
59 - _ ->
60 - CONFIG1
61 - end.
20 + _ -> []
21 + end,
22 + [Plugins | lists:merge(CoverallsConfigs, CONFIG)].
\ No newline at end of file
Loading more files…