From 15c1ba7241df967c45d68b5008915ea563fa13d5 Mon Sep 17 00:00:00 2001 From: Andrew Bayer Date: Fri, 22 Jul 2011 20:04:07 +0000 Subject: [PATCH] SQOOP-53. Build test jar and publish to maven. Sqoop now builds a sqoop-test-(version).jar file. Added "jar-all" target to build.xml to build all artifacts. Default ant target switched to "jar-all". mvn-install, mvn-deploy updated deploy to deploy all main, test, and shim jars. Added source jar artifacts to maven installation/deploy process. Fixed build dependency bugs in generated poms. Added Sqoop pom template; generating from ivy.xml was over-broad. write-version-info.sh generates correct directory hierarchy in build/src/. bin/sqoop and bin/configure-sqoop tweaked to account for multiple sqoop-* jars in the $SQOOP_HOME directory. From: Aaron Kimball git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149946 13f79535-47bb-0310-9956-ffa450edef68 --- COMPILING.txt | 6 +- bin/configure-sqoop | 3 +- bin/sqoop | 3 +- build.xml | 127 ++++++++++++++++++++++++++++-- ivy.xml | 2 +- ivy/ivysettings.xml | 4 +- ivy/sqoop-test.xml | 51 ++++++++++++ ivy/sqoop.xml | 55 +++++++++++++ src/scripts/write-version-info.sh | 2 +- 9 files changed, 236 insertions(+), 17 deletions(-) create mode 100644 ivy/sqoop-test.xml create mode 100644 ivy/sqoop.xml diff --git a/COMPILING.txt b/COMPILING.txt index 800b87e1..4ce9498a 100644 --- a/COMPILING.txt +++ b/COMPILING.txt @@ -47,8 +47,10 @@ Furthermore, Sqoop's build can be instrumented with the following: Sqoop is compiled with ant. Type +ant -p+ to see the list of available targets. -Type +ant jar+ to compile java sources into jar files. Type +ant package+ to -produce a fully self-hosted build. This will appear in the +Type +ant+ to compile all java sources. You can then run Sqoop with +bin/sqoop+. + +If you want to build everything (including the documentation), type ++ant package+. This will appear in the +build/sqoop-(version)/+ directory. == Testing Sqoop diff --git a/bin/configure-sqoop b/bin/configure-sqoop index 6bb300d6..47e5d877 100755 --- a/bin/configure-sqoop +++ b/bin/configure-sqoop @@ -110,10 +110,11 @@ if [ -d "$SQOOP_HOME/build/ivy/lib/sqoop" ]; then done fi +add_to_classpath ${SQOOP_JAR_DIR} + export SQOOP_CLASSPATH export SQOOP_JAR_DIR export SQOOP_SHIM_DIR -export SQOOP_JAR=`ls -1 ${SQOOP_JAR_DIR}/sqoop-*.jar | head -n 1` export HADOOP_CLASSPATH="${SQOOP_CLASSPATH}:${HADOOP_CLASSPATH}" export HADOOP_HOME export HBASE_HOME diff --git a/bin/sqoop b/bin/sqoop index cf8f438d..343105a5 100755 --- a/bin/sqoop +++ b/bin/sqoop @@ -95,5 +95,4 @@ bin=`dirname ${prgm}` bin=`cd ${bin} && pwd` source ${bin}/configure-sqoop "${bin}" -${HADOOP_HOME}/bin/hadoop jar ${SQOOP_JAR} \ - com.cloudera.sqoop.Sqoop "$@" +exec ${HADOOP_HOME}/bin/hadoop com.cloudera.sqoop.Sqoop "$@" diff --git a/build.xml b/build.xml index 9d668ad9..7a1c6ab5 100644 --- a/build.xml +++ b/build.xml @@ -17,7 +17,7 @@ limitations under the License. --> - @@ -33,6 +33,7 @@ + @@ -45,18 +46,40 @@ + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + @@ -689,7 +728,7 @@ - + @@ -704,7 +743,12 @@ - + + + + @@ -731,32 +775,97 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + @@ -826,6 +935,8 @@ + + @@ -903,7 +1014,7 @@ file="${cobertura.home}/cobertura.jar" /> - diff --git a/ivy.xml b/ivy.xml index a7ab7f93..72a4aaf9 100644 --- a/ivy.xml +++ b/ivy.xml @@ -117,7 +117,7 @@ + conf="test->default"/> + + + + + + Sqoop test library + + + + + + + + + + + + + + + + + + + + + + diff --git a/ivy/sqoop.xml b/ivy/sqoop.xml new file mode 100644 index 00000000..7f455fc0 --- /dev/null +++ b/ivy/sqoop.xml @@ -0,0 +1,55 @@ + + + + + + + + Sqoop + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/scripts/write-version-info.sh b/src/scripts/write-version-info.sh index 11988944..a6e3fffe 100755 --- a/src/scripts/write-version-info.sh +++ b/src/scripts/write-version-info.sh @@ -29,7 +29,7 @@ buildroot=$1 version=$2 specifiedgithash=$3 -outputdir=${buildroot}/src/com.cloudera.sqoop +outputdir=${buildroot}/src/com/cloudera/sqoop outputfile=${outputdir}/SqoopVersion.java signature=$specifiedgithash