Generate the paths file in 'make update'

This commit is contained in:
Zahary Karadjov 2022-10-14 23:37:13 +03:00
parent 5a6f950b6d
commit d548b20ecd
No known key found for this signature in database
GPG Key ID: C1F42EAFF38D570F
3 changed files with 21 additions and 13 deletions

View File

@ -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

16
scripts/create_nbs_paths.sh Executable file
View File

@ -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

View File

@ -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