Skip to content

Commit

Permalink
[Chore](thrift) generate thrift java code to make code analysis work …
Browse files Browse the repository at this point in the history
…well (apache#18793)

generate thrift java code to make code analysis work well
  • Loading branch information
BiteTheDDDDt authored and Reminiscent committed May 15, 2023
1 parent 38133dc commit 55853c6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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*/
Expand Down Expand Up @@ -101,3 +103,4 @@ lru_cache_test

/conf/log4j2-spring.xml
/fe/fe-core/src/test/resources/real-help-resource.zip
/ui/dist
3 changes: 3 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=''
Expand Down
4 changes: 4 additions & 0 deletions fe/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
6 changes: 6 additions & 0 deletions gensrc/thrift/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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} $<

0 comments on commit 55853c6

Please sign in to comment.