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.

241 lines
7.4 KiB

пре 13 година
пре 13 година
пре 13 година
пре 14 година
пре 14 година
пре 11 година
пре 14 година
пре 13 година
  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. %% == Artifacts ==
  6. %% Artifacts are files generated by other tools (or plugins) and whose
  7. %% presence is necessary for a build to be considered successful
  8. {artifacts, ["priv/mycode.so"]}.
  9. %% == Erlang Compiler ==
  10. %% Erlang files to compile before the rest. Rebar automatically compiles
  11. %% parse_transforms and custom behaviours before anything other than the files
  12. %% in this list.
  13. {erl_first_files, ["src/mymib1.erl", "src/mymib2.erl"]}.
  14. %% Erlang compiler options
  15. {erl_opts, [no_debug_info,
  16. {i, "myinclude"},
  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. %% leex options
  26. {xrl_opts, []}.
  27. %% leex files to compile first
  28. {xrl_first_files, []}.
  29. %% yecc options
  30. {yrl_opts, []}.
  31. %% yecc files to compile first
  32. {yrl_first_files, []}.
  33. %% == Common Test ==
  34. %% {erl_opts, [...]}, but for CT runs
  35. {ct_compile_opts, []}.
  36. %% {erl_first_files, ...} but for CT runs
  37. {ct_first_files, []}.
  38. %% Same options as for ct:run_test(Opts)
  39. {ct_opts, []}.
  40. %% == Cover ==
  41. %% Whether to enable coverage reporting where commands support cover. Default
  42. %% is `false'
  43. {cover_enabled, false}.
  44. %% Modules to exclude from cover
  45. {cover_excl_mods, []}.
  46. %% Options to pass to cover provider
  47. {cover_opts, [verbose]}.
  48. %% == Dependencies ==
  49. %% What dependencies we have, dependencies can be of 3 forms, an application
  50. %% name as an atom, eg. mochiweb, a name and a version (from the .app file), or
  51. %% an application name, a version and the SCM details on how to fetch it (SCM
  52. %% type, location and revision).
  53. %% Rebar3 currently supports git and hg
  54. {deps, [
  55. app_name, % latest version of package
  56. {rebar, "1.0.0"}, % version 1.0.0 of a package
  57. {rebar, % git, master branch of app, explicit
  58. {git, "git://github.com/rebar/rebar.git", {branch, "master"}}},
  59. {rebar, % git, over HTTPS
  60. {git, "https://github.com/rebar/rebar.git", {branch, "master"}}},
  61. {rebar, % git, tag
  62. {git, "https://github.com/rebar/rebar.git", {tag, "1.0.0"}}},
  63. {rebar, % git, specific reference/hash
  64. {git, "https://github.com/rebar/rebar.git", {ref, "7f73b8d6"}}},
  65. {rebar, % mercurial is also supported
  66. {hg, "https://github.com/rebar/rebar.git", {tag, "1.0.0"}}},
  67. %% Alternative formats, backwards compatible declarations
  68. {rebar, % implicit master, will warn recommending explicit branch
  69. {git, "git://github.com/rebar/rebar.git"}},
  70. {rebar, "1.0.*", % regex version check, ignored
  71. {git, "git://github.com/rebar/rebar.git"}},
  72. {rebar, "1.0.*", % literal branch/ref/tag, will warn for explicit reference
  73. {git, "git://github.com/rebar/rebar.git", "Rev"}},
  74. {rebar, ".*", % 'raw' dependency, argument ignored
  75. {git, "git://github.com/rebar/rebar.git", {branch, "master"}},
  76. [raw]}
  77. ]}.
  78. %% == Dialyzer ==
  79. {dialyzer, [
  80. {warnings, [underspecs, no_return]},
  81. {get_warnings, true},
  82. {plt_apps, top_level_deps}, % top_level_deps | all_deps
  83. {plt_extra_apps, []},
  84. {plt_location, local}, % local | "/my/file/name"
  85. {plt_prefix, "rebar3"},
  86. {base_plt_apps, [stdlib, kernel, crypto]},
  87. {base_plt_location, global}, % global | "/my/file/name"
  88. {base_plt_prefix, "rebar3"}
  89. ]}.
  90. %% == Directories ==
  91. %% directory for artifacts produced by rebar3
  92. {base_dir, "_build"}.
  93. %% directory in '<base_dir>/<profile>/' where deps go
  94. {deps_dir, "lib"}.
  95. %% where rebar3 operates from; defaults to the current working directory
  96. {root_dir, "."}.
  97. %% where checkout dependencies are to be located
  98. {checkouts_dir, "_checkouts"}.
  99. %% directory in '<base_dir>/<profile>/' where plugins go
  100. {plugins_dir, "plugins"}.
  101. %% directories where OTP applications for the project can be located
  102. {project_app_dirs, ["apps/*", "lib/*", "."]}.
  103. %% Directories where source files for an OTP application can be found
  104. {src_dirs, ["src"]}.
  105. %% Paths to miscellaneous Erlang files to compile for an app
  106. %% without including them in its modules list
  107. {extra_src_dirs, []}.
  108. %% Path where custom rebar3 templates could be found
  109. {template_dir, []}.
  110. %% == EDoc ==
  111. %% EDoc options, same as those passed to the edoc compiler
  112. %% when called by hand.
  113. {edoc_opts, []}.
  114. %% == Escript ==
  115. %% name of the main OTP application to boot
  116. {escript_main_app, application}
  117. %% Name of the resulting escript executable
  118. {escript_name, "application"}.
  119. %% apps (other than main and deps) to be included
  120. {escript_incl_apps, []}.
  121. %% Executable escript lines
  122. {escript_shebang, "#!/usr/bin/env escript\n"}.
  123. {escript_comment, "%%\n"}.
  124. {escript_emu_args, "%%! -escript main ~s -pa ~s/~s/ebin\n"}.
  125. %% == EUnit ==
  126. %% eunit:test(Tests)
  127. {eunit_tests, [{application, rebar3}]}
  128. %% Options for eunit:test(Tests, Opts)
  129. {eunit_opts, [verbose]}.
  130. %% Additional compile options for eunit. erl_opts is also used
  131. {eunit_compile_opts, [{d, some_define}]}.
  132. %% {erl_first_files, ...} but for Eunit
  133. {eunit_first_files, ["test/test_behaviour.erl"]}.
  134. %% == Overrides ==
  135. {overrides, [
  136. %% Add options to mydep's configurations for each element
  137. {add, mydep, [{erl_opts, []}]},
  138. %% replace mydep's configuration option
  139. {override, mydep, [{erl_opts, []}]},
  140. %% replace all dependencies' configuration options
  141. {override, [{erl_opts, []}]}
  142. ]}.
  143. %% == Pre/Post Shell Hooks ==
  144. %% Running shell commands before or after a given rebar3 command
  145. {pre_hooks, [{clean, "./prepare_package_files.sh"},
  146. {"linux", compile, "c_src/build_linux.sh"},
  147. {compile, "escript generate_headers"},
  148. {compile, "escript check_headers"}]}.
  149. {post_hooks, [{clean, "touch file1.out"},
  150. {"freebsd", compile, "c_src/freebsd_tweaks.sh"},
  151. {eunit, "touch file2.out"},
  152. {compile, "touch postcompile.out"}]}.
  153. %% == Provider Hooks ==
  154. %% Run a rebar3 command before or after another one.
  155. %% Only clean, ct, compile, eunit, release, and tar can be hooked around
  156. %% runs 'clean' before 'compile'
  157. {provider_hooks, [{pre, [{compile, clean}]}]}
  158. %% == Releases ==
  159. {relx, [{release, {my_release, "0.0.1"},
  160. [myapp]},
  161. {dev_mode, true},
  162. {include_erts, false},
  163. {extended_start_script, true}]}.
  164. %% == Shell ==
  165. %% apps to auto-boot with `rebar3 shell'; defaults to apps
  166. %% specified in a `relx' tuple, if any.
  167. {shell, [{apps, [app1, app2]}]}.
  168. %% == xref ==
  169. {xref_warnings, false}.
  170. %% optional extra paths to include in xref:set_library_path/2.
  171. %% specified relative location of rebar.config.
  172. %% e.g. {xref_extra_paths,["../gtknode/src"]}
  173. {xref_extra_paths,[]}.
  174. %% xref checks to run
  175. {xref_checks, [undefined_function_calls, undefined_functions,
  176. locals_not_used, exports_not_used,
  177. deprecated_function_calls, deprecated_functions]}.
  178. %% Optional custom xref queries (xref manual has details) specified as
  179. %% {xref_queries, [{query_string(), expected_query_result()},...]}
  180. %% The following for example removes all references to mod:*foo/4
  181. %% functions from undefined external function calls as those are in a
  182. %% generated module
  183. {xref_queries,
  184. [{"(XC - UC) || (XU - X - B"
  185. " - (\"mod\":\".*foo\"/\"4\"))",[]}]}.