diff options
author | Björn-Egil Dahlberg <psyeugenic@gmail.com> | 2010-12-02 12:24:18 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <psyeugenic@gmail.com> | 2010-12-02 12:24:26 +0100 |
commit | 4c24c029fbd5263e3dc0ce0d4a23574a05c9bbc3 (patch) | |
tree | 7bef76c162b15eb26447236f1fc323fe3b0a39dc /lib/dialyzer/src/dialyzer.erl | |
parent | 13338198802371d70ca40686d2998861b45edcc4 (diff) | |
parent | f1d81c87d832c805a90a8dceca247cecaad803ab (diff) | |
download | otp-4c24c029fbd5263e3dc0ce0d4a23574a05c9bbc3.tar.gz otp-4c24c029fbd5263e3dc0ce0d4a23574a05c9bbc3.tar.bz2 otp-4c24c029fbd5263e3dc0ce0d4a23574a05c9bbc3.zip |
Merge branch 'ks/dialyzer/support-multiple-plts' into dev
* ks/dialyzer/support-multiple-plts:
dialyzer: Add support for multiple PLTs
OTP-8962
Diffstat (limited to 'lib/dialyzer/src/dialyzer.erl')
-rw-r--r-- | lib/dialyzer/src/dialyzer.erl | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/dialyzer/src/dialyzer.erl b/lib/dialyzer/src/dialyzer.erl index b4161ea194..471f9fccd2 100644 --- a/lib/dialyzer/src/dialyzer.erl +++ b/lib/dialyzer/src/dialyzer.erl @@ -106,27 +106,35 @@ cl_print_plt_info(Opts) -> end, doit(F). -print_plt_info(#options{init_plt = PLT, output_file = OutputFile}) -> +print_plt_info(#options{init_plts = PLTs, output_file = OutputFile}) -> + PLTInfo = get_plt_info(PLTs), + do_print_plt_info(PLTInfo, OutputFile). + +get_plt_info([PLT|PLTs]) -> String = case dialyzer_plt:included_files(PLT) of {ok, Files} -> - io_lib:format("The PLT ~s includes the following files:\n~p\n", + io_lib:format("The PLT ~s includes the following files:\n~p\n\n", [PLT, Files]); {error, read_error} -> - Msg = io_lib:format("Could not read the PLT file ~p\n", [PLT]), + Msg = io_lib:format("Could not read the PLT file ~p\n\n", [PLT]), throw({dialyzer_error, Msg}); {error, no_such_file} -> - Msg = io_lib:format("The PLT file ~p does not exist\n", [PLT]), + Msg = io_lib:format("The PLT file ~p does not exist\n\n", [PLT]), throw({dialyzer_error, Msg}) end, + String ++ get_plt_info(PLTs); +get_plt_info([]) -> "". + +do_print_plt_info(PLTInfo, OutputFile) -> case OutputFile =:= none of true -> - io:format("~s", [String]), + io:format("~s", [PLTInfo]), ?RET_NOTHING_SUSPICIOUS; false -> case file:open(OutputFile, [write]) of {ok, FileDesc} -> - io:format(FileDesc, "~s", [String]), + io:format(FileDesc, "~s", [PLTInfo]), ok = file:close(FileDesc), ?RET_NOTHING_SUSPICIOUS; {error, Reason} -> |