Merge pull request #620 from tuncer/travis-dialyze

Travis dialyze
diff --git a/.travis.yml b/.travis.yml
index dcb6606..8be6814 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -11,9 +11,27 @@
   - 17.0
   - 18.0
   - 19.1
-  - 20.0.4
+  - 20.0.5
+  - 20.1.5
+env: MAKE_TARGET=ci
 before_script:
   - hostname -f
   - cc -v
   - ld -v
-script: "make travis"
+  - find .rebar
+after_script:
+  - find .rebar
+matrix:
+  include:
+    - otp_release: 20.1.5
+      env: MAKE_TARGET=ci-dialyze
+  allow_failures:
+    - otp_release: 20.1.5
+      env: MAKE_TARGET=ci-dialyze
+script: make $MAKE_TARGET
+cache:
+  directories:
+    - .rebar
+before_cache:
+  - rm -fv .rebar/erlcinfo
+  - rm -fv $HOME/.cache/.rebar/erlcinfo
diff --git a/Makefile b/Makefile
index d0d16f8..106e289 100644
--- a/Makefile
+++ b/Makefile
@@ -22,11 +22,11 @@
 xref:
 	@./rebar xref
 
-build_plt:
-	@./rebar build-plt
+maybe_build_plt:
+	@./rebar -vv check-plt || ./rebar -vv build-plt
 
-dialyzer:
-	@./rebar dialyze
+dialyze: maybe_build_plt
+	@./rebar -vv dialyze
 
 binary: VSN = $(shell ./rebar -V)
 binary: clean all
@@ -45,4 +45,6 @@
 test_inttest: all deps
 	@$(RETEST) -l $(LOG_LEVEL) $(RT_TARGETS)
 
-travis: clean debug xref clean all deps test
+ci: clean debug xref clean all deps test
+
+ci-dialyze: clean debug dialyze
diff --git a/src/rebar_cover_utils.erl b/src/rebar_cover_utils.erl
index 3fcba63..7b85f1c 100644
--- a/src/rebar_cover_utils.erl
+++ b/src/rebar_cover_utils.erl
@@ -35,6 +35,8 @@
 
 -include("rebar.hrl").
 
+-dialyzer({no_opaque, has_header/2}).
+
 %% ====================================================================
 %% Internal functions
 %% ====================================================================
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index a5cc0ff..6a62d34 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -296,7 +296,7 @@
             VsnString = vcs_vsn_1(Vsn, Dir),
             Cache1 = dict:store(Key, VsnString, Cache),
             Config1 = rebar_config:set_xconf(Config, vsn_cache, Cache1),
-            save_vsn_cache(Config1),
+            _ = save_vsn_cache(Config1),
             {Config1, VsnString};
         {ok, VsnString} ->
             {Config, VsnString}
diff --git a/src/rebar_xref.erl b/src/rebar_xref.erl
index ee3414d..ddfb029 100644
--- a/src/rebar_xref.erl
+++ b/src/rebar_xref.erl
@@ -40,6 +40,8 @@
 %% for internal use only
 -export([info/2]).
 
+-dialyzer({no_opaque, find_function_source/4}).
+
 %% ===================================================================
 %% Public API
 %% ===================================================================