HADOOP_7917. compilation of protobuf files fails in windows/cygwin. (tucu)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1214790 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Alejandro Abdelnur 2011-12-15 14:41:01 +00:00
parent 227fb568b8
commit 6cf3a15c52
3 changed files with 68 additions and 30 deletions

View File

@ -145,6 +145,8 @@ Trunk (unreleased changes)
HADOOP-7761. Improve the performance of raw comparisons. (todd) HADOOP-7761. Improve the performance of raw comparisons. (todd)
HADOOP_7917. compilation of protobuf files fails in windows/cygwin. (tucu)
Release 0.23.1 - Unreleased Release 0.23.1 - Unreleased
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -296,17 +296,29 @@
</goals> </goals>
<configuration> <configuration>
<target> <target>
<echo file="${project.build.directory}/compile-proto.sh"> <echo file="target/compile-proto.sh">
PROTO_DIR=${basedir}/src/main/proto PROTO_DIR=src/main/proto
ls $PROTO_DIR &amp;> /dev/null JAVA_DIR=target/generated-sources/java
if [ $? = 0 ]; then which cygpath 2> /dev/null
JAVA_DIR=${project.build.directory}/generated-sources/java if [ $? = 1 ]; then
mkdir -p $JAVA_DIR IS_WIN=false
ls $PROTO_DIR/*.proto | xargs -n 1 protoc -I$PROTO_DIR --java_out=$JAVA_DIR else
IS_WIN=true
WIN_PROTO_DIR=`cygpath --windows $PROTO_DIR`
WIN_JAVA_DIR=`cygpath --windows $JAVA_DIR`
fi 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> </echo>
<exec executable="sh" dir="${project.build.directory}" failonerror="true"> <exec executable="sh" dir="${basedir}" failonerror="true">
<arg line="./compile-proto.sh"/> <arg line="target/compile-proto.sh"/>
</exec> </exec>
</target> </target>
</configuration> </configuration>
@ -319,17 +331,29 @@
</goals> </goals>
<configuration> <configuration>
<target> <target>
<echo file="${project.build.directory}/compile-test-proto.sh"> <echo file="target/compile-test-proto.sh">
PROTO_DIR=${basedir}/src/test/proto PROTO_DIR=src/test/proto
ls $PROTO_DIR &amp;> /dev/null JAVA_DIR=target/generated-test-sources/java
if [ $? = 0 ]; then which cygpath 2> /dev/null
JAVA_DIR=${project.build.directory}/generated-test-sources/java if [ $? = 1 ]; then
mkdir -p $JAVA_DIR IS_WIN=false
ls $PROTO_DIR/*.proto | xargs -n 1 protoc -I$PROTO_DIR --java_out=$JAVA_DIR else
IS_WIN=true
WIN_PROTO_DIR=`cygpath --windows $PROTO_DIR`
WIN_JAVA_DIR=`cygpath --windows $JAVA_DIR`
fi 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> </echo>
<exec executable="sh" dir="${project.build.directory}" failonerror="true"> <exec executable="sh" dir="${basedir}" failonerror="true">
<arg line="./compile-test-proto.sh"/> <arg line="target/compile-test-proto.sh"/>
</exec> </exec>
</target> </target>
</configuration> </configuration>

View File

@ -224,17 +224,29 @@
</goals> </goals>
<configuration> <configuration>
<target> <target>
<echo file="${project.build.directory}/compile-proto.sh"> <echo file="target/compile-proto.sh">
PROTO_DIR=${basedir}/src/main/proto PROTO_DIR=src/main/proto
ls $PROTO_DIR &amp;> /dev/null JAVA_DIR=target/generated-sources/java
if [ $? = 0 ]; then which cygpath 2> /dev/null
JAVA_DIR=${project.build.directory}/generated-sources/java if [ $? = 1 ]; then
mkdir -p $JAVA_DIR IS_WIN=false
ls $PROTO_DIR/*.proto | xargs -n 1 protoc -I$PROTO_DIR --java_out=$JAVA_DIR else
IS_WIN=true
WIN_PROTO_DIR=`cygpath --windows $PROTO_DIR`
WIN_JAVA_DIR=`cygpath --windows $JAVA_DIR`
fi 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> </echo>
<exec executable="sh" dir="${project.build.directory}" failonerror="true"> <exec executable="sh" dir="${basedir}" failonerror="true">
<arg line="./compile-proto.sh"/> <arg line="target/compile-proto.sh"/>
</exec> </exec>
</target> </target>
</configuration> </configuration>