From 6facad88d95b1a058638b6a8c3eee26aac25b423 Mon Sep 17 00:00:00 2001 From: Benoit Pierre Date: Sun, 14 Apr 2024 17:32:33 +0200 Subject: [PATCH] make: speedup `fetchthirdparty` - shallow clone submodules configured as such - on CI, shallow clone all submodules - use 3 jobs --- Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 23c4b0c17..65c8d0281 100644 --- a/Makefile +++ b/Makefile @@ -160,7 +160,18 @@ coverage: $(INSTALL_DIR)/koreader/.luacov fetchthirdparty: git submodule init git submodule sync - git submodule update +ifneq (,$(CI)) + git submodule update --depth 1 --jobs 3 +else + # Force shallow clones of submodules configured as such. + git submodule update --jobs 3 --depth 1 $(shell \ + git config --file=.gitmodules --name-only --get-regexp '^submodule\.[^.]+\.shallow$$' true \ + | sed 's/\.shallow$$/.path/' \ + | xargs -n1 git config --file=.gitmodules \ + ) + # Update the rest. + git submodule update --jobs 3 +endif $(MAKE) -C $(KOR_BASE) fetchthirdparty VERBOSE ?= @