Skip to content

Commit 135606b

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

File tree

4 files changed

+54
-48
lines changed

4 files changed

+54
-48
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,9 @@ 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/
9796
echo "done..."

starrocks-thrift-sdk/build-thrift.bat

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
ls
14+
./build-thrift-with-docker.sh
15+
rm -rf thrift
16+
"

starrocks-thrift-sdk/pom.xml

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,40 @@ limitations under the License.
5353
</dependencies>
5454
<build>
5555
<plugins>
56+
<plugin>
57+
<groupId>org.codehaus.mojo</groupId>
58+
<artifactId>exec-maven-plugin</artifactId>
59+
<version>3.1.0</version>
60+
<executions>
61+
<execution>
62+
<phase>generate-sources</phase>
63+
<goals>
64+
<goal>exec</goal>
65+
</goals>
66+
<configuration>
67+
<executable>${basedir}/generate-sources.sh</executable>
68+
</configuration>
69+
</execution>
70+
</executions>
71+
</plugin>
72+
<plugin>
73+
<groupId>org.codehaus.mojo</groupId>
74+
<artifactId>build-helper-maven-plugin</artifactId>
75+
<version>3.3.0</version>
76+
<executions>
77+
<execution>
78+
<phase>generate-sources</phase>
79+
<goals>
80+
<goal>add-source</goal>
81+
</goals>
82+
<configuration>
83+
<sources>
84+
<source>${project.build.directory}/generated-sources/thrift</source>
85+
</sources>
86+
</configuration>
87+
</execution>
88+
</executions>
89+
</plugin>
5690
<plugin>
5791
<groupId>org.apache.maven.plugins</groupId>
5892
<artifactId>maven-shade-plugin</artifactId>
@@ -108,21 +142,6 @@ limitations under the License.
108142
</filesets>
109143
</configuration>
110144
</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>
126145
<plugin>
127146
<groupId>org.apache.maven.plugins</groupId>
128147
<artifactId>maven-source-plugin</artifactId>

0 commit comments

Comments
 (0)