Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
Adjust the makefile to support autogenerating content with 1.14 go mo…
Browse files Browse the repository at this point in the history
…dules
  • Loading branch information
luxas committed Apr 10, 2020
1 parent 941873e commit ae5c7d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ go-in-docker: # Do not use directly -- use $(GO_MAKE_TARGET)
-v $(shell pwd):/go/src/${PROJECT} \
-w /go/src/${PROJECT} \
-u $(shell id -u):$(shell id -g) \
-e GO111MODULE=on \
-e GOARCH=$(GOARCH) \
golang:$(GO_VERSION) \
$(COMMAND)
Expand Down Expand Up @@ -201,12 +200,15 @@ api-doc:
--to gfm \
bin/tmp/${GROUP_VERSION}.md > docs/api/${GROUP_VERSION}.md

autogen: api-docs
autogen:
$(MAKE) go-make TARGETS="go-autogen"

go-autogen: /go/bin/deepcopy-gen /go/bin/defaulter-gen /go/bin/conversion-gen /go/bin/openapi-gen
# Let the boilerplate be empty
touch /tmp/boilerplate
# Need to do this, otherwise go mod thinks the state is dirty (for some reason)
go mod vendor

/go/bin/deepcopy-gen \
--input-dirs ${API_DIRS} \
--bounding-dirs ${APIS_DIR} \
Expand All @@ -228,12 +230,15 @@ go-autogen: /go/bin/deepcopy-gen /go/bin/defaulter-gen /go/bin/conversion-gen /g
--output-package ${PROJECT}/pkg/openapi \
--report-filename pkg/openapi/violations.txt \
-h /tmp/boilerplate

# These commands modify the env a bit, clean up after us too
$(MAKE) tidy

/go/bin/%: vendor
go install k8s.io/code-generator/cmd/$*
/go/bin/deepcopy-gen /go/bin/defaulter-gen /go/bin/conversion-gen: /go/bin/%: vendor
go get k8s.io/code-generator/cmd/$*

/go/bin/openapi-gen:
go install k8s.io/kube-openapi/cmd/openapi-gen
go get k8s.io/kube-openapi/cmd/openapi-gen

godoc2md: bin/cache/go/bin/godoc2md
bin/cache/go/bin/godoc2md:
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20191216052735-49a3e744a425 h1:VvQyQJN0tSuecqgcIxMWnnfG5kSmgy9KZR9sW3W5QeA=
golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
Expand Down

0 comments on commit ae5c7d0

Please sign in to comment.