Skip to content

Commit

Permalink
Merge pull request crossplane-contrib#1472 from chlunde/code-gen-sdk-…
Browse files Browse the repository at this point in the history
…version

Run AWS ACK code-generator with go.mod --aws-sdk-go-version
  • Loading branch information
chlunde authored Oct 11, 2022
2 parents 1f4a882 + 7859293 commit 131f735
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,19 @@ run: go.build

.PHONY: cobertura manifests submodules fallthrough test-integration run crds.clean

AWS_SDK_GO_VERSION ?= $(shell awk '/github.com\/aws\/aws-sdk-go / { print $$2 }' < go.mod)

# NOTE(muvaf): ACK Code Generator is a separate Go module, hence we need to
# be in its root directory to call "go run" properly.
services: $(GOIMPORTS)
@if [ ! -d "$(WORK_DIR)/code-generator" ]; then \
cd $(WORK_DIR) && git clone "$(CODE_GENERATOR_REPO)"; \
fi
@cd $(WORK_DIR)/code-generator && git fetch origin && git checkout $(CODE_GENERATOR_COMMIT)
@cd $(WORK_DIR)/code-generator && git fetch origin && git checkout $(CODE_GENERATOR_COMMIT) && go build -tags codegen -o ack-generate cmd/ack-generate/main.go
@for svc in $(SERVICES); do \
$(INFO) Generating $$svc controllers and CRDs; \
PATH="${PATH}:$(TOOLS_HOST_DIR)"; \
cd $(WORK_DIR)/code-generator && go run -tags codegen cmd/ack-generate/main.go crossplane $$svc --output ../../ || exit 1; \
cd $(WORK_DIR)/code-generator && ./ack-generate crossplane --aws-sdk-go-version $(AWS_SDK_GO_VERSION) $$svc --output ../../ || exit 1; \
$(OK) Generating $$svc controllers and CRDs; \
done

Expand Down

0 comments on commit 131f735

Please sign in to comment.