@@ -221,6 +221,7 @@ discover_plugins(State) ->
221
221
end .
222
222
223
223
is_umbrella (State ) ->
224
+ io :format (" +++ rebar_state:get(State, is_umbrella):~p~n~n " , [rebar_state :get (State , is_umbrella , ? DEFAULT_UMBRELLA )]),
224
225
% % We can't know if this is an umbrella project before running app discovery,
225
226
% % but plugins are installed before app discovery. So we do a heuristic.
226
227
% % The lib dirs we search contain things such as apps/, lib/, etc.
@@ -231,16 +232,24 @@ is_umbrella(State) ->
231
232
% % So what we do here is look for the library directories without the ".",
232
233
% % and if none of these paths exist but one of the src_dirs exist, then
233
234
% % we know this is not an umbrella application.
234
- case rebar_dir : lib_dirs (State ) of
235
- ? DEFAULT_PROJECT_APP_DIRS ->
235
+ case rebar_state : get (State , is_umbrella , ? DEFAULT_UMBRELLA ) of
236
+ ? DEFAULT_UMBRELLA ->
236
237
Root = rebar_dir :root_dir (State ),
237
238
LibPaths = lists :usort (rebar_dir :lib_dirs (State )) -- [" ." ],
238
239
SrcPaths = rebar_dir :src_dirs (rebar_state :opts (State ), [" src" ]),
240
+ io :format (" +++ Root:~p~n~n " , [Root ]),
241
+ io :format (" +++ LibPaths:~p~n~n " , [LibPaths ]),
242
+ io :format (" +++ SrcPaths:~p~n~n " , [SrcPaths ]),
243
+ io :format (" +++ rebar_dir:src_dirs(rebar_state:opts(State), [src]):~p~n~n " , [rebar_dir :src_dirs (rebar_state :opts (State ), [" src" ])]),
244
+ io :format (" +++ lists:map(fun(Dir) -> filelib:wildcard(filename:join(Root, Dir)) end, LibPaths):~p~n~n " , [lists :map (fun (Dir ) -> filelib :wildcard (filename :join (Root , Dir )) end , LibPaths )]),
245
+ io :format (" +++ lists:map(fun(Dir) -> filename:join(Root, Dir) end, SrcPaths):~p~n~n " , [lists :map (fun (Dir ) -> filename :join (Root , Dir ) end , SrcPaths )]),
246
+ io :format (" +++ lists:any(fun(Dir) -> [] == filelib:wildcard(filename:join(Root, Dir)) end, LibPaths):~p~n~n " , [lists :any (fun (Dir ) -> [] == filelib :wildcard (filename :join (Root , Dir )) end , LibPaths )]),
247
+ io :format (" +++ lists:all(fun(Dir) -> not filelib:is_dir(filename:join(Root, Dir)) end, SrcPaths):~p~n~n " , [lists :all (fun (Dir ) -> not filelib :is_dir (filename :join (Root , Dir )) end , SrcPaths )]),
239
248
lists :any (fun (Dir ) -> [] == filelib :wildcard (filename :join (Root , Dir )) end , LibPaths )
240
- andalso
249
+ andalso
241
250
lists :all (fun (Dir ) -> not filelib :is_dir (filename :join (Root , Dir )) end , SrcPaths );
242
- _ ->
243
- true
251
+ true -> true
252
+ end .
244
253
end .
245
254
246
255
prepare_plugin (AppInfo ) ->
0 commit comments