2011-01-31 16:43:31 +00:00
|
|
|
%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
|
2010-06-03 19:36:48 +00:00
|
|
|
%% ex: ts=4 sw=4 ft=erlang et
|
|
|
|
%% This is a sample rebar.conf file that shows examples of some of rebar's
|
|
|
|
%% options.
|
|
|
|
|
|
|
|
%% == Core ==
|
|
|
|
|
2012-11-05 19:08:48 +00:00
|
|
|
%% Extend list of always recursive commands
|
|
|
|
{recursive_cmds, []}.
|
|
|
|
|
2012-11-18 18:36:01 +00:00
|
|
|
%% Check required ERTS or OTP release version
|
|
|
|
{require_erts_vsn, ".*"}.
|
|
|
|
{require_otp_vsn, ".*"}.
|
|
|
|
{require_min_otp_vsn, ".*"}.
|
|
|
|
|
2010-06-03 19:36:48 +00:00
|
|
|
%% Additional library directories to add to the code path
|
|
|
|
{lib_dirs, []}.
|
|
|
|
|
|
|
|
%% == Erlang Compiler ==
|
|
|
|
|
|
|
|
%% Erlang files to compile before the rest. Rebar automatically compiles
|
|
|
|
%% parse_transforms and custom behaviours before anything other than the files
|
|
|
|
%% in this list.
|
2014-05-29 11:43:23 +00:00
|
|
|
{erl_first_files, ["src/mymib1.erl", "src/mymib2.erl"]}.
|
2010-06-03 19:36:48 +00:00
|
|
|
|
|
|
|
%% Erlang compiler options
|
2012-11-15 00:28:08 +00:00
|
|
|
{erl_opts, [no_debug_info,
|
|
|
|
{i, "myinclude"},
|
|
|
|
{src_dirs, ["src", "src2", "src3"]},
|
2010-06-12 11:38:59 +00:00
|
|
|
{platform_define,
|
2012-01-29 17:17:48 +00:00
|
|
|
"(linux|solaris|freebsd|darwin)", 'HAVE_SENDFILE'},
|
2011-01-09 15:06:51 +00:00
|
|
|
{platform_define, "(linux|freebsd)", 'BACKLOG', 128},
|
|
|
|
{platform_define, "R13", 'old_inets'}]}.
|
2010-06-03 19:36:48 +00:00
|
|
|
|
|
|
|
%% MIB Options?
|
|
|
|
{mib_opts, []}.
|
|
|
|
|
|
|
|
%% SNMP mibs to compile first?
|
|
|
|
{mib_first_files, []}.
|
|
|
|
|
2012-11-18 18:50:54 +00:00
|
|
|
%% leex options
|
|
|
|
{xrl_opts, []}.
|
|
|
|
|
|
|
|
%% leex files to compile first
|
|
|
|
{xrl_first_files, []}.
|
|
|
|
|
|
|
|
%% yecc options
|
|
|
|
{yrl_opts, []}.
|
|
|
|
|
|
|
|
%% yecc files to compile first
|
|
|
|
{yrl_first_files, []}.
|
|
|
|
|
2010-11-19 19:03:12 +00:00
|
|
|
%% == EDoc ==
|
|
|
|
|
|
|
|
%% EDoc options
|
|
|
|
{edoc_opts, []}.
|
|
|
|
|
2010-06-03 19:36:48 +00:00
|
|
|
%% == Port Compiler ==
|
|
|
|
|
|
|
|
%% Port compilation environment variables. See rebar_port_compiler.erl for
|
|
|
|
%% more info. Default is `[]'
|
2012-02-07 19:15:58 +00:00
|
|
|
{port_env, [{"CFLAGS", "$CFLAGS -Ifoo"},
|
|
|
|
{"freebsd", "LDFLAGS", "$LDFLAGS -lfoo"}]}.
|
2010-06-03 19:36:48 +00:00
|
|
|
|
2012-01-03 17:59:36 +00:00
|
|
|
%% port_specs
|
|
|
|
%% List of filenames or wildcards to be compiled. May also contain a tuple
|
|
|
|
%% consisting of a regular expression to be applied against the system
|
|
|
|
%% architecture as a filter.
|
|
|
|
{port_specs, [{"priv/so_name.so", ["c_src/*.c"]},
|
2012-02-07 19:15:58 +00:00
|
|
|
{"linux", "priv/hello_linux", ["c_src/hello_linux.c"]},
|
2012-11-14 22:19:10 +00:00
|
|
|
{"linux", "priv/hello_linux", ["c_src/*.c"], [{env, []}]}]}.
|
2011-04-30 13:09:46 +00:00
|
|
|
|
2012-11-19 22:42:07 +00:00
|
|
|
%% == escriptize ==
|
|
|
|
{escript_name, "application"}.
|
|
|
|
{escript_incl_apps, []}.
|
|
|
|
{escript_shebang, "#!/usr/bin/env escript\n"}.
|
|
|
|
{escript_comment, "%%\n"}.
|
2012-11-23 15:59:11 +00:00
|
|
|
{escript_emu_args, "%%! -pa application/application/ebin\n"}.
|
2012-11-19 22:42:07 +00:00
|
|
|
|
2010-06-03 19:36:48 +00:00
|
|
|
%% == LFE Compiler ==
|
|
|
|
|
|
|
|
%% LFE files to compile before the rest
|
|
|
|
{lfe_first_files, []}.
|
|
|
|
|
2011-04-11 12:08:39 +00:00
|
|
|
%% Options for the LFE compiler: reuse {erl_opts, []}
|
2010-06-03 19:36:48 +00:00
|
|
|
|
|
|
|
%% == ErlyDTL Compiler ==
|
|
|
|
|
|
|
|
%% Options for the ErlyDTL compiler
|
|
|
|
{erlydtl_opts, []}.
|
|
|
|
|
2013-12-17 11:59:15 +00:00
|
|
|
%% == Proto compiler ==
|
2015-01-30 15:37:21 +00:00
|
|
|
{proto_opts, [
|
|
|
|
{compiler, protobuffs},
|
|
|
|
{src_dirs, ["src"]}
|
|
|
|
]}.
|
2013-12-17 11:59:15 +00:00
|
|
|
%% Available compilers for protocol buffer files (*.proto):
|
|
|
|
%% protobuffs (default)
|
2013-12-17 14:36:58 +00:00
|
|
|
%% gpb
|
2015-01-30 15:37:21 +00:00
|
|
|
%% Optional src_dirs which is a list of directories where
|
|
|
|
%% to look for .proto files, default is src
|
2013-12-17 11:59:15 +00:00
|
|
|
|
2013-12-17 14:36:58 +00:00
|
|
|
%% Options for the gpb protocol buffer compiler,
|
|
|
|
%% if selected by the proto_compiler option
|
|
|
|
{gpb_opts, []}.
|
2013-12-17 11:59:15 +00:00
|
|
|
|
2010-06-03 19:36:48 +00:00
|
|
|
%% == EUnit ==
|
|
|
|
|
|
|
|
%% Options for eunit:test()
|
|
|
|
{eunit_opts, []}.
|
|
|
|
|
2012-08-09 11:58:32 +00:00
|
|
|
%% Additional compile options for eunit. erl_opts is also used
|
|
|
|
{eunit_compile_opts, []}.
|
|
|
|
|
|
|
|
%% Same as erl_first_files, but used only when running 'eunit'
|
|
|
|
{eunit_first_files, []}.
|
|
|
|
|
|
|
|
%% == Cover ==
|
|
|
|
|
2010-06-03 19:36:48 +00:00
|
|
|
%% Whether to enable coverage reporting. Default is `false'
|
|
|
|
{cover_enabled, false}.
|
2010-10-06 19:05:13 +00:00
|
|
|
|
|
|
|
%% Whether to print coverage report to console. Default is `false'
|
|
|
|
{cover_print_enabled, false}.
|
2010-06-03 19:36:48 +00:00
|
|
|
|
2012-06-12 20:36:09 +00:00
|
|
|
%% Whether to export coverage report to file. Default is `false'
|
|
|
|
{cover_export_enabled, false}.
|
|
|
|
|
2011-04-06 15:47:29 +00:00
|
|
|
%% == Common Test ==
|
|
|
|
|
2011-09-18 12:38:31 +00:00
|
|
|
%% Override the default "test" directory in which SUITEs are located
|
|
|
|
{ct_dir, "itest"}.
|
|
|
|
|
2012-07-28 21:43:56 +00:00
|
|
|
%% Override the default "logs" directory in which SUITEs are logged
|
|
|
|
{ct_log_dir, "test/logs"}.
|
|
|
|
|
2011-04-06 15:47:29 +00:00
|
|
|
%% Option to pass extra parameters when launching Common Test
|
|
|
|
{ct_extra_params, "-boot start_sasl -s myapp"}.
|
|
|
|
|
2012-05-22 14:50:26 +00:00
|
|
|
%% Option to use short names (i.e., -sname test) when starting ct
|
|
|
|
{ct_use_short_names, true}.
|
|
|
|
|
2011-03-26 16:56:54 +00:00
|
|
|
%% == QuickCheck ==
|
|
|
|
|
|
|
|
%% If qc_mod is unspecified, rebar tries to detect Triq or EQC
|
|
|
|
{qc_opts, [{qc_mod, module()}, Options]}.
|
|
|
|
|
2012-08-09 11:58:32 +00:00
|
|
|
%% Additional compile options for qc. erl_opts is also used
|
|
|
|
{qc_compile_opts, []}.
|
|
|
|
|
|
|
|
%% Same as erl_first_files, but used only when running 'qc'
|
|
|
|
{qc_first_files, []}.
|
|
|
|
|
2010-06-03 19:36:48 +00:00
|
|
|
%% == Cleanup ==
|
|
|
|
|
|
|
|
%% Which files to cleanup
|
|
|
|
{clean_files, ["file", "file2"]}.
|
|
|
|
|
|
|
|
%% == OTP Applications ==
|
|
|
|
|
2010-10-10 20:23:17 +00:00
|
|
|
%% Enable validation of the OTP app module list. Default is 'true'
|
|
|
|
{validate_app_modules, true}.
|
|
|
|
|
2011-03-12 15:28:40 +00:00
|
|
|
%% == Dependencies ==
|
2010-06-03 19:36:48 +00:00
|
|
|
|
2011-10-26 15:11:03 +00:00
|
|
|
%% Where to put any downloaded dependencies. Default is "deps"
|
|
|
|
{deps_dir, "deps"}.
|
2010-06-03 19:36:48 +00:00
|
|
|
|
2011-08-22 02:37:04 +00:00
|
|
|
%% What dependencies we have, dependencies can be of 3 forms, an application
|
2010-06-03 19:36:48 +00:00
|
|
|
%% name as an atom, eg. mochiweb, a name and a version (from the .app file), or
|
|
|
|
%% an application name, a version and the SCM details on how to fetch it (SCM
|
2012-09-20 05:02:24 +00:00
|
|
|
%% type, location and revision).
|
2013-09-17 15:22:05 +00:00
|
|
|
%% Rebar currently supports git, hg, bzr, svn, rsync, fossil, and p4.
|
2013-11-24 14:36:54 +00:00
|
|
|
{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.*",
|
2013-03-02 13:16:33 +00:00
|
|
|
{git, "git://github.com/rebar/rebar.git", {branch, "master"}}},
|
2013-11-24 14:36:54 +00:00
|
|
|
{rebar, "1.0.0",
|
|
|
|
{git, "git://github.com/rebar/rebar.git", {tag, "1.0.0"}}},
|
2012-11-14 22:19:42 +00:00
|
|
|
%% Dependencies can be marked as 'raw'. Rebar does not require
|
|
|
|
%% such dependencies to have a standard Erlang/OTP layout
|
|
|
|
%% which assumes the presence of either
|
|
|
|
%% "src/dependency_name.app.src" or "ebin/dependency_name.app"
|
|
|
|
%% files.
|
|
|
|
%%
|
|
|
|
%% 'raw' dependencies can still contain 'rebar.config' and
|
|
|
|
%% even can have the proper OTP directory layout, but they
|
|
|
|
%% won't be compiled.
|
|
|
|
%%
|
|
|
|
%% Only a subset of rebar commands will be executed on the
|
|
|
|
%% 'raw' subdirectories: get-deps, update-deps, check-deps,
|
|
|
|
%% list-deps and delete-deps.
|
2013-11-24 14:36:54 +00:00
|
|
|
{rebar, "",
|
2013-03-02 13:16:33 +00:00
|
|
|
{git, "git://github.com/rebar/rebar.git", {branch, "master"}},
|
2013-11-24 14:36:54 +00:00
|
|
|
[raw]},
|
|
|
|
{app_name, ".*", {hg, "https://www.example.org/url"}},
|
|
|
|
{app_name, ".*", {rsync, "Url"}},
|
|
|
|
{app_name, ".*", {svn, "https://www.example.org/url"}},
|
|
|
|
{app_name, ".*", {svn, "svn://svn.example.org/url"}},
|
|
|
|
{app_name, ".*", {bzr, "https://www.example.org/url", "Rev"}},
|
|
|
|
{app_name, ".*", {fossil, "https://www.example.org/url"}},
|
2013-09-17 15:22:05 +00:00
|
|
|
{app_name, ".*", {fossil, "https://www.example.org/url", "Vsn"}},
|
|
|
|
{app_name, ".*", {p4, "//depot/subdir/app_dir"}}]}.
|
2010-06-03 19:36:48 +00:00
|
|
|
|
|
|
|
%% == Subdirectories ==
|
|
|
|
|
|
|
|
%% Subdirectories?
|
|
|
|
{sub_dirs, ["dir1", "dir2"]}.
|
2011-01-26 01:50:33 +00:00
|
|
|
|
2011-05-02 23:15:19 +00:00
|
|
|
%% == Plugins ==
|
|
|
|
|
|
|
|
%% Plugins you wish to include.
|
|
|
|
%% These can include any module on the code path, including deps.
|
|
|
|
%% Alternatively, plugins can be placed as source files in the plugin_dir, in
|
|
|
|
%% which case they will be compiled and loaded dynamically at runtime.
|
|
|
|
{plugins, [plugin1, plugin2]}.
|
|
|
|
|
|
|
|
%% Override the directory in which plugin sources can be found.
|
|
|
|
%% Defaults to ./plugins
|
|
|
|
{plugin_dir, "some_other_directory"}.
|
|
|
|
|
|
|
|
|
2011-01-26 01:50:33 +00:00
|
|
|
%% == Pre/Post Command Hooks ==
|
|
|
|
|
|
|
|
{pre_hooks, [{clean, "./prepare_package_files.sh"},
|
2011-12-05 13:16:56 +00:00
|
|
|
{"linux", compile, "c_src/build_linux.sh"},
|
|
|
|
{compile, "escript generate_headers"},
|
|
|
|
{compile, "escript check_headers"}]}.
|
2011-01-26 01:50:33 +00:00
|
|
|
|
|
|
|
{post_hooks, [{clean, "touch file1.out"},
|
2011-12-05 13:16:56 +00:00
|
|
|
{"freebsd", compile, "c_src/freebsd_tweaks.sh"},
|
2011-01-26 01:50:33 +00:00
|
|
|
{eunit, "touch file2.out"},
|
|
|
|
{compile, "touch postcompile.out"}]}.
|
2011-04-06 17:04:52 +00:00
|
|
|
|
|
|
|
%% == xref ==
|
|
|
|
|
|
|
|
{xref_warnings, false}.
|
2012-04-02 15:01:39 +00:00
|
|
|
|
2013-12-06 09:45:52 +00:00
|
|
|
%% optional extra paths to include in xref:set_library_path/2.
|
|
|
|
%% specified relative location of rebar.config.
|
|
|
|
%% e.g. {xref_extra_paths,["../gtknode/src"]}
|
|
|
|
{xref_extra_paths,[]}.
|
|
|
|
|
2011-04-06 17:04:52 +00:00
|
|
|
%% xref checks to run
|
2013-06-18 09:30:32 +00:00
|
|
|
{xref_checks, [undefined_function_calls, undefined_functions,
|
|
|
|
locals_not_used, exports_not_used,
|
|
|
|
deprecated_function_calls, deprecated_functions]}.
|
2012-04-02 15:01:39 +00:00
|
|
|
|
|
|
|
%% Optional custom xref queries (xref manual has details) specified as
|
|
|
|
%% {xref_queries, [{query_string(), expected_query_result()},...]}
|
2012-11-10 20:59:19 +00:00
|
|
|
%% The following for example removes all references to mod:*foo/4
|
2012-04-02 15:01:39 +00:00
|
|
|
%% functions from undefined external function calls as those are in a
|
|
|
|
%% generated module
|
|
|
|
{xref_queries,
|
2012-04-15 21:48:02 +00:00
|
|
|
[{"(XC - UC) || (XU - X - B"
|
2012-11-10 20:59:19 +00:00
|
|
|
" - (\"mod\":\".*foo\"/\"4\"))",[]}]}.
|