-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathupdate-codegen.sh
executable file
·39 lines (28 loc) · 1.4 KB
/
update-codegen.sh
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
#!/usr/bin/env bash
# Copyright 2020 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0
set -o errexit
set -o nounset
set -o pipefail
source $(dirname $0)/../vendor/knative.dev/hack/codegen-library.sh
# If we run with -mod=vendor here, then generate-groups.sh looks for vendor files in the wrong place.
export GOFLAGS=-mod=
echo "=== Update Codegen for $MODULE_NAME"
group "Kubernetes Codegen"
# generate the code with:
# --output-base because this script should also be able to run inside the vendor dir of
# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir
# instead of the $GOPATH directly. For normal projects this can be dropped.
${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \
github.com/vmware-tanzu/sources-for-knative/pkg/client github.com/vmware-tanzu/sources-for-knative/pkg/apis \
"sources:v1alpha1" \
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt
group "Knative Codegen"
# Knative Injection
${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh "injection" \
github.com/vmware-tanzu/sources-for-knative/pkg/client github.com/vmware-tanzu/sources-for-knative/pkg/apis \
"sources:v1alpha1" \
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt
group "Update deps post-codegen"
# Make sure our dependencies are up-to-date
${REPO_ROOT_DIR}/hack/update-deps.sh