Skip to content

Commit

Permalink
Fix codegen (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
dtaniwaki authored and VaibhavPage committed Mar 12, 2019
1 parent cb8ebd8 commit 11cd17d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
9 changes: 5 additions & 4 deletions Gopkg.lock

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

9 changes: 9 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ required = [
"k8s.io/code-generator/cmd/openapi-gen",
"k8s.io/code-generator/cmd/go-to-protobuf",
"k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo",
"k8s.io/gengo/examples/deepcopy-gen",
"github.com/golang/protobuf/protoc-gen-go",
"github.com/gogo/protobuf/protoc-gen-gofast",
"github.com/gogo/protobuf/protoc-gen-gogofast",
Expand Down Expand Up @@ -121,6 +122,14 @@ required = [
name = "k8s.io/code-generator"
unused-packages = false

[[prune.project]]
name = "k8s.io/gengo"
unused-packages = false

[[constraint]]
name = "github.com/google/go-github"
version = "21.0.0"

[[constraint]]
name = "k8s.io/gengo"
revision = "b90029ef6cd877cb3f422d75b3a07707e3aac6b7"
6 changes: 3 additions & 3 deletions hack/generate-proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ APIMACHINERY_PKGS=(
k8s.io/apimachinery/pkg/apis/meta/v1
k8s.io/api/core/v1
)
$(go run ${PROJECT_ROOT}/vendor/k8s.io/code-generator/cmd/go-to-protobuf/main.go \

dist/go-to-protobuf \
--logtostderr \
--go-header-file=${PROJECT_ROOT}/hack/custom-boilerplate.go.txt \
--packages=$(IFS=, ; echo "${PACKAGES[*]}") \
--apimachinery-packages=$(IFS=, ; echo "${APIMACHINERY_PKGS[*]}") \
--proto-import=./vendor
)
--proto-import=${PROJECT_ROOT}/vendor

# generate protocol documentation
protoc -I=${GOPATH}/src --doc_out=../docs --doc_opt=markdown,gateway-protocol.md github.com/argoproj/argo-events/pkg/apis/gateway/v1alpha1/generated.proto
Expand Down
9 changes: 5 additions & 4 deletions hack/update-codegen.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,18 @@ set -o errexit
set -o nounset
set -o pipefail

CODEGEN_PKG="../vendor/k8s.io/code-generator/"
SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")/..
CODEGEN_PKG="$SCRIPT_ROOT/vendor/k8s.io/code-generator/"


bash -x ${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \
github.com/argoproj/argo-events/pkg/client/sensor github.com/argoproj/argo-events/pkg/apis \
"sensor:v1alpha1" \
--go-header-file ./custom-boilerplate.go.txt
--go-header-file $SCRIPT_ROOT/hack/custom-boilerplate.go.txt

bash -x ${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \
github.com/argoproj/argo-events/pkg/client/gateway github.com/argoproj/argo-events/pkg/apis \
"gateway:v1alpha1" \
--go-header-file ./custom-boilerplate.go.txt
--go-header-file $SCRIPT_ROOT/hack/custom-boilerplate.go.txt

go run ${GOPATH}/src/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
go run $SCRIPT_ROOT/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 --go-header-file $SCRIPT_ROOT/vendor/k8s.io/gengo/boilerplate/boilerplate.go.txt

0 comments on commit 11cd17d

Please sign in to comment.