github.com/argoproj/argo-events@v1.9.1/hack/update-codegen.sh (about) 1 #!/bin/bash 2 3 set -o errexit 4 set -o nounset 5 set -o pipefail 6 7 source $(dirname $0)/library.sh 8 header "running codegen" 9 10 ensure_vendor 11 make_fake_paths 12 13 export GOPATH="${FAKE_GOPATH}" 14 export GO111MODULE="off" 15 16 cd "${FAKE_REPOPATH}" 17 18 CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${FAKE_REPOPATH}"; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)} 19 20 subheader "running codegen for sensor" 21 bash -x ${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \ 22 github.com/argoproj/argo-events/pkg/client/sensor github.com/argoproj/argo-events/pkg/apis \ 23 "sensor:v1alpha1" \ 24 --go-header-file hack/custom-boilerplate.go.txt 25 26 subheader "running codegen for eventsource" 27 bash -x ${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \ 28 github.com/argoproj/argo-events/pkg/client/eventsource github.com/argoproj/argo-events/pkg/apis \ 29 "eventsource:v1alpha1" \ 30 --go-header-file hack/custom-boilerplate.go.txt 31 32 subheader "running codegen for eventbus" 33 bash -x ${CODEGEN_PKG}/generate-groups.sh "deepcopy" \ 34 github.com/argoproj/argo-events/pkg/client/eventbus github.com/argoproj/argo-events/pkg/apis \ 35 "eventbus:v1alpha1" \ 36 --go-header-file hack/custom-boilerplate.go.txt 37 38 bash -x ${CODEGEN_PKG}/generate-groups.sh "client,informer,lister" \ 39 github.com/argoproj/argo-events/pkg/client/eventbus github.com/argoproj/argo-events/pkg/apis \ 40 "eventbus:v1alpha1" \ 41 --plural-exceptions="EventBus:EventBus" \ 42 --go-header-file hack/custom-boilerplate.go.txt 43 44 subheader "running codegen for common" 45 go run $FAKE_REPOPATH/vendor/k8s.io/gengo/examples/deepcopy-gen/main.go -i github.com/argoproj/argo-events/pkg/apis/common -p github.com/argoproj/argo-events/pkg/apis/common \ 46 --go-header-file hack/custom-boilerplate.go.txt 47 48 # gofmt the tree 49 subheader "running gofmt" 50 find . -name "*.go" -type f -print0 | xargs -0 gofmt -s -w 51