Skip to content

Commit

Permalink
Merge pull request #218 from vcozzolino/feature-improve-codegen
Browse files Browse the repository at this point in the history
Improve update-codegen.sh to copy generated files into SEDNA_ROOT.
  • Loading branch information
kubeedge-bot authored Oct 26, 2021
2 parents ed4756c + ea2f333 commit fa6df45
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,17 @@ ${SEDNA_ROOT}/hack/generate-groups.sh "deepcopy,client,informer,lister" \
${SEDNA_GO_PACKAGE}/pkg/client ${SEDNA_GO_PACKAGE}/pkg/apis \
"sedna:v1alpha1" \
--go-header-file ${SEDNA_ROOT}/hack/boilerplate/boilerplate.generatego.txt

# Check if Sedna home is different from the standard directory where GO projects are located
if ! [[ "${GOPATH}/src/${SEDNA_GO_PACKAGE}/" -ef "${SEDNA_ROOT}/" ]]; then
# Copy generated code into SEDNA_ROOT
echo "Warning: ${SEDNA_ROOT} not included in $GOPATH which is required by code-gen"
echo "Moving generated code from ${GOPATH}/src/${SEDNA_GO_PACKAGE}/pkg/ to ${SEDNA_ROOT}/"
rsync -a ${GOPATH}/src/${SEDNA_GO_PACKAGE}/pkg/{client,apis} ${SEDNA_ROOT}/pkg
if [ $? -eq 0 ]; then
echo "Copy successful!"
rm -rf ${GOPATH}/src/${SEDNA_GO_PACKAGE}/pkg/{client,apis}
else
echo "Error during copy of the generated code!" >&2
fi
fi

0 comments on commit fa6df45

Please sign in to comment.