Browse Source

remove dializer for now

Maxim Sokhatsky 10 years ago
parent
commit
dc92868398
4 changed files with 0 additions and 50 deletions
  1. BIN
      mad
  2. 0 17
      src/mad_compile.erl
  3. 0 14
      src/mad_deps.erl
  4. 0 19
      src/mad_utils.erl

BIN
mad


+ 0 - 17
src/mad_compile.erl

@@ -3,11 +3,7 @@
 -compile(export_all).
 -define(COMPILE_OPTS(Inc, Ebin, Opts), [report, {i, Inc}, {outdir, Ebin}] ++ Opts).
 
--type directory() :: string().
--type filename() :: string().
-
 %% compile dependencies
--spec deps(directory(), any(), filename(), [mad_deps:dependency()]) -> ok.
 deps(_, _, _, []) -> ok;
 deps(Cwd, Conf, ConfigFile, [H|T]) ->
     {Name, _} = mad_deps:name_and_repo(H),
@@ -17,7 +13,6 @@ deps(Cwd, Conf, ConfigFile, [H|T]) ->
     deps(Cwd, Conf, ConfigFile, T).
 
 %% compile a dependency
--spec dep(directory(), any(), filename(), string()) -> ok.
 dep(Cwd, _Conf, ConfigFile, Name) ->
     io:format("==> ~p~n",[Name]),
     %% check dependencies of the dependency
@@ -61,14 +56,10 @@ dtl(Dir,Config) ->
          X -> compile_erlydtl_files(validate_erlydtl_opts(Dir,X)) end.
 
 
--spec validate_property({atom(), term()}, term()) -> {atom(), term()}.
 validate_property({modules, _}, Modules) -> {modules, Modules};
 validate_property(Else, _) -> Else.
 
--spec compile_fun(directory(), directory(), [compile:option()]) ->
-    fun((file:name(),string(),string(),list(tuple(any(),any())),string()) -> ok).
 compile_fun(Inc,Bin,Opt) -> fun(File) -> compile(File,Inc,Bin,Opt,filetype(File)) end.
-
 filetype(Path) -> "." ++ string:join(tl(string:tokens(filename:basename(Path), ".")), ".").
 
 compile(File,Inc,Bin,Opt,".yrl") ->
@@ -104,13 +95,6 @@ compile(File,_Inc,Bin,_Opt,".app.src") ->
 compile(File,_Inc,_Bin,_Opt,_) ->
     io:format("Unknown file type: ~p~n",[File]).
 
--spec erl_files(directory()) -> [file:name()].
--spec app_src_files(directory()) -> [file:name()].
--spec app_src_to_app(file:name()) -> file:name().
--spec erl_to_beam(directory(), file:name()) -> file:name().
--spec is_compiled(directory(), file:name()) -> boolean().
--spec add_modules_property([{atom(), term()}]) -> [{atom(), term()}].
-
 erl_files(Dir) -> filelib:fold_files(Dir, ".erl", true, fun(F, Acc) -> [F|Acc] end, []).
 yrl_files(Dir) -> filelib:fold_files(Dir, ".yrl", true, fun(F, Acc) -> [F|Acc] end, []).
 app_src_files(Dir) -> filelib:fold_files(Dir, ".app.src", false, fun(F, Acc) -> [F|Acc] end, []).
@@ -124,7 +108,6 @@ add_modules_property(Properties) ->
         {modules, _} -> Properties;
         _ -> Properties ++ [{modules, []}] end.
 
--spec foreach(fun((directory(), filename()) -> ok), [filename()], any(), filename()) -> ok.
 foreach(_, [], _, _) -> ok;
 foreach(Fun, [Dir|T], Config, ConfigFile) ->
     Fun(Dir, Config, ConfigFile),

+ 0 - 14
src/mad_deps.erl

@@ -2,16 +2,6 @@
 -copyright('Sina Samavati').
 -compile(export_all).
 
--type directory() :: string().
--type filename() :: string().
--type name() :: atom().
--type uri() :: string().
--type version_control() :: git | hg.
--type repo() :: {version_control(), uri(), {branch | tag, string()} | string()}.
--type dependency() :: {name(), string(), repo()}.
--export_type([dependency/0]).
-
--spec fetch(directory(), any(), filename(), [dependency()]) -> ok.
 fetch(_, _Config, _, []) -> ok;
 fetch(Cwd, Config, ConfigFile, [H|T]) when is_tuple(H) =:= false -> fetch(Cwd, Config, ConfigFile, T);
 fetch(Cwd, Config, ConfigFile, [H|T]) ->
@@ -30,7 +20,6 @@ fetch(Cwd, Config, ConfigFile, [H|T]) ->
     end,
     fetch(Cwd, Config, ConfigFile, T).
 
--spec fetch_dep(directory(), any(), filename(), string(), string(), uri(), any(), atom()) -> ok.
 fetch_dep(Cwd, Config, ConfigFile, Name, Cmd, Uri, Co, Cache) ->
 
     TrunkPath = case Cache of
