Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Honour the 'include_dirs' option as mentioned in the documentation.

Also include 'dir_list' for backwards compatibility.
  • Loading branch information...
commit fd88328079f802ed6816389e117cf254a12fde83 1 parent 3e1b6a5
@apauley apauley authored
Showing with 14 additions and 4 deletions.
  1. +14 −4 src/erlsom_compile.erl
View
18 src/erlsom_compile.erl
@@ -140,10 +140,20 @@ compile_internal(Xsd, Options, Parsed) ->
{value, {_, If}} -> If;
_ -> fun erlsom_lib:findFile/4
end,
- IncludeDirs = case lists:keysearch('dir_list', 1, Options) of
- {value, {_, Id}} -> Id;
- _ -> ["."]
- end,
+ IncludeDirs1 = case lists:keysearch('include_dirs', 1, Options) of
+ {value, {_, Id}} -> Id;
+ _ -> []
+ end,
+ IncludeDirs2 = case lists:keysearch('dir_list', 1, Options) of
+ {value, {_, Dl}} -> Dl;
+ _ -> []
+ end,
+ %% The 'dir_list' option is included here for backwards compatibility.
+ CombinedDirs = IncludeDirs1 ++ IncludeDirs2,
+ IncludeDirs = case CombinedDirs of
+ [] -> ["."];
+ CombinedDirs -> CombinedDirs
+ end,
IncludeFiles = case lists:keysearch('include_files', 1, Options) of
{value, {_, Files}} -> Files;
_ -> Namespaces %% the two options are mutually exlclusive
Please sign in to comment.
Something went wrong with that request. Please try again.