[Chore](thrift) generate thrift java code to make code analysis work well (#18793)

generate thrift java code to make code analysis work well
This commit is contained in:
Pxl
2023-04-19 19:33:17 +08:00
committed by GitHub
parent fb377a9da9
commit c40860aba4
4 changed files with 16 additions and 0 deletions

3
.gitignore vendored
View File

@ -73,6 +73,8 @@ fe/fe-core/gen/
fe/fe-core/src/main/resources/static/
fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisLexer.tokens
fe/fe-core/src/main/antlr4/org/apache/doris/nereids/gen/
fe/fe-core/src/main/java/org/apache/doris/thrift
fe/fe-core/src/main/java/org/apache/parquet
# BE
be/build*/
@ -101,3 +103,4 @@ lru_cache_test
/conf/log4j2-spring.xml
/fe/fe-core/src/test/resources/real-help-resource.zip
/ui/dist

View File

@ -391,6 +391,9 @@ echo "Build generated code"
cd "${DORIS_HOME}/gensrc"
# DO NOT using parallel make(-j) for gensrc
make
rm -rf "${DORIS_HOME}/fe/fe-core/src/main/java/org/apache/doris/thrift ${DORIS_HOME}/fe/fe-core/src/main/java/org/apache/parquet"
cp -r "build/gen_java/org/apache/doris/thrift" "${DORIS_HOME}/fe/fe-core/src/main/java/org/apache/doris"
cp -r "build/gen_java/org/apache/parquet" "${DORIS_HOME}/fe/fe-core/src/main/java/org/apache/"
# Assesmble FE modules
FE_MODULES=''

View File

@ -133,6 +133,10 @@ under the License.
<failsOnError>true</failsOnError>
<linkXRef>false</linkXRef>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<excludes>
**/apache/doris/thrift/*,
**/apache/parquet/**/*
</excludes>
</configuration>
<executions>
<execution>

View File

@ -29,13 +29,19 @@ GEN_OBJECTS = $(patsubst ${BUILD_DIR}/thrift/%.thrift, ${BUILD_DIR}/gen_cpp/%_ty
all: ${GEN_OBJECTS} ${OBJECTS}
.PHONY: all
$(shell mkdir -p ${BUILD_DIR}/gen_java)
THRIFT_CPP_ARGS = -I ${CURDIR} -I ${BUILD_DIR}/thrift/ --gen cpp -out ${BUILD_DIR}/gen_cpp --allow-64bit-consts -strict
THRIFT_JAVA_ARGS = -I ${CURDIR} -I ${BUILD_DIR}/thrift/ --gen java:fullcamel -out ${BUILD_DIR}/gen_java --allow-64bit-consts -strict
${BUILD_DIR}/gen_cpp:
mkdir -p $@
# handwrite thrift
${BUILD_DIR}/gen_cpp/%_types.cpp: ${CURDIR}/%.thrift | ${BUILD_DIR}/gen_cpp
${THRIFT} ${THRIFT_CPP_ARGS} $<
${THRIFT} ${THRIFT_JAVA_ARGS} $<
# generated thrift
${BUILD_DIR}/gen_cpp/%_types.cpp: ${BUILD_DIR}/thrift/%.thrift | ${BUILD_DIR}/gen_cpp
${THRIFT} ${THRIFT_CPP_ARGS} $<
${THRIFT} ${THRIFT_JAVA_ARGS} $<