-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.codegen
39 lines (31 loc) · 1.19 KB
/
Makefile.codegen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
CLIENTSET_GENERATOR_VERSION := kubernetes-1.19.2
# Generate go code using generate directives in files and kubernetes code generation
# Anything generated by this target should be checked in
generate: ## Generate the Go code (crds, mocks, openapi, client)
./hack/update-codegen.sh
@$(MAKE) fmt
@$(MAKE) importfmt
@echo "Generation complete"
install-refdocs:
$(GO) get github.com/jenkins-x/gen-crd-api-reference-docs
generate-refdocs: generate-api-refdocs
generate-api-refdocs: install-refdocs
${GOPATH}/bin/gen-crd-api-reference-docs -config "hack/refdocs/config.json" \
-template-dir hack/refdocs/templates \
-api-dir "./pkg/apis/chart" \
-out-file docs/apidocs.md
stash:
# Making sure repo has no outstanding changes
git stash
# Verifies that generated code is in sync with implementation
verify-generation-complete: stash generate ## Verify the generated code is up to date
$(eval CHANGED = $(shell git ls-files --modified --others --exclude-standard))
@if [ "$(CHANGED)" == "" ]; \
then \
echo "All generated files up to date"; \
else \
echo "Code generation is out of date"; \
echo "$(CHANGED)"; \
git diff; \
exit 1; \
fi