您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

245 行
7.5 KiB

  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. %% Extend list of always recursive commands
  7. {recursive_cmds, []}.
  8. %% Check required ERTS or OTP release version
  9. {require_erts_vsn, ".*"}.
  10. {require_otp_vsn, ".*"}.
  11. {require_min_otp_vsn, ".*"}.
  12. %% Additional library directories to add to the code path
  13. {lib_dirs, []}.
  14. %% == Erlang Compiler ==
  15. %% Erlang files to compile before the rest. Rebar automatically compiles
  16. %% parse_transforms and custom behaviours before anything other than the files
  17. %% in this list.
  18. {erl_first_files, ["mymib1", "mymib2"]}.
  19. %% Erlang compiler options
  20. {erl_opts, [no_debug_info,
  21. {i, "myinclude"},
  22. {src_dirs, ["src", "src2", "src3"]},
  23. {platform_define,
  24. "(linux|solaris|freebsd|darwin)", 'HAVE_SENDFILE'},
  25. {platform_define, "(linux|freebsd)", 'BACKLOG', 128},
  26. {platform_define, "R13", 'old_inets'}]}.
  27. %% MIB Options?
  28. {mib_opts, []}.
  29. %% SNMP mibs to compile first?
  30. {mib_first_files, []}.
  31. %% leex options
  32. {xrl_opts, []}.
  33. %% leex files to compile first
  34. {xrl_first_files, []}.
  35. %% yecc options
  36. {yrl_opts, []}.
  37. %% yecc files to compile first
  38. {yrl_first_files, []}.
  39. %% == EDoc ==
  40. %% EDoc options
  41. {edoc_opts, []}.
  42. %% == Port Compiler ==
  43. %% Port compilation environment variables. See rebar_port_compiler.erl for
  44. %% more info. Default is `[]'
  45. {port_env, [{"CFLAGS", "$CFLAGS -Ifoo"},
  46. {"freebsd", "LDFLAGS", "$LDFLAGS -lfoo"}]}.
  47. %% port_specs
  48. %% List of filenames or wildcards to be compiled. May also contain a tuple
  49. %% consisting of a regular expression to be applied against the system
  50. %% architecture as a filter.
  51. {port_specs, [{"priv/so_name.so", ["c_src/*.c"]},
  52. {"linux", "priv/hello_linux", ["c_src/hello_linux.c"]},
  53. {"linux", "priv/hello_linux", ["c_src/*.c"], [{env, []}]}]}.
  54. %% == escriptize ==
  55. {escript_name, "application"}.
  56. {escript_incl_apps, []}.
  57. {escript_shebang, "#!/usr/bin/env escript\n"}.
  58. {escript_comment, "%%\n"}.
  59. {escript_emu_args, "%%! -pa application/application/ebin\n"}.
  60. %% == LFE Compiler ==
  61. %% LFE files to compile before the rest
  62. {lfe_first_files, []}.
  63. %% Options for the LFE compiler: reuse {erl_opts, []}
  64. %% == ErlyDTL Compiler ==
  65. %% Options for the ErlyDTL compiler
  66. {erlydtl_opts, []}.
  67. %% == EUnit ==
  68. %% Options for eunit:test()
  69. {eunit_opts, []}.
  70. %% Additional compile options for eunit. erl_opts is also used
  71. {eunit_compile_opts, []}.
  72. %% Same as erl_first_files, but used only when running 'eunit'
  73. {eunit_first_files, []}.
  74. %% == Cover ==
  75. %% Whether to enable coverage reporting. Default is `false'
  76. {cover_enabled, false}.
  77. %% Whether to print coverage report to console. Default is `false'
  78. {cover_print_enabled, false}.
  79. %% Whether to export coverage report to file. Default is `false'
  80. {cover_export_enabled, false}.
  81. %% == Common Test ==
  82. %% Override the default "test" directory in which SUITEs are located
  83. {ct_dir, "itest"}.
  84. %% Override the default "logs" directory in which SUITEs are logged
  85. {ct_log_dir, "test/logs"}.
  86. %% Option to pass extra parameters when launching Common Test
  87. {ct_extra_params, "-boot start_sasl -s myapp"}.
  88. %% Option to use short names (i.e., -sname test) when starting ct
  89. {ct_use_short_names, true}.
  90. %% == QuickCheck ==
  91. %% If qc_mod is unspecified, rebar tries to detect Triq or EQC
  92. {qc_opts, [{qc_mod, module()}, Options]}.
  93. %% Additional compile options for qc. erl_opts is also used
  94. {qc_compile_opts, []}.
  95. %% Same as erl_first_files, but used only when running 'qc'
  96. {qc_first_files, []}.
  97. %% == Cleanup ==
  98. %% Which files to cleanup
  99. {clean_files, ["file", "file2"]}.
  100. %% == OTP Applications ==
  101. %% Enable validation of the OTP app module list. Default is 'true'
  102. {validate_app_modules, true}.
  103. %% == Dependencies ==
  104. %% Where to put any downloaded dependencies. Default is "deps"
  105. {deps_dir, "deps"}.
  106. %% What dependencies we have, dependencies can be of 3 forms, an application
  107. %% name as an atom, eg. mochiweb, a name and a version (from the .app file), or
  108. %% an application name, a version and the SCM details on how to fetch it (SCM
  109. %% type, location and revision).
  110. %% Rebar currently supports git, hg, bzr, svn, rsync, fossil, and p4.
  111. {deps, [app_name,
  112. {rebar, "1.0.*"},
  113. {rebar, ".*",
  114. {git, "git://github.com/rebar/rebar.git"}},
  115. {rebar, ".*",
  116. {git, "git://github.com/rebar/rebar.git", "Rev"}},
  117. {rebar, "1.0.*",
  118. {git, "git://github.com/rebar/rebar.git", {branch, "master"}}},
  119. {rebar, "1.0.0",
  120. {git, "git://github.com/rebar/rebar.git", {tag, "1.0.0"}}},
  121. %% Dependencies can be marked as 'raw'. Rebar does not require
  122. %% such dependencies to have a standard Erlang/OTP layout
  123. %% which assumes the presence of either
  124. %% "src/dependency_name.app.src" or "ebin/dependency_name.app"
  125. %% files.
  126. %%
  127. %% 'raw' dependencies can still contain 'rebar.config' and
  128. %% even can have the proper OTP directory layout, but they
  129. %% won't be compiled.
  130. %%
  131. %% Only a subset of rebar commands will be executed on the
  132. %% 'raw' subdirectories: get-deps, update-deps, check-deps,
  133. %% list-deps and delete-deps.
  134. {rebar, "",
  135. {git, "git://github.com/rebar/rebar.git", {branch, "master"}},
  136. [raw]},
  137. {app_name, ".*", {hg, "https://www.example.org/url"}},
  138. {app_name, ".*", {rsync, "Url"}},
  139. {app_name, ".*", {svn, "https://www.example.org/url"}},
  140. {app_name, ".*", {svn, "svn://svn.example.org/url"}},
  141. {app_name, ".*", {bzr, "https://www.example.org/url", "Rev"}},
  142. {app_name, ".*", {fossil, "https://www.example.org/url"}},
  143. {app_name, ".*", {fossil, "https://www.example.org/url", "Vsn"}},
  144. {app_name, ".*", {p4, "//depot/subdir/app_dir"}}]}.
  145. %% == Subdirectories ==
  146. %% Subdirectories?
  147. {sub_dirs, ["dir1", "dir2"]}.
  148. %% == Plugins ==
  149. %% Plugins you wish to include.
  150. %% These can include any module on the code path, including deps.
  151. %% Alternatively, plugins can be placed as source files in the plugin_dir, in
  152. %% which case they will be compiled and loaded dynamically at runtime.
  153. {plugins, [plugin1, plugin2]}.
  154. %% Override the directory in which plugin sources can be found.
  155. %% Defaults to ./plugins
  156. {plugin_dir, "some_other_directory"}.
  157. %% == Pre/Post Command Hooks ==
  158. {pre_hooks, [{clean, "./prepare_package_files.sh"},
  159. {"linux", compile, "c_src/build_linux.sh"},
  160. {compile, "escript generate_headers"},
  161. {compile, "escript check_headers"}]}.
  162. {post_hooks, [{clean, "touch file1.out"},
  163. {"freebsd", compile, "c_src/freebsd_tweaks.sh"},
  164. {eunit, "touch file2.out"},
  165. {compile, "touch postcompile.out"}]}.
  166. %% == xref ==
  167. {xref_warnings, false}.
  168. %% optional extra paths to include in xref:set_library_path/2.
  169. %% specified relative location of rebar.config.
  170. %% e.g. {xref_extra_paths,["../gtknode/src"]}
  171. {xref_extra_paths,[]}.
  172. %% xref checks to run
  173. {xref_checks, [undefined_function_calls, undefined_functions,
  174. locals_not_used, exports_not_used,
  175. deprecated_function_calls, deprecated_functions]}.
  176. %% Optional custom xref queries (xref manual has details) specified as
  177. %% {xref_queries, [{query_string(), expected_query_result()},...]}
  178. %% The following for example removes all references to mod:*foo/4
  179. %% functions from undefined external function calls as those are in a
  180. %% generated module
  181. {xref_queries,
  182. [{"(XC - UC) || (XU - X - B"
  183. " - (\"mod\":\".*foo\"/\"4\"))",[]}]}.