You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sqoop.apache.org by bl...@apache.org on 2011/11/04 03:15:46 UTC
svn commit: r1197390 - in /incubator/sqoop/trunk: CHANGES.txt
src/java/org/apache/sqoop/tool/VersionTool.java
src/scripts/write-version-info.sh
Author: blee
Date: Fri Nov 4 02:15:45 2011
New Revision: 1197390
URL: http://svn.apache.org/viewvc?rev=1197390&view=rev
Log:
SQOOP-383 Version tool is not working
Modified:
incubator/sqoop/trunk/CHANGES.txt
incubator/sqoop/trunk/src/java/org/apache/sqoop/tool/VersionTool.java
incubator/sqoop/trunk/src/scripts/write-version-info.sh
Modified: incubator/sqoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/sqoop/trunk/CHANGES.txt?rev=1197390&r1=1197389&r2=1197390&view=diff
==============================================================================
--- incubator/sqoop/trunk/CHANGES.txt (original)
+++ incubator/sqoop/trunk/CHANGES.txt Fri Nov 4 02:15:45 2011
@@ -107,7 +107,7 @@ Release 1.4.0-incubating
SQOOP-386 Namespace migration cleanup
- SQOOP-383 SQOOP-369 Version tool is not working
+ SQOOP-383 Version tool is not working
SQOOP-381 Migrate cli and config packages to new name space
Modified: incubator/sqoop/trunk/src/java/org/apache/sqoop/tool/VersionTool.java
URL: http://svn.apache.org/viewvc/incubator/sqoop/trunk/src/java/org/apache/sqoop/tool/VersionTool.java?rev=1197390&r1=1197389&r2=1197390&view=diff
==============================================================================
--- incubator/sqoop/trunk/src/java/org/apache/sqoop/tool/VersionTool.java (original)
+++ incubator/sqoop/trunk/src/java/org/apache/sqoop/tool/VersionTool.java Fri Nov 4 02:15:45 2011
@@ -33,8 +33,7 @@ public class VersionTool extends com.clo
@Override
/** {@inheritDoc} */
public int run(SqoopOptions options) {
- // FIXME with maven buildnumber plugin
- System.out.print("FIXME ");
+ System.out.print(new org.apache.sqoop.SqoopVersion().toString());
return 0;
}
Modified: incubator/sqoop/trunk/src/scripts/write-version-info.sh
URL: http://svn.apache.org/viewvc/incubator/sqoop/trunk/src/scripts/write-version-info.sh?rev=1197390&r1=1197389&r2=1197390&view=diff
==============================================================================
--- incubator/sqoop/trunk/src/scripts/write-version-info.sh (original)
+++ incubator/sqoop/trunk/src/scripts/write-version-info.sh Fri Nov 4 02:15:45 2011
@@ -33,6 +33,9 @@ specifiedgithash=$3
outputdir=${buildroot}/src/com/cloudera/sqoop
outputfile=${outputdir}/SqoopVersion.java
+newoutputdir=${buildroot}/src/org/apache/sqoop
+newoutputfile=${newoutputdir}/SqoopVersion.java
+
signature=$specifiedgithash
if [ -z "$signature" ]; then
signature=`git log -1 --pretty=format:%H`
@@ -45,14 +48,45 @@ mkdir -p ${outputdir}
cat > ${outputfile} <<EOF
// generated by src/scripts/write-version-info.sh
package com.cloudera.sqoop;
-public final class SqoopVersion {
+
+/**
+ * @deprecated use org.apache.sqoop.SqoopVersion instead
+ * @see org.apache.sqoop.SqoopVersion
+ */
+public final class SqoopVersion extends org.apache.sqoop.SqoopVersion {
public SqoopVersion() {
+ super();
}
+ public static final String VERSION =
+ org.apache.sqoop.SqoopVersion.VERSION;
+ public static final String GIT_HASH =
+ org.apache.sqoop.SqoopVersion.GIT_HASH;
+ public static final String COMPILE_USER =
+ org.apache.sqoop.SqoopVersion.COMPILE_USER;
+ public static final String COMPILE_HOST =
+ org.apache.sqoop.SqoopVersion.COMPILE_HOST;
+ public static final String COMPILE_DATE =
+ org.apache.sqoop.SqoopVersion.COMPILE_DATE;
+}
+EOF
+
+
+mkdir -p ${newoutputdir}
+cat > ${newoutputfile} <<EOF
+// generated by src/scripts/write-version-info.sh
+package org.apache.sqoop;
+
+public class SqoopVersion {
+ public SqoopVersion() {
+ }
+
public static final String VERSION="${version}";
public static final String GIT_HASH="${signature}";
public static final String COMPILE_USER="${USER}";
public static final String COMPILE_HOST="${host}";
public static final String COMPILE_DATE="${compiledate}";
+
+ @Override
public String toString() {
return "Sqoop " + VERSION + "\n"
+ "git commit id " + GIT_HASH + "\n"
@@ -61,4 +95,3 @@ public final class SqoopVersion {
}
}
EOF
-