You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@reef.apache.org by we...@apache.org on 2015/02/17 17:59:47 UTC

incubator-reef git commit: [REEF-160] Fast-fail when protoc version differs from protobuf

Repository: incubator-reef
Updated Branches:
  refs/heads/master 11ff518bb -> 582063000


[REEF-160] Fast-fail when protoc version differs from protobuf

Add protoc version check to root pom.

JIRA:
  [REEF-160] https://issues.apache.org/jira/browse/REEF-160

Pull Request:
  This closes #81


Project: http://git-wip-us.apache.org/repos/asf/incubator-reef/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-reef/commit/58206300
Tree: http://git-wip-us.apache.org/repos/asf/incubator-reef/tree/58206300
Diff: http://git-wip-us.apache.org/repos/asf/incubator-reef/diff/58206300

Branch: refs/heads/master
Commit: 582063000e6cc23f63ef793e3de935fd03d296c4
Parents: 11ff518
Author: Brian Cho <ch...@apache.org>
Authored: Tue Feb 17 18:34:03 2015 +0900
Committer: Markus Weimer <we...@apache.org>
Committed: Tue Feb 17 08:58:38 2015 -0800

----------------------------------------------------------------------
 pom.xml | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/58206300/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 86cd8ca..e75002b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -52,6 +52,7 @@ under the License.
         <avro.version>1.7.7</avro.version>
         <jetty.version>6.1.26</jetty.version>
         <jackson.version>1.9.13</jackson.version>
+        <protobuf.version>2.5.0</protobuf.version>
     </properties>
 
     <scm>
@@ -133,6 +134,28 @@ under the License.
                 <plugin>
                     <artifactId>maven-antrun-plugin</artifactId>
                     <version>1.7</version>
+                    <executions>
+                        <execution>
+                            <phase>generate-sources</phase>
+                            <goals>
+                                <goal>run</goal>
+                            </goals>
+                            <configuration>
+                                <tasks>
+                                    <exec executable="protoc" outputproperty="protoc.version">
+                                        <arg value="--version"/>
+                                    </exec>
+                                    <fail message="${protobuf.version} expected, but protoc version was: ${protoc.version}">
+                                        <condition>
+                                            <not>
+                                                <contains substring="${protobuf.version}" string="${protoc.version}"/>
+                                            </not>
+                                        </condition>
+                                    </fail>
+                                </tasks>
+                            </configuration>
+                        </execution>
+                    </executions>
                 </plugin>
                 <plugin>
                     <groupId>org.codehaus.mojo</groupId>
@@ -357,7 +380,7 @@ under the License.
             <dependency>
                 <groupId>com.google.protobuf</groupId>
                 <artifactId>protobuf-java</artifactId>
-                <version>2.5.0</version>
+                <version>${protobuf.version}</version>
             </dependency>
             <!-- End of Protocol Buffers -->