From b2122895ffbbfd72c502e69ab3d1c58a399e9b0d Mon Sep 17 00:00:00 2001 From: ffranr Date: Thu, 9 Jan 2025 02:19:02 +0000 Subject: [PATCH] Makefile: enhance `build-itest` target for chantools setup Update the `build-itest` Makefile target, used as a subcommand during `make itest`, to ensure `chantools` is properly set up for integration tests. Additionally, update `.gitignore` to exclude the `chantools` build directory. --- .gitignore | 1 + Makefile | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index 2c177133b..f5951e684 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ cmd/tapd/tapd /itest/lnd-itest /itest/btcd-itest +/itest/chantools /itest/regtest/* /itest/*.log /itest/.backendlogs/* diff --git a/Makefile b/Makefile index b33843957..607229ec4 100644 --- a/Makefile +++ b/Makefile @@ -92,6 +92,15 @@ build: $(GOBUILD) -tags="$(DEV_TAGS)" -o tapcli-debug $(DEV_GCFLAGS) $(DEV_LDFLAGS) $(PKG)/cmd/tapcli build-itest: + @if ! command -v chantools > /dev/null; then \ + $(call print, "Building itest chantools."); \ + rm -rf itest/chantools; \ + git clone --depth 1 --branch v0.13.5 https://github.com/lightninglabs/chantools.git itest/chantools; \ + cd itest/chantools && make install; \ + else \ + $(call print, "Chantools is already installed and available in PATH."); \ + fi + @$(call print, "Building itest btcd.") CGO_ENABLED=0 $(GOBUILD) -tags="integration" -o itest/btcd-itest $(BTCD_PKG)