-
Notifications
You must be signed in to change notification settings - Fork 20
/
Makefile.codegen
43 lines (35 loc) · 1.39 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
# 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) install github.com/jenkins-x/gen-crd-api-reference-docs
generate-refdocs: generate-config-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/jenkins.io/v1" \
-out-file docs/apidocs.md
generate-config-refdocs:
${GOPATH}/bin/gen-crd-api-reference-docs -config "hack/configdocs/config.json" \
-template-dir hack/configdocs/templates \
-api-dir "./pkg/apis/core/v4beta1" \
-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