mirror of
https://github.com/apache/doris.git
synced 2026-11-04 07:31:17 +00:00
[opt](build) use mvn to compile thrift for fe (#61486)
This commit is contained in:
1 parent
0b5f57f421
commit
eb3be18063
6 files changed
+73
-23
No files matched your search
+37
-1
@@ -26,6 +26,23 @@ under the License.
|
||||
<artifactId>fe</artifactId>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<properties>
|
||||
<doris.thrift.executable>${project.parent.basedir}/../thirdparty/installed/bin/thrift</doris.thrift.executable>
|
||||
<doris.thrift.source>${project.parent.basedir}/../gensrc/thrift</doris.thrift.source>
|
||||
</properties>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>thrift-executable-override</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>env.DORIS_THIRDPARTY</name>
|
||||
</property>
|
||||
</activation>
|
||||
<properties>
|
||||
<doris.thrift.executable>${env.DORIS_THIRDPARTY}/installed/bin/thrift</doris.thrift.executable>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
<artifactId>fe-thrift</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Doris FE Generated Thrift RPC</name>
|
||||
@@ -40,7 +57,7 @@ under the License.
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>doris-fe-catalog</finalName>
|
||||
<finalName>doris-fe-thrift</finalName>
|
||||
<directory>${project.basedir}/target/</directory>
|
||||
<plugins>
|
||||
<!-- Build source jar -->
|
||||
@@ -59,6 +76,25 @@ under the License.
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.thrift</groupId>
|
||||
<artifactId>thrift-maven-plugin</artifactId>
|
||||
<version>0.10.0</version>
|
||||
<configuration>
|
||||
<generator>java:fullcamel</generator>
|
||||
<thriftExecutable>${doris.thrift.executable}</thriftExecutable>
|
||||
<thriftSourceRoot>${doris.thrift.source}</thriftSourceRoot>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>thrift-sources</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
+1
-1
@@ -63,7 +63,7 @@ under the License.
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>doris-fe-catalog</finalName>
|
||||
<finalName>doris-fe-type</finalName>
|
||||
<directory>${project.basedir}/target/</directory>
|
||||
<plugins>
|
||||
<!-- Build source jar -->
|
||||
|
||||
@@ -45,8 +45,6 @@ rm -rf "${DORIS_HOME}/fe/fe-thrift/src/main/java/org/apache/doris/thrift" "${DOR
|
||||
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"
|
||||
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-thrift/src/main/java/org/apache/doris"
|
||||
cp -r "build/gen_java/org/apache/parquet" "${DORIS_HOME}/fe/fe-thrift/src/main/java/org/apache/"
|
||||
cd "${DORIS_HOME}/"
|
||||
echo "Done"
|
||||
exit 0
|
||||
@@ -29,19 +29,10 @@ 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:moveable_types,no_skeleton -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} $<
|
||||
@@ -66,6 +66,8 @@ under the License.
|
||||
</mailingLists>
|
||||
<properties>
|
||||
<doris.home>${basedir}/../../</doris.home>
|
||||
<doris.thrift.executable>${doris.home}/thirdparty/installed/bin/thrift</doris.thrift.executable>
|
||||
<doris.thrift.source>${doris.home}/gensrc/thrift</doris.thrift.source>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
@@ -78,6 +80,19 @@ under the License.
|
||||
<!-- Arrow 18 only supports jdk17 -->
|
||||
<arrow.version>17.0.0</arrow.version>
|
||||
</properties>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>thrift-executable-override</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>env.DORIS_THIRDPARTY</name>
|
||||
</property>
|
||||
</activation>
|
||||
<properties>
|
||||
<doris.thrift.executable>${env.DORIS_THIRDPARTY}/installed/bin/thrift</doris.thrift.executable>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
@@ -157,6 +172,25 @@ under the License.
|
||||
<visitor>true</visitor>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.thrift</groupId>
|
||||
<artifactId>thrift-maven-plugin</artifactId>
|
||||
<version>0.10.0</version>
|
||||
<configuration>
|
||||
<generator>java:fullcamel</generator>
|
||||
<thriftExecutable>${doris.thrift.executable}</thriftExecutable>
|
||||
<thriftSourceRoot>${doris.thrift.source}</thriftSourceRoot>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>thrift-sources</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
+1
-10
@@ -199,15 +199,6 @@ if ! test -f ${RUN_JAR:+${RUN_JAR}}; then
|
||||
return 1
|
||||
}
|
||||
|
||||
# Build generated code
|
||||
cd "${DORIS_HOME}/gensrc/thrift" || { echo "Failed to change directory"; exit 1; }
|
||||
if ! make; then
|
||||
echo "Make command failed in ${DORIS_HOME}/gensrc/thrift"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cp -rf "${DORIS_HOME}/gensrc/build/gen_java/org/apache/doris/thrift" "${FRAMEWORK_APACHE_DIR}/doris/"
|
||||
|
||||
# Navigate to framework directory and build with retry
|
||||
cd "${DORIS_HOME}/regression-test/framework" || { echo "Failed to change directory"; exit 1; }
|
||||
|
||||
@@ -327,4 +318,4 @@ if [[ "${ONLY_COMPILE}" -eq 0 ]]; then
|
||||
-jar ${RUN_JAR:+${RUN_JAR}} \
|
||||
-cf "${CONFIG_FILE}" \
|
||||
${REGRESSION_OPTIONS_PREFIX:+${REGRESSION_OPTIONS_PREFIX}} "$@"
|
||||
fi
|
||||
fi
|
||||
Reference in new issue
Block a user