Skip to content

Commit f42b504

Browse files
committed
[Enhancement] build starrocks-thrift-sdk with docker
Signed-off-by: kyotom <[email protected]>
1 parent 353ab2d commit f42b504

File tree

4 files changed

+57
-48
lines changed

4 files changed

+57
-48
lines changed

starrocks-thrift-sdk/build-thrift.sh renamed to starrocks-thrift-sdk/build-thrift-with-docker.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ if [ ! -f "$TP_INSTALL_DIR/bin/thrift" ]; then
8888
fi
8989

9090
cd $TP_INSTALL_DIR/bin/
91+
TARGET=/starrocks-thrift-sdk/target/generated-sources/thrift
92+
rm -rf $TARGET
93+
mkdir -p $TARGET
9194
./thrift -r -gen java $ROOT/../gensrc/StarrocksExternalService.thrift
92-
if [ ! -d "$ROOT/../src/main/java/com/starrocks/thrift" ]; then
93-
mkdir -p $ROOT/../src/main/java/com/starrocks/thrift
94-
fi
95-
echo $pwd
96-
cp -r gen-java/com/starrocks/thrift/* $ROOT/../src/main/java/com/starrocks/thrift
95+
mv gen-java/com $TARGET/
96+
rm -rf thrift
9797
echo "done..."

starrocks-thrift-sdk/build-thrift.bat

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
set -eu
4+
5+
cd "${BASH_SOURCE%/*}/.."
6+
7+
# use unstable for Thrift 0.19.0
8+
docker run -v "${PWD}/starrocks-thrift-sdk:/starrocks-thrift-sdk" --rm debian:unstable /bin/sh -c "\
9+
set -eux
10+
apt-get update -q
11+
apt-get install -q -y wget automake bison flex g++ git libboost-all-dev libevent-dev libssl-dev libtool make pkg-config
12+
cd /starrocks-thrift-sdk/
13+
./build-thrift-with-docker.sh
14+
"

starrocks-thrift-sdk/pom.xml

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ limitations under the License.
4444
<groupId>com.starrocks</groupId>
4545
<artifactId>starrocks-thrift-sdk</artifactId>
4646
<version>1.0.1</version>
47+
<properties>
48+
<maven.compiler.source>11</maven.compiler.source>
49+
<maven.compiler.target>11</maven.compiler.target>
50+
</properties>
4751
<dependencies>
4852
<dependency>
4953
<groupId>org.apache.thrift</groupId>
@@ -53,6 +57,40 @@ limitations under the License.
5357
</dependencies>
5458
<build>
5559
<plugins>
60+
<plugin>
61+
<groupId>org.codehaus.mojo</groupId>
62+
<artifactId>exec-maven-plugin</artifactId>
63+
<version>3.1.0</version>
64+
<executions>
65+
<execution>
66+
<phase>generate-sources</phase>
67+
<goals>
68+
<goal>exec</goal>
69+
</goals>
70+
<configuration>
71+
<executable>${basedir}/generate-sources.sh</executable>
72+
</configuration>
73+
</execution>
74+
</executions>
75+
</plugin>
76+
<plugin>
77+
<groupId>org.codehaus.mojo</groupId>
78+
<artifactId>build-helper-maven-plugin</artifactId>
79+
<version>3.3.0</version>
80+
<executions>
81+
<execution>
82+
<phase>generate-sources</phase>
83+
<goals>
84+
<goal>add-source</goal>
85+
</goals>
86+
<configuration>
87+
<sources>
88+
<source>${project.build.directory}/generated-sources/thrift</source>
89+
</sources>
90+
</configuration>
91+
</execution>
92+
</executions>
93+
</plugin>
5694
<plugin>
5795
<groupId>org.apache.maven.plugins</groupId>
5896
<artifactId>maven-shade-plugin</artifactId>
@@ -108,21 +146,6 @@ limitations under the License.
108146
</filesets>
109147
</configuration>
110148
</plugin>
111-
<plugin>
112-
<groupId>org.apache.maven.plugins</groupId>
113-
<artifactId>maven-jar-plugin</artifactId>
114-
<executions>
115-
<execution>
116-
<phase>package</phase>
117-
<goals>
118-
<goal>jar</goal>
119-
</goals>
120-
</execution>
121-
</executions>
122-
<configuration>
123-
<outputDirectory>./target/</outputDirectory>
124-
</configuration>
125-
</plugin>
126149
<plugin>
127150
<groupId>org.apache.maven.plugins</groupId>
128151
<artifactId>maven-source-plugin</artifactId>

0 commit comments

Comments
 (0)