Skip to content

Commit

Permalink
codegen for 0.21
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Nichols committed Mar 3, 2021
1 parent 0a6ac54 commit 1ee3399
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 21 deletions.
27 changes: 12 additions & 15 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,16 @@ set -o errexit
set -o nounset
set -o pipefail

export GO111MODULE=on
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=

if [ -z "${GOPATH:-}" ]; then
export GOPATH=$(go env GOPATH)
fi

source $(dirname $0)/../vendor/knative.dev/hack/library.sh

REPO_ROOT=$(dirname ${BASH_SOURCE})/..
CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${REPO_ROOT}; ls -d -1 $(dirname $0)/../vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)}
echo "=== Update Codegen for $MODULE_NAME"

KNATIVE_CODEGEN_PKG=${KNATIVE_CODEGEN_PKG:-$(cd ${REPO_ROOT}; ls -d -1 $(dirname $0)/../vendor/knative.dev/pkg 2>/dev/null || echo ../pkg)}
echo "GOPATH=$GOPATH"

chmod +x ${CODEGEN_PKG}/generate-groups.sh
chmod +x ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh
group "Kubernetes Codegen"

# generate the code with:
# --output-base because this script should also be able to run inside the vendor dir of
Expand All @@ -32,13 +25,17 @@ chmod +x ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh
${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}/hack/boilerplate/boilerplate.go.txt
--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}/hack/boilerplate/boilerplate.go.txt
--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}/hack/update-deps.sh
${REPO_ROOT_DIR}/hack/update-deps.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1ee3399

Please sign in to comment.