You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

205 lines
6.1 KiB

14 years ago
  1. %% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
  2. %% ex: ts=4 sw=4 ft=erlang et
  3. %% This is a sample rebar.conf file that shows examples of some of rebar's
  4. %% options.
  5. %% == Core ==
  6. %% Additional library directories to add to the code path
  7. {lib_dirs, []}.
  8. %% == Erlang Compiler ==
  9. %% Erlang files to compile before the rest. Rebar automatically compiles
  10. %% parse_transforms and custom behaviours before anything other than the files
  11. %% in this list.
  12. {erl_first_files, ["mymib1", "mymib2"]}.
  13. %% Erlang compiler options
  14. {erl_opts, [no_debug_info,
  15. {i, "myinclude"},
  16. {src_dirs, ["src", "src2", "src3"]},
  17. {platform_define,
  18. "(linux|solaris|freebsd|darwin)", 'HAVE_SENDFILE'},
  19. {platform_define, "(linux|freebsd)", 'BACKLOG', 128},
  20. {platform_define, "R13", 'old_inets'}]}.
  21. %% MIB Options?
  22. {mib_opts, []}.
  23. %% SNMP mibs to compile first?
  24. {mib_first_files, []}.
  25. %% == EDoc ==
  26. %% EDoc options
  27. {edoc_opts, []}.
  28. %% == Port Compiler ==
  29. %% Port compilation environment variables. See rebar_port_compiler.erl for
  30. %% more info. Default is `[]'
  31. {port_env, [{"CFLAGS", "$CFLAGS -Ifoo"},
  32. {"freebsd", "LDFLAGS", "$LDFLAGS -lfoo"}]}.
  33. %% port_specs
  34. %% List of filenames or wildcards to be compiled. May also contain a tuple
  35. %% consisting of a regular expression to be applied against the system
  36. %% architecture as a filter.
  37. {port_specs, [{"priv/so_name.so", ["c_src/*.c"]},
  38. {"linux", "priv/hello_linux", ["c_src/hello_linux.c"]},
  39. {"linux", "priv/hello_linux", ["c_src/*.c"], [{env, []}]}]}.
  40. %% == LFE Compiler ==
  41. %% LFE files to compile before the rest
  42. {lfe_first_files, []}.
  43. %% Options for the LFE compiler: reuse {erl_opts, []}
  44. %% == ErlyDTL Compiler ==
  45. %% Options for the ErlyDTL compiler
  46. {erlydtl_opts, []}.
  47. %% == EUnit ==
  48. %% Options for eunit:test()
  49. {eunit_opts, []}.
  50. %% Additional compile options for eunit. erl_opts is also used
  51. {eunit_compile_opts, []}.
  52. %% Same as erl_first_files, but used only when running 'eunit'
  53. {eunit_first_files, []}.
  54. %% == Cover ==
  55. %% Whether to enable coverage reporting. Default is `false'
  56. {cover_enabled, false}.
  57. %% Whether to print coverage report to console. Default is `false'
  58. {cover_print_enabled, false}.
  59. %% Whether to export coverage report to file. Default is `false'
  60. {cover_export_enabled, false}.
  61. %% == Common Test ==
  62. %% Override the default "test" directory in which SUITEs are located
  63. {ct_dir, "itest"}.
  64. %% Override the default "logs" directory in which SUITEs are logged
  65. {ct_log_dir, "test/logs"}.
  66. %% Option to pass extra parameters when launching Common Test
  67. {ct_extra_params, "-boot start_sasl -s myapp"}.
  68. %% Option to use short names (i.e., -sname test) when starting ct
  69. {ct_use_short_names, true}.
  70. %% == QuickCheck ==
  71. %% If qc_mod is unspecified, rebar tries to detect Triq or EQC
  72. {qc_opts, [{qc_mod, module()}, Options]}.
  73. %% Additional compile options for qc. erl_opts is also used
  74. {qc_compile_opts, []}.
  75. %% Same as erl_first_files, but used only when running 'qc'
  76. {qc_first_files, []}.
  77. %% == Cleanup ==
  78. %% Which files to cleanup
  79. {clean_files, ["file", "file2"]}.
  80. %% == Reltool ==
  81. %% Target directory for the release
  82. {target, "target"}.
  83. %% == OTP Applications ==
  84. %% Binaries to link into the erlang path?
  85. {app_bin, []}.
  86. %% Enable validation of the OTP app module list. Default is 'true'
  87. {validate_app_modules, true}.
  88. %% == Dependencies ==
  89. %% Where to put any downloaded dependencies. Default is "deps"
  90. {deps_dir, "deps"}.
  91. %% What dependencies we have, dependencies can be of 3 forms, an application
  92. %% name as an atom, eg. mochiweb, a name and a version (from the .app file), or
  93. %% an application name, a version and the SCM details on how to fetch it (SCM
  94. %% type, location and revision).
  95. %% Rebar currently supports git, hg, bzr, svn, and rsync.
  96. {deps, [application_name,
  97. {application_name, "1.0.*"},
  98. {application_name, "1.0.*",
  99. {git, "git://github.com/basho/rebar.git", {branch, "master"}}},
  100. %% Dependencies can be marked as 'raw'. Rebar does not require
  101. %% such dependencies to have a standard Erlang/OTP layout
  102. %% which assumes the presence of either
  103. %% "src/dependency_name.app.src" or "ebin/dependency_name.app"
  104. %% files.
  105. %%
  106. %% 'raw' dependencies can still contain 'rebar.config' and
  107. %% even can have the proper OTP directory layout, but they
  108. %% won't be compiled.
  109. %%
  110. %% Only a subset of rebar commands will be executed on the
  111. %% 'raw' subdirectories: get-deps, update-deps, check-deps,
  112. %% list-deps and delete-deps.
  113. {application_name, "",
  114. {git, "git://github.com/basho/rebar.git", {branch, "master"}},
  115. [raw]}]}.
  116. %% == Subdirectories ==
  117. %% Subdirectories?
  118. {sub_dirs, ["dir1", "dir2"]}.
  119. %% == Plugins ==
  120. %% Plugins you wish to include.
  121. %% These can include any module on the code path, including deps.
  122. %% Alternatively, plugins can be placed as source files in the plugin_dir, in
  123. %% which case they will be compiled and loaded dynamically at runtime.
  124. {plugins, [plugin1, plugin2]}.
  125. %% Override the directory in which plugin sources can be found.
  126. %% Defaults to ./plugins
  127. {plugin_dir, "some_other_directory"}.
  128. %% == Pre/Post Command Hooks ==
  129. {pre_hooks, [{clean, "./prepare_package_files.sh"},
  130. {"linux", compile, "c_src/build_linux.sh"},
  131. {compile, "escript generate_headers"},
  132. {compile, "escript check_headers"}]}.
  133. {post_hooks, [{clean, "touch file1.out"},
  134. {"freebsd", compile, "c_src/freebsd_tweaks.sh"},
  135. {eunit, "touch file2.out"},
  136. {compile, "touch postcompile.out"}]}.
  137. %% == xref ==
  138. {xref_warnings, false}.
  139. %% xref checks to run
  140. {xref_checks, [exports_not_used, undefined_function_calls]}.
  141. %% Optional custom xref queries (xref manual has details) specified as
  142. %% {xref_queries, [{query_string(), expected_query_result()},...]}
  143. %% The following for example removes all references to ejabberd:*_msg/4
  144. %% functions from undefined external function calls as those are in a
  145. %% generated module
  146. {xref_queries,
  147. [{"(XC - UC) || (XU - X - B"
  148. " - (\"ejabberd_logger\":\".*_msg\"/\"4\"))",[]}]}.