Skip to content

Commit

Permalink
OMID-120 Utilize protobuf-maven-plugin for build
Browse files Browse the repository at this point in the history
  • Loading branch information
chia7712 authored and stoty committed Nov 11, 2020
1 parent 46656dc commit ebe39cd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 27 deletions.
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ before_script:
- git config --global user.email "[email protected]"
- git config --global user.name "Omid CI"
- REPO_DIR=$(pwd)
# Install protobuf to genearte TSO client-server protocol in each compilation
- cd ..
- wget https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
- tar -xzvf protobuf-2.5.0.tar.gz
- cd protobuf-2.5.0 && ./configure --prefix=/usr && make && sudo make install
- cd $REPO_DIR

script:
Expand Down
36 changes: 15 additions & 21 deletions common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,37 +88,31 @@
</dependencies>

<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>${os.plugin.version}</version>
</extension>
</extensions>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven-antrun-plugin.version}</version>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>${protobuf.plugin.version}</version>
<executions>
<execution>
<id>compile-protoc</id>
<phase>generate-sources</phase>
<id>default-cli</id>
<configuration>
<target>
<mkdir dir="${project.build.directory}/generated-sources/proto" />
<path id="proto.path">
<fileset dir="src/main/proto">
<include name="**/*.proto" />
</fileset>
</path>
<pathconvert pathsep=" " property="proto.files" refid="proto.path" />
<exec executable="${protoc.path}protoc" failonerror="true">
<arg value="--java_out=${project.build.directory}/generated-sources/proto" />
<arg value="-I${project.basedir}/src/main/proto" />
<arg line="${proto.files}" />
</exec>
</target>
</configuration>
<goals>
<goal>run</goal>
<goal>compile</goal>
</goals>
<configuration>
<protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
Expand Down
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@
<log4j.version>1.2.17</log4j.version>
<netty.version>3.2.6.Final</netty.version>
<protobuf.version>2.5.0</protobuf.version>
<protoc.path></protoc.path>
<protobuf.plugin.version>0.6.1</protobuf.plugin.version>
<os.plugin.version>1.6.2</os.plugin.version>
<junit.version>4.13</junit.version>
<mockito.version>1.9.5</mockito.version>
<disruptor.version>3.2.0</disruptor.version>
Expand Down

0 comments on commit ebe39cd

Please sign in to comment.