@@ -59,7 +48,6 @@ fetch_dep(Cwd, Config, ConfigFile, Name, Cmd, Uri, Co, Cache) ->
        CacheDir -> build_dep(Cwd, Config, ConfigFile, get_publisher(Uri), Name, Cmd, Co1, CacheDir) end.
 
 %% build dependency based on branch/tag/commit
--spec build_dep(directory(), any(), string(), string(), string(), string(), string(), string()) -> ok.
 build_dep(Cwd, Conf, _ConfFile, Publisher, Name, _Cmd, _Co, Dir) ->
     TrunkPath = filename:join([Dir, Publisher, Name]),
     DepsDir = filename:join([mad_utils:get_value(deps_dir, Conf, ["deps"]),Name]),
@@ -68,14 +56,12 @@ build_dep(Cwd, Conf, _ConfFile, Publisher, Name, _Cmd, _Co, Dir) ->
     ok = file:set_cwd(Cwd).
 
 %% internal
--spec name_and_repo(dependency()) -> {string(), repo()}.
 name_and_repo({Name, _, Repo}) when is_list(Name) -> {Name, Repo};
 name_and_repo({Name, _, Repo, _}) when is_list(Name) -> {Name, Repo};
 name_and_repo({Name, _, Repo}) -> {atom_to_list(Name), Repo};
 name_and_repo({Name, _, Repo, _}) -> {atom_to_list(Name), Repo};
 name_and_repo(Name) -> {Name,Name}.
 
--spec get_publisher(uri()) -> string().
 get_publisher(Uri) ->
     case http_uri:parse(Uri, [{scheme_defaults,
             [{git, 9418}|http_uri:scheme_defaults()]}]) of

+ 0 - 19
src/mad_utils.erl

@@ -2,16 +2,11 @@
 -copyright('Sina Samavati').
 -compile(export_all).
 
--type directory() :: string().
-
--spec cwd() -> directory().
 cwd() -> {ok, Cwd} = file:get_cwd(), Cwd.
 exec(Cmd, Opts) -> os:cmd([Cmd," ",string:join(Opts," ")]).
 
--spec home() -> directory().
 home() -> {ok, [[H|_]]} = init:get_argument(home), H.
 
--spec consult(file:name_all()) -> [term()].
 consult(File) ->
     AbsFile = filename:absname(File),
     case file:consult(AbsFile) of
@@ -21,26 +16,17 @@ consult(File) ->
             []
     end.
 
--spec src(directory()) -> directory().
 src(Dir) -> filename:join(Dir, "src").
-
--spec include(directory()) -> directory().
 include(Dir) -> filename:join(Dir, "include").
-
--spec ebin(directory()) -> directory().
 ebin(Dir) -> filename:join(Dir, "ebin").
-
--spec deps(file:name_all()) -> [term()].
 deps(File) -> get_value(deps, consult(File), []).
 
--spec get_value(term(), [{term(), term()}], Default) -> term() | Default.
 get_value(Key, Opts, Default) ->
     case lists:keyfind(Key, 1, Opts) of
         {Key, Value} ->
             Value;
         _ -> Default end.
 
--spec script(file:name(), [term()]) -> [term()].
 script(ConfigFile, Conf) ->
     File = ConfigFile ++ ".script",
     Filename = filename:basename(File),
@@ -50,11 +36,9 @@ script(ConfigFile, Conf) ->
         {error, _} -> Conf
     end.
 
--spec sub_dirs(directory(), file:filename(), [term()]) -> [directory()].
 sub_dirs(Cwd, ConfigFile, Conf) ->
     sub_dirs(Cwd, ConfigFile, get_value(sub_dirs, Conf, []), []).
 
--spec sub_dirs(directory(), file:filename(), [term()], [term()]) -> [directory()].
 sub_dirs(_, _, [], Acc) -> Acc;
 sub_dirs(Cwd, ConfigFile, [Dir|T], Acc) ->
     SubDir = filename:join(Cwd, Dir),
@@ -65,16 +49,13 @@ sub_dirs(Cwd, ConfigFile, [Dir|T], Acc) ->
                     Acc ++ [SubDir]),
     sub_dirs(Cwd, ConfigFile, T, Acc1).
 
--spec lib_dirs(directory(), [term()]) -> [directory()].
 lib_dirs(Cwd, Conf) -> lib_dirs(Cwd, get_value(lib_dirs, Conf, []), []).
 
--spec lib_dirs(directory(), [term()], [term()]) -> [directory()].
 lib_dirs(_, [], Acc) -> Acc;
 lib_dirs(Cwd, [H|T], Acc) ->
     Dirs = filelib:wildcard(filename:join([Cwd, H, "*", "ebin"])),
     lib_dirs(Cwd, T, Acc ++ Dirs).
 
--spec last_modified(file:name_all()) -> Seconds :: non_neg_integer().
 last_modified(File) ->
     case filelib:last_modified(File) of
         0 -> 0;