Skip to content

Commit 30ca20d

Browse files
PuneetPunamiyasavitaashture
authored andcommitted
Update codegn script in hack
Signed-off-by: PuneetPunamiya <[email protected]>
1 parent c6acc1e commit 30ca20d

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

hack/generate-groups.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ fi
4040

4141
GENS="$1"
4242
OUTPUT_PKG="$2"
43+
OUTPUT_PATH=".${OUTPUT_PKG#github.com/openshift-pipelines/manual-approval-gate}"
4344
APIS_PKG="$3"
4445
GROUPS_WITH_VERSIONS="$4"
4546
shift 4
@@ -68,25 +69,26 @@ done
6869

6970
if [ "${GENS}" = "all" ] || grep -qw "deepcopy" <<<"${GENS}"; then
7071
echo "Generating deepcopy funcs for ${GROUPS_WITH_VERSIONS}"
71-
"${PREFIX}/deepcopy-gen" --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" -O zz_generated.deepcopy --bounding-dirs "${APIS_PKG}" "$@"
72+
"${PREFIX}/deepcopy-gen" --output-file zz_generated.deepcopy.go --bounding-dirs "${APIS_PKG}" "$@" $(codegen::join " " "${FQ_APIS[@]}")
7273
fi
7374

7475
if [ "${GENS}" = "all" ] || grep -qw "client" <<<"${GENS}"; then
7576
echo "Generating clientset for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}"
76-
"${PREFIX}/client-gen" --clientset-name "${CLIENTSET_NAME_VERSIONED:-versioned}" --input-base "" --input "$(codegen::join , "${FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" "$@"
77+
"${PREFIX}/client-gen" --clientset-name "${CLIENTSET_NAME_VERSIONED:-versioned}" --input-base "" --input "$(codegen::join , "${FQ_APIS[@]}")" --output-pkg "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" --output-dir "${OUTPUT_PATH}/${CLIENTSET_PKG_NAME:-clientset}" "$@"
7778
fi
7879

7980
if [ "${GENS}" = "all" ] || grep -qw "lister" <<<"${GENS}"; then
8081
echo "Generating listers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/listers"
81-
"${PREFIX}/lister-gen" --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}/listers" "$@"
82+
"${PREFIX}/lister-gen" --output-pkg "${OUTPUT_PKG}/listers" --output-dir "${OUTPUT_PATH}/listers" "$@" $(codegen::join " " "${FQ_APIS[@]}")
8283
fi
8384

8485
if [ "${GENS}" = "all" ] || grep -qw "informer" <<<"${GENS}"; then
8586
echo "Generating informers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/informers"
8687
"${PREFIX}/informer-gen" \
87-
--input-dirs "$(codegen::join , "${FQ_APIS[@]}")" \
8888
--versioned-clientset-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}/${CLIENTSET_NAME_VERSIONED:-versioned}" \
8989
--listers-package "${OUTPUT_PKG}/listers" \
90-
--output-package "${OUTPUT_PKG}/informers" \
90+
--output-pkg "${OUTPUT_PKG}/informers" \
91+
--output-dir "${OUTPUT_PATH}/informers" \
92+
"$@" $(codegen::join " " "${FQ_APIS[@]}")
9193
"$@"
9294
fi

hack/update-codegen.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ bash ${REPO_ROOT_DIR}/hack/generate-groups.sh "deepcopy,client,informer,lister"
4343
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt
4444

4545
${PREFIX}/deepcopy-gen \
46-
-O zz_generated.deepcopy \
46+
--output-file zz_generated.deepcopy.go \
4747
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt \
48-
-i github.com/openshift-pipelines/manual-approval-gate/pkg/apis/approvaltask/v1alpha
48+
github.com/openshift-pipelines/manual-approval-gate/pkg/apis/approvaltask/v1alpha
4949

5050
# Knative Injection
5151
# This generates the knative injection packages for the resource package (v1alpha1).

0 commit comments

Comments
 (0)