From 7451c3db2a5de5191f2a36bd66b2622e184adb59 Mon Sep 17 00:00:00 2001 From: hc-github-team-consul-core Date: Wed, 21 Feb 2024 11:49:17 -0500 Subject: [PATCH] Backport of [NET-6741] make: Add target for updating dependencies across all modules into release/1.17.x (#20685) backport of commit 6f0e24cda79b6c395b7424a0389e97afbb36a712 Co-authored-by: Michael Zalimeni --- Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Makefile b/Makefile index 71a6722e96..eb4db2a793 100644 --- a/Makefile +++ b/Makefile @@ -237,6 +237,19 @@ go-mod-tidy/%: @echo "--> Running go mod tidy ($*)" @cd $* && go mod tidy +.PHONY: go-mod-get +go-mod-get: $(foreach mod,$(GO_MODULES),go-mod-get/$(mod)) ## Run go get and go mod tidy in every module for the given dependency + +.PHONY: go-mod-get/% +go-mod-get/%: +ifndef DEP_VERSION + $(error DEP_VERSION is undefined: set this to @, e.g. github.com/hashicorp/go-hclog@v1.5.0) +endif + @echo "--> Running go get ${DEP_VERSION} ($*)" + @cd $* && go get $(DEP_VERSION) + @echo "--> Running go mod tidy ($*)" + @cd $* && go mod tidy + ##@ Checks .PHONY: fmt