25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

247 lines
7.7 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, ["src/mymib1.erl", "src/mymib2.erl"]}.
  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. {rebar, ".*",
  122. {git, "git://github.com/rebar/rebar.git", {ref, "7f73b8d3650b41ffd53a199f3eda20985eda84e3"}}},
  123. %% Dependencies can be marked as 'raw'. Rebar does not require
  124. %% such dependencies to have a standard Erlang/OTP layout
  125. %% which assumes the presence of either
  126. %% "src/dependency_name.app.src" or "ebin/dependency_name.app"
  127. %% files.
  128. %%
  129. %% 'raw' dependencies can still contain 'rebar.config' and
  130. %% even can have the proper OTP directory layout, but they
  131. %% won't be compiled.
  132. %%
  133. %% Only a subset of rebar commands will be executed on the
  134. %% 'raw' subdirectories: get-deps, update-deps, check-deps,
  135. %% list-deps and delete-deps.
  136. {rebar, "",
  137. {git, "git://github.com/rebar/rebar.git", {branch, "master"}},
  138. [raw]},
  139. {app_name, ".*", {hg, "https://www.example.org/url"}},
  140. {app_name, ".*", {rsync, "Url"}},
  141. {app_name, ".*", {svn, "https://www.example.org/url"}},
  142. {app_name, ".*", {svn, "svn://svn.example.org/url"}},
  143. {app_name, ".*", {bzr, "https://www.example.org/url", "Rev"}},
  144. {app_name, ".*", {fossil, "https://www.example.org/url"}},
  145. {app_name, ".*", {fossil, "https://www.example.org/url", "Vsn"}},
  146. {app_name, ".*", {p4, "//depot/subdir/app_dir"}}]}.
  147. %% == Subdirectories ==
  148. %% Subdirectories?
  149. {sub_dirs, ["dir1", "dir2"]}.
  150. %% == Plugins ==
  151. %% Plugins you wish to include.
  152. %% These can include any module on the code path, including deps.
  153. %% Alternatively, plugins can be placed as source files in the plugin_dir, in
  154. %% which case they will be compiled and loaded dynamically at runtime.
  155. {plugins, [plugin1, plugin2]}.
  156. %% Override the directory in which plugin sources can be found.
  157. %% Defaults to ./plugins
  158. {plugin_dir, "some_other_directory"}.
  159. %% == Pre/Post Command Hooks ==
  160. {pre_hooks, [{clean, "./prepare_package_files.sh"},
  161. {"linux", compile, "c_src/build_linux.sh"},
  162. {compile, "escript generate_headers"},
  163. {compile, "escript check_headers"}]}.
  164. {post_hooks, [{clean, "touch file1.out"},
  165. {"freebsd", compile, "c_src/freebsd_tweaks.sh"},
  166. {eunit, "touch file2.out"},
  167. {compile, "touch postcompile.out"}]}.
  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\"))",[]}]}.