Skip to content

Commit a2f6462

Browse files
author
Tuncer Ayaz
authored
Merge pull request #50 from tuncer/report-sources
Redo #37
2 parents dd052e3 + b67948e commit a2f6462

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/pc_port_specs.erl

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,23 @@ port_spec_from_legacy(Config) ->
119119
objects = port_objects(Sources),
120120
opts = [port_opt(Config, O) || O <- fill_in_defaults([])]}.
121121

122+
maybe_report_wc(Source, Found) ->
123+
case Found of
124+
[] ->
125+
rebar_api:warn("Found no source files for:~n~p", [Source]);
126+
_ ->
127+
ok
128+
end,
129+
Found.
130+
131+
wildcard(Source) ->
132+
maybe_report_wc(Source, filelib:wildcard(Source)).
133+
wildcard(Source, WorkDir) ->
134+
maybe_report_wc(Source, filelib:wildcard(Source, WorkDir)).
135+
122136
port_sources(WorkDir, Sources) ->
123137
lists:flatmap(fun (Source) ->
124-
filelib:wildcard(Source, WorkDir)
138+
wildcard(Source, WorkDir)
125139
end, Sources).
126140

127141
maybe_switch_extension({win32, nt}, Target) ->
@@ -151,7 +165,7 @@ get_port_spec(Config, OsType, {_Arch, Target, Sources, Opts}) ->
151165
Source1 = expand_env(Source, Env),
152166
Source2 = rebar_utils:escape_chars(
153167
filename:join(rebar_state:dir(Config), Source1)),
154-
filelib:wildcard(Source2)
168+
wildcard(Source2)
155169
end, Sources),
156170
LinkLang =
157171
case lists:any(

0 commit comments

Comments
 (0)