From d548b20ecdc76ebe39b42ed0d7bbbf8f74ffe357 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Fri, 14 Oct 2022 23:37:13 +0300 Subject: [PATCH] Generate the paths file in 'make update' --- makefiles/targets.mk | 6 +++++- scripts/create_nbs_paths.sh | 16 ++++++++++++++++ scripts/env.sh | 12 ------------ 3 files changed, 21 insertions(+), 13 deletions(-) create mode 100755 scripts/create_nbs_paths.sh diff --git a/makefiles/targets.mk b/makefiles/targets.mk index de16dbb..e82045b 100644 --- a/makefiles/targets.mk +++ b/makefiles/targets.mk @@ -57,6 +57,10 @@ warn-jobs: fi; \ fi +nimbus-build-system-paths: + echo "Creating nimbus-build-system.paths"; \ + "$(CURDIR)/$(BUILD_SYSTEM_DIR)/scripts/create_nbs_paths.sh" + deps-common: | sanity-checks warn-update warn-jobs $(NIMBLE_DIR) # - don't build our Nim target if it's not going to be used ifeq ($(USE_SYSTEM_NIM), 0) @@ -99,7 +103,7 @@ update-test: #- deletes the ".nimble" dir and executes the "deps" target #- allows parallel building with the '+' prefix #- rebuilds the Nim compiler if the corresponding submodule is updated -update-common: | sanity-checks update-test +update-common: | sanity-checks update-test nimbus-build-system-paths git submodule foreach --quiet 'git ls-files --exclude-standard --recurse-submodules -z -- ":!:.*" | xargs -0 rm -rf' git submodule update --init --recursive || true # changing URLs in a submodule's submodule means we have to sync and update twice diff --git a/scripts/create_nbs_paths.sh b/scripts/create_nbs_paths.sh new file mode 100755 index 0000000..f463ad4 --- /dev/null +++ b/scripts/create_nbs_paths.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +cd "${ABS_PATH}/../../.." + +echo "--noNimblePath" > nimbus-build-system.paths +for file in $(ls -d $PWD/vendor/*) +do + if uname | grep -qiE "mingw|msys"; then + file=$(cygpath -m $file) + fi + if [ -d "$file/src" ]; then + echo --path:"\"$file/src\"" + else + echo --path:"\"$file\"" + fi +done >> nimbus-build-system.paths diff --git a/scripts/env.sh b/scripts/env.sh index 331d904..9e9b2d1 100755 --- a/scripts/env.sh +++ b/scripts/env.sh @@ -67,18 +67,6 @@ add_submodule() { $EXPORT_FUNC add_submodule export NIMBUS_BUILD_SYSTEM=yes -echo "--noNimblePath" > nimbus-build-system.paths -for file in $(ls -d $PWD/vendor/*) -do - if uname | grep -qiE "mingw|msys"; then - file=$(cygpath -m $file) - fi - if [ -d "$file/src" ]; then - echo --path:"\"$file/src\"" - else - echo --path:"\"$file\"" - fi -done >> nimbus-build-system.paths if [[ $# == 1 && $1 == "bash" ]]; then # the only way to change PS1 in a child shell, apparently