Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

234 linhas
7.1 KiB

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