diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 1d116aff..93a883e7 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -18,22 +18,14 @@ 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 +echo "=== Update Codegen for $MODULE_NAME" -source $(dirname $0)/../vendor/knative.dev/hack/library.sh - -CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${REPO_ROOT_DIR}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)} - -KNATIVE_CODEGEN_PKG=${KNATIVE_CODEGEN_PKG:-$(cd ${REPO_ROOT_DIR}; ls -d -1 ./vendor/knative.dev/pkg 2>/dev/null || echo ../pkg)} - -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 @@ -44,11 +36,15 @@ ${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \ "caching: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" \ knative.dev/caching/pkg/client knative.dev/caching/pkg/apis \ "caching: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