From 1a231a0b2243bc8a9cc343b68315b92931369892 Mon Sep 17 00:00:00 2001 From: Alejandro Abdelnur Date: Thu, 15 Dec 2011 14:47:22 +0000 Subject: [PATCH] Merge -r 1214789:1214790 from trunk to branch. FIXES: HADOOP-7917 git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1214792 13f79535-47bb-0310-9956-ffa450edef68 --- .../hadoop-common/CHANGES.txt | 2 + hadoop-common-project/hadoop-common/pom.xml | 70 +++++++++++++++++++ hadoop-hdfs-project/hadoop-hdfs/pom.xml | 32 ++++++--- 3 files changed, 94 insertions(+), 10 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 9c32c0e3bc2..281704a0365 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -91,6 +91,8 @@ Release 0.23.1 - Unreleased HADOOP-7810 move hadoop archive to core from tools. (tucu) + HADOOP_7917. compilation of protobuf files fails in windows/cygwin. (tucu) + Release 0.23.0 - 2011-11-01 INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/pom.xml b/hadoop-common-project/hadoop-common/pom.xml index b0a99ba5d1d..272158231b5 100644 --- a/hadoop-common-project/hadoop-common/pom.xml +++ b/hadoop-common-project/hadoop-common/pom.xml @@ -294,6 +294,76 @@ org.apache.maven.plugins maven-antrun-plugin + + compile-proto + generate-sources + + run + + + + + 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 + + + + + + + + + compile-test-proto + generate-test-sources + + run + + + + + PROTO_DIR=src/test/proto + JAVA_DIR=target/generated-test-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 + + + + + + + save-version generate-sources diff --git a/hadoop-hdfs-project/hadoop-hdfs/pom.xml b/hadoop-hdfs-project/hadoop-hdfs/pom.xml index a8349e2b243..07fe3814665 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/pom.xml +++ b/hadoop-hdfs-project/hadoop-hdfs/pom.xml @@ -224,17 +224,29 @@ - - PROTO_DIR=${basedir}/src/main/proto - ls $PROTO_DIR &> /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 + + 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 - - + +