Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

237 строки
7.2 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. %% 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_apps, top_level_deps}, % top_level_deps | all_deps
  81. {plt_extra_apps, []},
  82. {plt_location, local}, % local | "/my/file/name"
  83. {plt_prefix, "rebar3"},
  84. {base_plt_apps, [stdlib, kernel, crypto]},
  85. {base_plt_location, global}, % global | "/my/file/name"
  86. {base_plt_prefix, "rebar3"}
  87. ]}.
  88. %% == Directories ==
  89. %% directory for artifacts produced by rebar3
  90. {base_dir, "_build"}.
  91. %% directory in '<base_dir>/<profile>/' where deps go
  92. {deps_dir, "lib"}.
  93. %% where rebar3 operates from; defaults to the current working directory
  94. {root_dir, "."}.
  95. %% where checkout dependencies are to be located
  96. {checkouts_dir, "_checkouts"}.
  97. %% directory in '<base_dir>/<profile>/' where plugins go
  98. {plugins_dir, "plugins"}.
  99. %% directories where OTP applications for the project can be located
  100. {project_app_dirs, ["apps/*", "lib/*", "."]}.
  101. %% Directories where source files for an OTP application can be found
  102. {src_dirs, ["src"]}.
  103. %% Paths to miscellaneous Erlang files to compile for an app
  104. %% without including them in its modules list
  105. {extra_src_dirs, []}.
  106. %% == EDoc ==
  107. %% EDoc options, same as those passed to the edoc compiler
  108. %% when called by hand.
  109. {edoc_opts, []}.
  110. %% == Escript ==
  111. %% name of the main OTP application to boot
  112. {escript_main_app, application}
  113. %% Name of the resulting escript executable
  114. {escript_name, "application"}.
  115. %% apps (other than main and deps) to be included
  116. {escript_incl_apps, []}.
  117. %% Executable escript lines
  118. {escript_shebang, "#!/usr/bin/env escript\n"}.
  119. {escript_comment, "%%\n"}.
  120. {escript_emu_args, "%%! -escript main ~s -pa ~s/~s/ebin\n"}.
  121. %% == EUnit ==
  122. %% eunit:test(Tests)
  123. {eunit_tests, [{application, rebar3}]}
  124. %% Options for eunit:test(Tests, Opts)
  125. {eunit_opts, [verbose]}.
  126. %% Additional compile options for eunit. erl_opts is also used
  127. {eunit_compile_opts, [{d, some_define}]}.
  128. %% {erl_first_files, ...} but for Eunit
  129. {eunit_first_files, ["test/test_behaviour.erl"]}.
  130. %% == Overrides ==
  131. {overrides, [
  132. %% Add options to mydep's configurations for each element
  133. {add, mydep, [{erl_opts, []}]},
  134. %% replace mydep's configuration option
  135. {override, mydep, [{erl_opts, []}]},
  136. %% replace all dependencies' configuration options
  137. {override, [{erl_opts, []}]}
  138. ]}.
  139. %% == Pre/Post Shell Hooks ==
  140. %% Running shell commands before or after a given rebar3 command
  141. {pre_hooks, [{clean, "./prepare_package_files.sh"},
  142. {"linux", compile, "c_src/build_linux.sh"},
  143. {compile, "escript generate_headers"},
  144. {compile, "escript check_headers"}]}.
  145. {post_hooks, [{clean, "touch file1.out"},
  146. {"freebsd", compile, "c_src/freebsd_tweaks.sh"},
  147. {eunit, "touch file2.out"},
  148. {compile, "touch postcompile.out"}]}.
  149. %% == Provider Hooks ==
  150. %% Run a rebar3 command before or after another one.
  151. %% Only clean, ct, compile, eunit, release, and tar can be hooked around
  152. %% runs 'clean' before 'compile'
  153. {provider_hooks, [{pre, [{compile, clean}]}]}
  154. %% == Releases ==
  155. {relx, [{release, {my_release, "0.0.1"},
  156. [myapp]},
  157. {dev_mode, true},
  158. {include_erts, false},
  159. {extended_start_script, true}]}.
  160. %% == Shell ==
  161. %% apps to auto-boot with `rebar3 shell'; defaults to apps
  162. %% specified in a `relx' tuple, if any.
  163. {shell, [{apps, [app1, app2]}]}.
  164. %% == xref ==
  165. {xref_warnings, false}.
  166. %% optional extra paths to include in xref:set_library_path/2.
  167. %% specified relative location of rebar.config.
  168. %% e.g. {xref_extra_paths,["../gtknode/src"]}
  169. {xref_extra_paths,[]}.
  170. %% xref checks to run
  171. {xref_checks, [undefined_function_calls, undefined_functions,
  172. locals_not_used, exports_not_used,
  173. deprecated_function_calls, deprecated_functions]}.
  174. %% Optional custom xref queries (xref manual has details) specified as
  175. %% {xref_queries, [{query_string(), expected_query_result()},...]}
  176. %% The following for example removes all references to mod:*foo/4
  177. %% functions from undefined external function calls as those are in a
  178. %% generated module
  179. {xref_queries,
  180. [{"(XC - UC) || (XU - X - B"
  181. " - (\"mod\":\".*foo\"/\"4\"))",[]}]}.