Skip to content

Commit

Permalink
feat(java-client): add maven-thrift-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
shalk committed Apr 30, 2024
1 parent cb9a697 commit 0e121c9
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 18 deletions.
2 changes: 1 addition & 1 deletion java-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ under the License.
### 1. Prepare

```
cd scripts && bash recompile_thrift.sh
cd scripts && bash download_thrift.sh
```

### 2. Format the code
Expand Down
30 changes: 30 additions & 0 deletions java-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,36 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.thrift</groupId>
<artifactId>thrift-maven-plugin</artifactId>
<version>0.10.0</version>
<configuration>
<thriftSourceRoot>${project.basedir}/../idl</thriftSourceRoot>
<includes>
<include>backup.thrift</include>
<include>bulk_load.thrift</include>
<include>dsn.layer2.thrift</include>
<include>duplication.thrift</include>
<include>metadata.thrift</include>
<include>meta_admin.thrift</include>
<include>partition_split.thrift</include>
<include>rrdb.thrift</include>
<include>security.thrift</include>
</includes>
<thriftExecutable>thrift</thriftExecutable>
<outputDirectory>${project.basedir}/src/main/java</outputDirectory>
</configuration>
<executions>
<execution>
<id>thrift-sources</id>
<goals>
<goal>compile</goal>
</goals>
<phase>generate-sources</phase>
</execution>
</executions>
</plugin>
</plugins>
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,4 @@ if ! $thrift -version | grep "0.11.0" ; then
exit 1
fi

TMP_DIR=./gen-java
rm -rf $TMP_DIR

mkdir -p $TMP_DIR
$thrift --gen java ../../idl/backup.thrift
$thrift --gen java ../../idl/bulk_load.thrift
$thrift --gen java ../../idl/dsn.layer2.thrift
$thrift --gen java ../../idl/duplication.thrift
$thrift --gen java ../../idl/metadata.thrift
$thrift --gen java ../../idl/meta_admin.thrift
$thrift --gen java ../../idl/partition_split.thrift
$thrift --gen java ../../idl/rrdb.thrift
$thrift --gen java ../../idl/security.thrift

cp -v -r $TMP_DIR/* ../src/main/java/
rm -rf $TMP_DIR

echo "done"

0 comments on commit 0e121c9

Please sign in to comment.