From dcf15af7b632dfcdd8d39acc8937bb2fe85c6e72 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Tue, 14 Aug 2018 20:33:10 +0200 Subject: [PATCH] Build dub from source on the auto-tester --- posix.mak | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/posix.mak b/posix.mak index 16b6ff1b64d..7dcd01fb4b3 100644 --- a/posix.mak +++ b/posix.mak @@ -518,7 +518,7 @@ build-html: ################################################################################ ${TOOLS_DIR}: - git clone --depth=1 ${GIT_HOME}/$(@F) $@ + [ -d $@ ] || git clone --depth=1 ${GIT_HOME}/$(@F) $@ $(TOOLS_DIR)/checkwhitespace.d: | $(TOOLS_DIR) $(TOOLS_DIR)/tests_extractor.d: | $(TOOLS_DIR) @@ -601,13 +601,27 @@ style_lint: dscanner $(LIB) @echo "Check that Ddoc runs without errors" $(DMD) $(DFLAGS) $(NODEFAULTLIB) $(LIB) -w -D -Df/dev/null -main -c -o- $$(find etc std -type f -name '*.d') 2>&1 +################################################################################ +# Build dub from source if no dub is available +################################################################################ + +DUB_PATH=$(abspath $(shell which $(DUB))) +ifeq (,$(DUB_PATH)) + DUB_PATH=$(ROOT)/dub/bin/dub + DUB=$(DUB_PATH) +endif + +$(DUB): | $(LIB) + [ -d $(ROOT)/dub ] || git clone --depth=1 ${GIT_HOME}/dub $(ROOT)/dub + cd $(ROOT)/dub && ls && DFLAGS="$(DFLAGS) $(LIB) $(NODEFAULTLIB) $(LINKDL)" DMD=$(shell pwd)/$(DMD) ./build.sh + ################################################################################ # Build the test extractor. # - extracts and runs public unittest examples to checks for missing imports # - extracts and runs @betterC unittests ################################################################################ -$(TESTS_EXTRACTOR): $(TOOLS_DIR)/tests_extractor.d | $(LIB) +$(TESTS_EXTRACTOR): $(TOOLS_DIR)/tests_extractor.d | $(DUB) $(LIB) DFLAGS="$(DFLAGS) $(LIB) $(NODEFAULTLIB) $(LINKDL)" $(DUB) build --force --compiler=$${PWD}/$(DMD) --single $< mv $(TOOLS_DIR)/tests_extractor $@