Codegen subprojects: reify 'all' into explicit

This commit is contained in:
Tim Hockin 2023-03-10 21:27:44 -08:00
parent 201653aa87
commit 5200f4b0d3
No known key found for this signature in database
4 changed files with 8 additions and 8 deletions

View File

@ -25,7 +25,7 @@ CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-
# --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" all \
"${CODEGEN_PKG}/generate-groups.sh" "applyconfiguration,client,deepcopy,informer,lister" \
k8s.io/apiextensions-apiserver/examples/client-go/pkg/client \
k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis \
cr:v1 \

View File

@ -25,7 +25,7 @@ if [ "$#" -lt 4 ] || [ "${1}" == "--help" ]; then
cat <<EOF
Usage: $(basename "$0") <generators> <output-package> <apis-package> <groups-versions> ...
<generators> the generators comma separated to run (deepcopy,defaulter,applyconfiguration,client,lister,informer) or "all".
<generators> the generators comma separated to run (deepcopy,applyconfiguration,client,lister,informer) or "all".
<output-package> the output package name (e.g. github.com/example/project/pkg/generated).
<apis-package> the external types dir (e.g. github.com/example/api or github.com/example/project/pkg/apis).
<groups-versions> the groups and their versions in the format "groupA:v1,v2 groupB:v1 groupC:v2", relative
@ -50,7 +50,7 @@ shift 4
# To support running this script from anywhere, first cd into this directory,
# and then install with forced module mode on and fully qualified name.
cd "$(dirname "${0}")"
GO111MODULE=on go install k8s.io/code-generator/cmd/{applyconfiguration-gen,defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen}
GO111MODULE=on go install k8s.io/code-generator/cmd/{applyconfiguration-gen,client-gen,lister-gen,informer-gen,deepcopy-gen}
)
# Go installs the above commands to get installed in $GOBIN if defined, and $GOPATH/bin otherwise:
GOBIN="$(go env GOBIN)"

View File

@ -24,26 +24,26 @@ SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
# - --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.
"${SCRIPT_ROOT}/generate-internal-groups.sh" all \
"${SCRIPT_ROOT}/generate-internal-groups.sh" "client,conversion,deepcopy,defaulter,informer,lister,openapi" \
k8s.io/code-generator/examples/apiserver \
k8s.io/code-generator/examples/apiserver/apis \
k8s.io/code-generator/examples/apiserver/apis \
"example:v1 example2:v1 example3.io:v1" \
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
--go-header-file "${SCRIPT_ROOT}/hack/boilerplate.go.txt"
"${SCRIPT_ROOT}/generate-groups.sh" all \
"${SCRIPT_ROOT}/generate-groups.sh" "applyconfiguration,client,deepcopy,informer,lister" \
k8s.io/code-generator/examples/crd \
k8s.io/code-generator/examples/crd/apis \
"example:v1 example2:v1" \
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
--go-header-file "${SCRIPT_ROOT}/hack/boilerplate.go.txt"
"${SCRIPT_ROOT}/generate-groups.sh" all \
"${SCRIPT_ROOT}/generate-groups.sh" "applyconfiguration,client,deepcopy,informer,lister" \
k8s.io/code-generator/examples/MixedCase \
k8s.io/code-generator/examples/MixedCase/apis \
"example:v1" \
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
--go-header-file "${SCRIPT_ROOT}/hack/boilerplate.go.txt"
"${SCRIPT_ROOT}/generate-groups.sh" all \
"${SCRIPT_ROOT}/generate-groups.sh" "applyconfiguration,client,deepcopy,informer,lister" \
k8s.io/code-generator/examples/HyphenGroup \
k8s.io/code-generator/examples/HyphenGroup/apis \
"example:v1" \

View File

@ -25,7 +25,7 @@ CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-
# --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" all \
"${CODEGEN_PKG}/generate-groups.sh" "applyconfiguration,client,deepcopy,informer,lister" \
k8s.io/sample-apiserver/pkg/generated \
k8s.io/sample-apiserver/pkg/apis \
"wardle:v1alpha1,v1beta1" \