-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile.codegen
44 lines (36 loc) · 1.42 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
39
40
41
42
43
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-config-refdocs
generate-api-refdocs: install-refdocs
${GOPATH}/bin/gen-crd-api-reference-docs -config "docs/refdocs/config.json" \
-template-dir docs/refdocs/templates \
-api-dir "./pkg/apis/jenkins.io" \
-out-file docs/apidocs.md
generate-config-refdocs:
${GOPATH}/bin/gen-crd-api-reference-docs -config "docs/configdocs/config.json" \
-template-dir docs/configdocs/templates \
-api-dir "./pkg/config" \
-out-file docs/config.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