incubator-depot-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nickcha...@apache.org
Subject svn commit: rev 30979 - in incubator/depot/trunk/version/src: java/org/apache/depot/version/generation templates
Date Fri, 30 Jul 2004 09:07:20 GMT
Author: nickchalko
Date: Fri Jul 30 02:07:20 2004
New Revision: 30979

Modified:
   incubator/depot/trunk/version/src/java/org/apache/depot/version/generation/Skeleton.java
   incubator/depot/trunk/version/src/java/org/apache/depot/version/generation/VersionSourceGenerator.java
   incubator/depot/trunk/version/src/templates/Version.java.jet
Log:
Fixed the date.

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/generation/Skeleton.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/generation/Skeleton.java
(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/generation/Skeleton.java
Fri Jul 30 02:07:20 2004
@@ -15,6 +15,8 @@
  */
 package org.apache.depot.version.generation;
 
+import java.util.Date;
+
 import org.apache.depot.version.VersionMarker;
 
 /**
@@ -25,6 +27,7 @@
  */
 public class Skeleton {
 	final VersionMarker depotVersion;
+	final Date date = new Date();
 
 	public Skeleton() {
 		VersionMarker temp = VersionMarker.UNKNOWN;
@@ -45,8 +48,8 @@
 		return null;
 	}
 
-	String getDate() {
-		return null;
+	Date getDate() {
+		return date;
 	}
 
 }

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/generation/VersionSourceGenerator.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/generation/VersionSourceGenerator.java
(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/generation/VersionSourceGenerator.java
Fri Jul 30 02:07:20 2004
@@ -31,7 +31,7 @@
   protected final String TEXT_7 = NL + " */" + NL + "public class ";
   protected final String TEXT_8 = " {" + NL + "\tpublic final static  ";
   protected final String TEXT_9 = " INSTANCE = new  ";
-  protected final String TEXT_10 = "();" + NL + "\t" + NL + "\tprivate  ";
+  protected final String TEXT_10 = "();" + NL + "\t" + NL + "\t" + NL + "\tprivate  ";
   protected final String TEXT_11 = "()  {}" + NL + "\t" + NL + "\t/**" + NL + "\t * The user
that built ";
   protected final String TEXT_12 = " was ";
   protected final String TEXT_13 = "." + NL + "\t * @return the String \"";
@@ -43,9 +43,12 @@
   protected final String TEXT_19 = "\"; }" + NL + "\t" + NL + "\t\t" + NL + "\t/**" + NL
+ "\t * ";
   protected final String TEXT_20 = " was built at ";
   protected final String TEXT_21 = "." + NL + "\t * @return the Date \"";
-  protected final String TEXT_22 = "\"" + NL + "\t */" + NL + "\tpublic Date getDate() {return
";
-  protected final String TEXT_23 = "; }" + NL + "\t" + NL + "\t" + NL + "\tpublic String
toString() {return \"";
-  protected final String TEXT_24 = "\";}" + NL + "}    ";
+  protected final String TEXT_22 = "\"" + NL + "\t */" + NL + "\tpublic Date getDate() {return
new Date(";
+  protected final String TEXT_23 = "l); }" + NL + "\t" + NL + "\t/**" + NL + "\t * ";
+  protected final String TEXT_24 = " ";
+  protected final String TEXT_25 = "." + NL + "\t * @return the String \"";
+  protected final String TEXT_26 = "\"" + NL + "\t */" + NL + "\tpublic String toString()
{return \"";
+  protected final String TEXT_27 = "\";}" + NL + "}    ";
 
     public String generate(String packageName,  String className, VersionMarker marker)
   {
@@ -93,10 +96,16 @@
     stringBuffer.append(TEXT_21);
     stringBuffer.append(getDate());
     stringBuffer.append(TEXT_22);
-    stringBuffer.append(getDate());
+    stringBuffer.append(getDate().getTime());
     stringBuffer.append(TEXT_23);
-    stringBuffer.append(marker.getLongVersion());
+    stringBuffer.append(marker.getId());
     stringBuffer.append(TEXT_24);
+    stringBuffer.append(marker.getLongVersion());
+    stringBuffer.append(TEXT_25);
+    stringBuffer.append(marker.getLongVersion());
+    stringBuffer.append(TEXT_26);
+    stringBuffer.append(marker.getLongVersion());
+    stringBuffer.append(TEXT_27);
     return stringBuffer.toString();
   }
 }

Modified: incubator/depot/trunk/version/src/templates/Version.java.jet
==============================================================================
--- incubator/depot/trunk/version/src/templates/Version.java.jet	(original)
+++ incubator/depot/trunk/version/src/templates/Version.java.jet	Fri Jul 30 02:07:20 2004
@@ -25,6 +25,7 @@
 public class <%=className%> {
 	public final static  <%=className%> INSTANCE = new  <%=className%>();
 	
+	
 	private  <%=className%>()  {}
 	
 	/**
@@ -45,8 +46,11 @@
 	 * <%=marker.getId()%> was built at <%=getDate()%>.
 	 * @return the Date "<%=getDate()%>"
 	 */
-	public Date getDate() {return <%=getDate()%>; }
-	
+	public Date getDate() {return new Date(<%=getDate().getTime()%>l); }
 	
+	/**
+	 * <%=marker.getId()%> <%=marker.getLongVersion()%>.
+	 * @return the String "<%=marker.getLongVersion()%>"
+	 */
 	public String toString() {return "<%=marker.getLongVersion()%>";}
 }    

Mime
View raw message