Skip to content

Commit

Permalink
[Enhancement] build starrocks-thrift-sdk with docker
Browse files Browse the repository at this point in the history
Signed-off-by: Author kyo-tom <[email protected]>
  • Loading branch information
kyo-tom committed Oct 12, 2024
1 parent 353ab2d commit f418a1e
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,9 @@ if [ ! -f "$TP_INSTALL_DIR/bin/thrift" ]; then
fi

cd $TP_INSTALL_DIR/bin/
TARGET=/starrocks-thrift-sdk/target/generated-sources/thrift
rm -rf $TARGET
mkdir -p $TARGET
./thrift -r -gen java $ROOT/../gensrc/StarrocksExternalService.thrift
if [ ! -d "$ROOT/../src/main/java/com/starrocks/thrift" ]; then
mkdir -p $ROOT/../src/main/java/com/starrocks/thrift
fi
echo $pwd
cp -r gen-java/com/starrocks/thrift/* $ROOT/../src/main/java/com/starrocks/thrift
mv gen-java/com $TARGET/
echo "done..."
28 changes: 0 additions & 28 deletions starrocks-thrift-sdk/build-thrift.bat

This file was deleted.

16 changes: 16 additions & 0 deletions starrocks-thrift-sdk/generate-sources.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -eu

cd "${BASH_SOURCE%/*}/.."

# use unstable for Thrift 0.19.0
docker run -v "${PWD}/starrocks-thrift-sdk:/starrocks-thrift-sdk" --rm debian:unstable /bin/sh -c "\
set -eux
apt-get update -q
apt-get install -q -y wget automake bison flex g++ git libboost-all-dev libevent-dev libssl-dev libtool make pkg-config
cd starrocks-thrift-sdk/
ls
./build-thrift-with-docker.sh
rm -rf thrift
"
49 changes: 34 additions & 15 deletions starrocks-thrift-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,40 @@ limitations under the License.
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${basedir}/generate-sources.sh</executable>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources/thrift</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand Down Expand Up @@ -108,21 +142,6 @@ limitations under the License.
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<outputDirectory>./target/</outputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand Down

0 comments on commit f418a1e

Please sign in to comment.