summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Sloughter <tristan.sloughter@gmail.com>2015-07-18 18:09:10 -0500
committerTristan Sloughter <tristan.sloughter@gmail.com>2015-07-18 18:09:10 -0500
commit45a47ee0363e0bc807967076ff274fdbaabe9942 (patch)
treea918c7883e6ec081c6440d9bd4484213ac897752
parent3551c64bdfb0b11071c6b0993c9fe421cb9dcea9 (diff)
parent342e217ac006a2670588e520e9804473bf2b83c5 (diff)
Merge pull request #623 from ferd/update-config-sample
Making the file up to date
-rw-r--r--rebar.config.sample201
1 files changed, 144 insertions, 57 deletions
diff --git a/rebar.config.sample b/rebar.config.sample
index 1bd5e0c..8621b44 100644
--- a/rebar.config.sample
+++ b/rebar.config.sample
@@ -3,6 +3,13 @@
%% This is a sample rebar.conf file that shows examples of some of rebar's
%% options.
+%% == Artifacts ==
+
+%% Artifacts are files generated by other tools (or plugins) and whose
+%% presence is necessary for a build to be considered successful
+{artifacts, ["priv/mycode.so"]}.
+
+
%% == Erlang Compiler ==
%% Erlang files to compile before the rest. Rebar automatically compiles
@@ -13,12 +20,6 @@
%% Erlang compiler options
{erl_opts, [no_debug_info,
{i, "myinclude"},
- %% directories containing source files
- {src_dirs, ["src", "src2", "src3"]},
- %% extra_src_dirs are directories containing
- %% source files that are NOT part of the
- %% application itself
- {extra_src_dirs, ["eunit", "ct"]},
{platform_define,
"(linux|solaris|freebsd|darwin)", 'HAVE_SENDFILE'},
{platform_define, "(linux|freebsd)", 'BACKLOG', 128},
@@ -26,60 +27,29 @@
%% MIB Options?
{mib_opts, []}.
-
%% SNMP mibs to compile first?
{mib_first_files, []}.
%% leex options
{xrl_opts, []}.
-
%% leex files to compile first
{xrl_first_files, []}.
%% yecc options
{yrl_opts, []}.
-
%% yecc files to compile first
{yrl_first_files, []}.
-%% == EDoc ==
-
-%% EDoc options
-{edoc_opts, []}.
-
-%% == escriptize ==
-{escript_name, "application"}.
-{escript_incl_apps, []}.
-{escript_shebang, "#!/usr/bin/env escript\n"}.
-{escript_comment, "%%\n"}.
-{escript_emu_args, "%%! -pa application/application/ebin\n"}.
-
-%% == ErlyDTL Compiler ==
-
-%% Options for the ErlyDTL compiler
-{erlydtl_opts, []}.
-
-%% == EUnit ==
-
-%% Options for eunit:test()
-{eunit_opts, []}.
-
-%% Additional compile options for eunit. erl_opts is also used
-{eunit_compile_opts, []}.
-
-%% Files to compile first when compiling eunit test suites
-{eunit_first_files, []}.
%% == Common Test ==
-%% Options to pass to ct:run_test/1
-{ct_opts, [{logdir, "logs"}, {dir, "test"}]}.
-
-%% Additional compile options for ct. erl_opts is also used
+%% {erl_opts, [...]}, but for CT runs
{ct_compile_opts, []}.
-
-%% Files to compile first when compiling ct test suites
+%% {erl_first_files, ...} but for CT runs
{ct_first_files, []}.
+%% Same options as for ct:run_test(...)
+{ct_opts, []}.
+
%% == Cover ==
@@ -90,6 +60,7 @@
%% Options to pass to cover provider
{cover_opts, [verbose]}.
+
%% == Dependencies ==
%% What dependencies we have, dependencies can be of 3 forms, an application
@@ -97,21 +68,112 @@
%% an application name, a version and the SCM details on how to fetch it (SCM
%% type, location and revision).
%% Rebar3 currently supports git and hg
-{deps, [app_name,
- {rebar, "1.0.*"},
- {rebar, ".*",
- {git, "git://github.com/rebar/rebar.git"}},
- {rebar, ".*",
- {git, "git://github.com/rebar/rebar.git", "Rev"}},
- {rebar, "1.0.*",
- {git, "git://github.com/rebar/rebar.git", {branch, "master"}}},
- {rebar, "1.0.0",
- {git, "git://github.com/rebar/rebar.git", {tag, "1.0.0"}}},
- {rebar, ".*",
- {git, "git://github.com/rebar/rebar.git", {ref, "7f73b8d3650b41ffd53a199f3eda20985eda84e3"}}},
- {app_name, ".*", {hg, "https://www.example.org/url"}}]}.
-
-%% == Pre/Post Command Hooks ==
+{deps, [
+ app_name, % latest version of package
+ {rebar, "1.0.0"}, % version 1.0.0 of a package
+ {rebar, % git, master branch of app, explicit
+ {git, "git://github.com/rebar/rebar.git", {branch, "master"}}},
+ {rebar, % git, over HTTPS
+ {git, "https://github.com/rebar/rebar.git", {branch, "master"}}},
+ {rebar, % git, tag
+ {git, "https://github.com/rebar/rebar.git", {tag, "1.0.0"}}},
+ {rebar, % git, specific reference/hash
+ {git, "https://github.com/rebar/rebar.git", {ref, "7f73b8d6"}}},
+ {rebar, % mercurial is also supported
+ {hg, "https://github.com/rebar/rebar.git", {tag, "1.0.0"}}},
+ %% Alternative formats, backwards compatible declarations
+ {rebar, % implicit master, will warn recommending explicit branch
+ {git, "git://github.com/rebar/rebar.git"}},
+ {rebar, "1.0.*", % regex version check, ignored
+ {git, "git://github.com/rebar/rebar.git"}},
+ {rebar, "1.0.*", % literal branch/ref/tag, will warn for explicit reference
+ {git, "git://github.com/rebar/rebar.git", "Rev"}},
+ {rebar, ".*", % 'raw' dependency, argument ignored
+ {git, "git://github.com/rebar/rebar.git", {branch, "master"}},
+ [raw]}
+]}.
+
+
+%% == Dialyzer ==
+
+{dialyzer, [
+ {warnings, [underspecs, no_return]},
+ {get_warnings, true},
+ {plt_extra_apps, []},
+ {plt_location, local}, % local | "/my/file/name"
+ {plt_prefix, "rebar3"},
+ {base_plt_apps, [stdlib, kernel, crypto]},
+ {base_plt_location, global}, % global | "/my/file/name"
+ {base_plt_prefix, "rebar3"}
+]}.
+
+
+%% == Directories ==
+
+%% directory for artifacts produced by rebar3
+{base_dir, "_build"}.
+%% directory in '<base_dir>/<profile>/' where deps go
+{deps_dir, "lib"}.
+%% where rebar3 operates from; defaults to the current working directory
+{root_dir, "."}.
+%% where checkout dependencies are to be located
+{checkouts_dir, "_checkouts"}.
+%% directory in '<base_dir>/<profile>/' where plugins go
+{plugins_dir, "plugins"}.
+%% directories where OTP applications for the project can be located
+{project_app_dirs, ["apps/*", "lib/*", "."]}.
+%% Directories where source files for an OTP application can be found
+{src_dirs, ["src"]}.
+%% Paths to miscellaneous Erlang files to compile for an app
+%% without including them in its modules list
+{extra_src_dirs, []}.
+
+
+%% == EDoc ==
+
+%% EDoc options, same as those passed to the edoc compiler
+%% when called by hand.
+{edoc_opts, []}.
+
+
+%% == Escript ==
+
+%% name of the main OTP application to boot
+{escript_main_app, application}
+%% Name of the resulting escript executable
+{escript_name, "application"}.
+%% apps (other than main and deps) to be included
+{escript_incl_apps, []}.
+%% Executable escript lines
+{escript_shebang, "#!/usr/bin/env escript\n"}.
+{escript_comment, "%%\n"}.
+{escript_emu_args, "%%! -escript main ~s -pa ~s/~s/ebin\n"}.
+
+
+%% == EUnit ==
+
+%% Options for eunit:test(Tests, ...)
+{eunit_opts, []}.
+%% Additional compile options for eunit. erl_opts is also used
+{eunit_compile_opts, []}.
+%% {erl_first_files, ...} but for Eunit
+{eunit_first_files, []}.
+
+
+%% == Overrides ==
+
+{overrides, [
+ %% Add options to mydep's configurations for each element
+ {add, mydep, [{erl_opts, []}]},
+ %% replace mydep's configuration option
+ {override, mydep, [{erl_opts, []}]},
+ %% replace all dependencies' configuration options
+ {override, [{erl_opts, []}]}
+]}.
+
+%% == Pre/Post Shell Hooks ==
+
+%% Running shell commands before or after a given rebar3 command
{pre_hooks, [{clean, "./prepare_package_files.sh"},
{"linux", compile, "c_src/build_linux.sh"},
@@ -123,6 +185,31 @@
{eunit, "touch file2.out"},
{compile, "touch postcompile.out"}]}.
+%% == Provider Hooks ==
+
+%% Run a rebar3 command before or after another one.
+%% Only clean, ct, compile, eunit, release, and tar can be hooked around
+
+%% runs 'clean' before 'compile'
+{provider_hooks, [{pre, [{compile, clean}]}]}
+
+
+%% == Releases ==
+
+{relx, [{release, {my_release, "0.0.1"},
+ [myapp]},
+
+ {dev_mode, true},
+ {include_erts, false},
+
+ {extended_start_script, true}]}.
+
+%% == Shell ==
+
+%% apps to auto-boot with `rebar3 shell'; defaults to apps
+%% specified in a `relx' tuple, if any.
+{shell_apps, [app1, app2]}
+
%% == xref ==
{xref_warnings, false}.