Skip to content

Commit

Permalink
Avoid duplication in do-dialyzer.
Browse files Browse the repository at this point in the history
CMake finally supports being able to echo commands before running
them. This requires cmake 3.15. We do require it in some other
components already, so there shouldn't be any negative effects.

Change-Id: I98ea1306fdba9fcc5497830a3e838b301ef70bce
Reviewed-on: https://review.couchbase.org/c/ns_server/+/166212
Tested-by: Aliaksey Artamonau <aliaksey.artamonau@couchbase.com>
Reviewed-by: Timofey Barmin <timofey.barmin@couchbase.com>
  • Loading branch information
aartamonau authored and Aliaksey Artamonau committed Nov 25, 2021
1 parent 0584804 commit 892d34b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 28 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
@@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED (VERSION 3.13)
CMAKE_MINIMUM_REQUIRED (VERSION 3.15)

PROJECT (ns_server)
INCLUDE (FindCouchbaseErlang)
Expand Down
31 changes: 4 additions & 27 deletions cmake_modules/do-dialyzer.cmake
Expand Up @@ -3,25 +3,9 @@ GET_FILENAME_COMPONENT (_couchdb_bin_dir "${COUCHDB_BIN_DIR}" REALPATH)

IF (NOT EXISTS "${COUCHBASE_PLT}")
MESSAGE ("Generating ${COUCHBASE_PLT}...")
EXECUTE_PROCESS (COMMAND "${CMAKE_COMMAND}" -E echo
"${DIALYZER_EXECUTABLE}" --output_plt "${COUCHBASE_PLT}" --build_plt
--apps compiler crypto erts inets kernel os_mon sasl ssl stdlib xmerl eldap
public_key
${_couchdb_bin_dir}/src/couchdb
${_couchdb_bin_dir}/src/couch_set_view
${_couchdb_bin_dir}/src/couch_view_parser
${_couchdb_bin_dir}/src/couch_index_merger
${_couchdb_bin_dir}/src/mapreduce
${_couchdb_bin_dir}/src/mochiweb
${_couchdb_bin_dir}/src/snappy
${_couchdb_bin_dir}/src/etap
${_couchdb_bin_dir}/src/lhttpc
${_couchdb_bin_dir}/src/erlang-oauth
${_couchdb_bin_dir}/src/ejson
deps/gen_smtp
deps/chronicle)

EXECUTE_PROCESS (COMMAND "${DIALYZER_EXECUTABLE}" --output_plt "${COUCHBASE_PLT}" --build_plt
EXECUTE_PROCESS (
COMMAND_ECHO STDOUT
COMMAND "${DIALYZER_EXECUTABLE}" --output_plt "${COUCHBASE_PLT}" --build_plt
--apps compiler crypto erts inets kernel os_mon sasl ssl stdlib xmerl eldap
public_key
${_couchdb_bin_dir}/src/couchdb
Expand All @@ -46,15 +30,8 @@ STRING (REGEX REPLACE "ebin/(couch_api_wrap(_httpc)?).beam\;?" "" beamfiles "${b
FILE (GLOB couchdb_beamfiles RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" deps/ns_couchdb/ebin/*.beam)
STRING (REGEX REPLACE "deps/ns_couchdb/ebin/couch_log.beam\;?" "" couchdb_beamfiles "${couchdb_beamfiles}")

# If you update the dialyzer command, please also update this echo
# command so it displays what is invoked. Yes, this is annoying.
EXECUTE_PROCESS (COMMAND "${CMAKE_COMMAND}" -E echo
"${DIALYZER_EXECUTABLE}" --plt "${COUCHBASE_PLT}" ${DIALYZER_FLAGS}
--apps ${beamfiles}
deps/ale/ebin
deps/ns_babysitter/ebin
${couchdb_beamfiles})
EXECUTE_PROCESS (RESULT_VARIABLE _failure
COMMAND_ECHO STDOUT
COMMAND "${DIALYZER_EXECUTABLE}" --plt "${COUCHBASE_PLT}" ${DIALYZER_FLAGS}
--apps ${beamfiles}
deps/ale/ebin
Expand Down

0 comments on commit 892d34b

Please sign in to comment.