Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] build starrocks-thrift-sdk with docker #389

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ 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/
rm -rf thrift
echo "done..."
28 changes: 0 additions & 28 deletions starrocks-thrift-sdk/build-thrift.bat

This file was deleted.

14 changes: 14 additions & 0 deletions starrocks-thrift-sdk/generate-sources.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/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/
./build-thrift-with-docker.sh
"
53 changes: 38 additions & 15 deletions starrocks-thrift-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ limitations under the License.
<groupId>com.starrocks</groupId>
<artifactId>starrocks-thrift-sdk</artifactId>
<version>1.0.1</version>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.thrift</groupId>
Expand All @@ -53,6 +57,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 +146,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