Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

235 rindas
7.1 KiB

pirms 14 gadiem
pirms 14 gadiem
pirms 14 gadiem
pirms 13 gadiem
  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_include_all_deps, false},
  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. %% Options for eunit:test(Tests, ...)
  123. {eunit_opts, []}.
  124. %% Additional compile options for eunit. erl_opts is also used
  125. {eunit_compile_opts, []}.
  126. %% {erl_first_files, ...} but for Eunit
  127. {eunit_first_files, []}.
  128. %% == Overrides ==
  129. {overrides, [
  130. %% Add options to mydep's configurations for each element
  131. {add, mydep, [{erl_opts, []}]},
  132. %% replace mydep's configuration option
  133. {override, mydep, [{erl_opts, []}]},
  134. %% replace all dependencies' configuration options
  135. {override, [{erl_opts, []}]}
  136. ]}.
  137. %% == Pre/Post Shell Hooks ==
  138. %% Running shell commands before or after a given rebar3 command
  139. {pre_hooks, [{clean, "./prepare_package_files.sh"},
  140. {"linux", compile, "c_src/build_linux.sh"},
  141. {compile, "escript generate_headers"},
  142. {compile, "escript check_headers"}]}.
  143. {post_hooks, [{clean, "touch file1.out"},
  144. {"freebsd", compile, "c_src/freebsd_tweaks.sh"},
  145. {eunit, "touch file2.out"},
  146. {compile, "touch postcompile.out"}]}.
  147. %% == Provider Hooks ==
  148. %% Run a rebar3 command before or after another one.
  149. %% Only clean, ct, compile, eunit, release, and tar can be hooked around
  150. %% runs 'clean' before 'compile'
  151. {provider_hooks, [{pre, [{compile, clean}]}]}
  152. %% == Releases ==
  153. {relx, [{release, {my_release, "0.0.1"},
  154. [myapp]},
  155. {dev_mode, true},
  156. {include_erts, false},
  157. {extended_start_script, true}]}.
  158. %% == Shell ==
  159. %% apps to auto-boot with `rebar3 shell'; defaults to apps
  160. %% specified in a `relx' tuple, if any.
  161. {shell_apps, [app1, app2]}
  162. %% == xref ==
  163. {xref_warnings, false}.
  164. %% optional extra paths to include in xref:set_library_path/2.
  165. %% specified relative location of rebar.config.
  166. %% e.g. {xref_extra_paths,["../gtknode/src"]}
  167. {xref_extra_paths,[]}.
  168. %% xref checks to run
  169. {xref_checks, [undefined_function_calls, undefined_functions,
  170. locals_not_used, exports_not_used,
  171. deprecated_function_calls, deprecated_functions]}.
  172. %% Optional custom xref queries (xref manual has details) specified as
  173. %% {xref_queries, [{query_string(), expected_query_result()},...]}
  174. %% The following for example removes all references to mod:*foo/4
  175. %% functions from undefined external function calls as those are in a
  176. %% generated module
  177. {xref_queries,
  178. [{"(XC - UC) || (XU - X - B"
  179. " - (\"mod\":\".*foo\"/\"4\"))",[]}]}.