You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by be...@apache.org on 2014/02/13 17:43:23 UTC

[21/50] lager commit: updated refs/heads/import-master to da4419e

Rework how dialyzer PLTs are built and used

This commit splits the PLTs into 2, one for all the required OTP
applications that are in the stdlib, and the other for the rebar
dependancies. Each one is created if it does not exist, then checked for
validity and then --add_to_plt is used to add any missing files (this is
very fast if nothing needs to be added). Then the application is
dialyzed using both PLTs.

The 'combo' PLT which resides in ~ is intended to be used by all of
Riak's deps, so it can grow to cover the set of OTP applications that
Riak depends on. Each project can only specify the ones it cares about.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-lager/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-lager/commit/c41ec3ed
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-lager/tree/c41ec3ed
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-lager/diff/c41ec3ed

Branch: refs/heads/import-master
Commit: c41ec3ede054c693af344c0c8ad68953755ae7de
Parents: 2a2d5f9
Author: Andrew Thompson <an...@hijacked.us>
Authored: Tue Jan 14 13:11:36 2014 -0500
Committer: Andrew Thompson <an...@hijacked.us>
Committed: Tue Jan 14 14:55:15 2014 -0500

----------------------------------------------------------------------
 Makefile | 43 ++++++++++++++++++++++++-------------------
 1 file changed, 24 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-lager/blob/c41ec3ed/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index 6b78d1a..594e97f 100644
--- a/Makefile
+++ b/Makefile
@@ -24,30 +24,35 @@ test:
 docs:
 	./rebar doc
 
-APPS = kernel stdlib sasl erts ssl tools os_mon runtime_tools crypto inets \
-	xmerl webtool snmp public_key mnesia eunit
+APPS = kernel stdlib erts sasl eunit syntax_tools compiler crypto
 PLT ?= $(HOME)/.riak_combo_dialyzer_plt
-
-check_plt: compile
-	dialyzer --check_plt --plt $(PLT) --apps $(APPS)
-
-build_plt: compile
-	dialyzer --build_plt --output_plt $(PLT) --apps $(APPS)
-
-dialyzer: compile
-	@echo
-	@echo Use "'make check_plt'" to check PLT prior to using this target.
-	@echo Use "'make build_plt'" to build PLT prior to using this target.
-	@echo
-	@sleep 1
-	dialyzer -Wunmatched_returns --plt $(PLT) ebin | \
-	    fgrep -v -f ./dialyzer.ignore-warnings
+LOCAL_PLT = .lager_combo_dialyzer_plt
+
+${PLT}: compile
+ifneq (,$(wildcard $(PLT)))
+	dialyzer --check_plt --plt $(PLT) --apps $(APPS) && \
+		dialyzer --add_to_plt --plt $(PLT) --output_plt $(PLT) --apps $(APPS) ; test $$? -ne 1
+else
+	dialyzer --build_plt --output_plt $(PLT) --apps $(APPS); test $$? -ne 1
+endif
+
+${LOCAL_PLT}: compile
+ifneq (,$(wildcard $(LOCAL_PLT)))
+	dialyzer --check_plt --plt $(LOCAL_PLT) deps/*/ebin  && \
+		dialyzer --add_to_plt --plt $(LOCAL_PLT) --output_plt $(LOCAL_PLT) deps/*/ebin ; test $$? -ne 1
+else
+	dialyzer --build_plt --output_plt $(LOCAL_PLT) deps/*/ebin ; test $$? -ne 1
+endif
+
+dialyzer: ${PLT} ${LOCAL_PLT}
+	dialyzer -Wunmatched_returns --plts $(PLT) $(LOCAL_PLT) -c ebin
 
 cleanplt:
 	@echo 
-	@echo "Are you sure?  It takes about 1/2 hour to re-build."
-	@echo Deleting $(PLT) in 5 seconds.
+	@echo "Are you sure?  It takes several minutes to re-build."
+	@echo Deleting $(PLT) and $(LOCAL_PLT) in 5 seconds.
 	@echo 
 	sleep 5
 	rm $(PLT)
+	rm $(LOCAL_PLT)