hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1214790 - /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/pom.xml
Date Thu, 15 Dec 2011 14:41:01 GMT
Author: tucu
Date: Thu Dec 15 14:41:01 2011
New Revision: 1214790

URL: http://svn.apache.org/viewvc?rev=1214790&view=rev
Log:
HADOOP_7917. compilation of protobuf files fails in windows/cygwin. (tucu)

Modified:
    hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/pom.xml

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/pom.xml
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/pom.xml?rev=1214790&r1=1214789&r2=1214790&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/pom.xml (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/pom.xml Thu Dec 15 14:41:01 2011
@@ -224,17 +224,29 @@
             </goals>
             <configuration>
               <target>
-                <echo file="${project.build.directory}/compile-proto.sh">
-                  PROTO_DIR=${basedir}/src/main/proto
-                  ls $PROTO_DIR &amp;> /dev/null
-                  if [ $? = 0 ]; then
-                    JAVA_DIR=${project.build.directory}/generated-sources/java
-                    mkdir -p $JAVA_DIR
-                    ls $PROTO_DIR/*.proto | xargs -n 1 protoc -I$PROTO_DIR --java_out=$JAVA_DIR
-                  fi
+                <echo file="target/compile-proto.sh">
+                    PROTO_DIR=src/main/proto
+                    JAVA_DIR=target/generated-sources/java
+                    which cygpath 2> /dev/null
+                    if [ $? = 1 ]; then
+                      IS_WIN=false
+                    else
+                      IS_WIN=true
+                      WIN_PROTO_DIR=`cygpath --windows $PROTO_DIR`
+                      WIN_JAVA_DIR=`cygpath --windows $JAVA_DIR`
+                    fi
+                    mkdir -p $JAVA_DIR 2> /dev/null
+                    for PROTO_FILE in `ls $PROTO_DIR/*.proto 2> /dev/null`
+                    do
+                        if [ "$IS_WIN" = "true" ]; then
+                          protoc -I$WIN_PROTO_DIR --java_out=$WIN_JAVA_DIR $PROTO_FILE
+                        else
+                          protoc -I$PROTO_DIR --java_out=$JAVA_DIR $PROTO_FILE
+                        fi
+                    done
                 </echo>
-                <exec executable="sh" dir="${project.build.directory}" failonerror="true">
-                  <arg line="./compile-proto.sh"/>
+                <exec executable="sh" dir="${basedir}" failonerror="true">
+                  <arg line="target/compile-proto.sh"/>
                 </exec>
               </target>
             </configuration>



Mime
View raw message