Browse Source

Merge pull request #218 from vcozzolino/feature-improve-codegen

Improve update-codegen.sh to copy generated files into SEDNA_ROOT.
tags/v0.4.3
KubeEdge Bot GitHub 4 years ago
parent
commit
fa6df45c30
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions
  1. +14
    -0
      hack/update-codegen.sh

+ 14
- 0
hack/update-codegen.sh View File

@@ -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

Loading…
Cancel
Save