19
19
20
20
-spec init (rebar_state :t ()) -> {ok , rebar_state :t ()}.
21
21
init (State ) ->
22
- State1 =
23
- rebar_state :add_provider (State ,
24
- providers :create ([{name , ? PROVIDER },
25
- {module , ? MODULE },
26
- {namespace , ? NAMESPACE },
27
- {bare , false },
28
- {deps , ? DEPS },
29
- {example , " " },
30
- {short_desc , " " },
31
- {desc , " " },
32
- {opts , [{paths , $p , " paths" , string , " Wildcard paths of ebin directories to add to code path, separated by a colon" },
33
- {separator , $s , " separator" , string , " In case of multiple return paths, the separator character to use to join them." }]}])),
22
+ State1 = rebar_state :add_provider (
23
+ State ,
24
+ providers :create ([
25
+ {name , ? PROVIDER },
26
+ {module , ? MODULE },
27
+ {namespace , ? NAMESPACE },
28
+ {bare , false },
29
+ {deps , ? DEPS },
30
+ {example , " " },
31
+ {short_desc , " " },
32
+ {desc , " " },
33
+ {opts , [
34
+ {paths , $p , " paths" , string ,
35
+ " Wildcard paths of ebin directories to add to code path, "
36
+ " separated by a colon" },
37
+ {separator , $s , " separator" , string ,
38
+ " In case of multiple return paths, the separator character "
39
+ " to use to join them." },
40
+ {outdir , $o , " outdir" , string ,
41
+ " Path where build artifacts are located. Defaults to the "
42
+ " current directory." }
43
+ ]}
44
+ ])
45
+ ),
34
46
{ok , State1 }.
35
47
36
48
-spec do (rebar_state :t ()) -> {ok , rebar_state :t ()} | {error , string ()}.
@@ -41,11 +53,12 @@ do(State) ->
41
53
{RawOpts , _ } = rebar_state :command_parsed_args (State ),
42
54
Paths = proplists :get_value (paths , RawOpts ),
43
55
Sep = proplists :get_value (separator , RawOpts , " " ),
56
+ OutDir = proplists :get_value (outdir , RawOpts , rebar_dir :get_cwd ()),
44
57
[ code :add_pathsa (filelib :wildcard (PathWildcard ))
45
58
|| PathWildcard <- rebar_string :lexemes (Paths , Sep ) ],
46
59
47
60
[AppInfo ] = rebar_state :project_apps (State ),
48
- AppInfo1 = rebar_app_info :out_dir (AppInfo , rebar_dir : get_cwd () ),
61
+ AppInfo1 = rebar_app_info :out_dir (AppInfo , OutDir ),
49
62
50
63
% % run compile in the default namespace
51
64
rebar_prv_compile :compile (rebar_state :namespace (State , default ), AppInfo1 ),
0 commit comments