Skip to content

Commit 3d795de

Browse files
authored
[chore](build) avoid generating generated code every time (#19813)
When calling generated-source.sh in build.sh, not to remove the gensrc/build dir.
1 parent 3e010bb commit 3d795de

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Usage: $0 <options>
7575
clean_gensrc() {
7676
pushd "${DORIS_HOME}/gensrc"
7777
make clean
78+
rm -rf "${DORIS_HOME}/gensrc/build"
7879
rm -rf "${DORIS_HOME}/fe/fe-common/target"
7980
rm -rf "${DORIS_HOME}/fe/fe-core/target"
8081
popd
@@ -401,7 +402,7 @@ echo "Get params:
401402
if [[ "${CLEAN}" -eq 1 ]]; then
402403
clean_gensrc
403404
fi
404-
"${DORIS_HOME}"/generated-source.sh
405+
"${DORIS_HOME}"/generated-source.sh noclean
405406

406407
# Assesmble FE modules
407408
FE_MODULES=''

generated-source.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,15 @@ export DORIS_HOME="${ROOT}"
3030

3131
echo "Build generated code"
3232
cd "${DORIS_HOME}/gensrc"
33-
rm -rf "${DORIS_HOME}/gensrc/build"
33+
34+
# if calling from build.sh, no need to clean build/ dir.
35+
# it will be removed by using `build.sh --clean`.
36+
# when run this script along, it will always remove the build/ dir.
37+
if [[ "$#" == 0 ]]; then
38+
echo "rm -rf ${DORIS_HOME}/gensrc/build"
39+
rm -rf "${DORIS_HOME}/gensrc/build"
40+
fi
41+
3442
# DO NOT using parallel make(-j) for gensrc
3543
make
3644
rm -rf "${DORIS_HOME}/fe/fe-common/src/main/java/org/apache/doris/thrift ${DORIS_HOME}/fe/fe-common/src/main/java/org/apache/parquet"

0 commit comments

Comments
 (0)