You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by rh...@apache.org on 2014/01/13 20:42:22 UTC
svn commit: r1557823 -
/db/derby/code/trunk/java/build/org/apache/derbyPreBuild/ReleaseProperties.java
Author: rhillegas
Date: Mon Jan 13 19:42:22 2014
New Revision: 1557823
URL: http://svn.apache.org/r1557823
Log:
DERBY-5463: Don't alter the value of drdamaint when generating a new release.properties file; commit derby-5463-01-aa-leaveDRDAmaintIDAlone.diff.
Modified:
db/derby/code/trunk/java/build/org/apache/derbyPreBuild/ReleaseProperties.java
Modified: db/derby/code/trunk/java/build/org/apache/derbyPreBuild/ReleaseProperties.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/build/org/apache/derbyPreBuild/ReleaseProperties.java?rev=1557823&r1=1557822&r2=1557823&view=diff
==============================================================================
--- db/derby/code/trunk/java/build/org/apache/derbyPreBuild/ReleaseProperties.java (original)
+++ db/derby/code/trunk/java/build/org/apache/derbyPreBuild/ReleaseProperties.java Mon Jan 13 19:42:22 2014
@@ -22,10 +22,12 @@
package org.apache.derbyPreBuild;
import java.io.File;
+import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Calendar;
+import java.util.Properties;
import java.util.StringTokenizer;
import org.apache.tools.ant.BuildException;
@@ -76,6 +78,9 @@ public class ReleaseProperties extends T
public final static int MAINT_ENCODING = 1000000;
private final static int MAINT_LENGTH = 7;
+ private final static String DRDA_MAINT = "drdamaint";
+ private final static int DRDA_MAINT_ID_DEFAULT = 0;
+
// properties to set on the way out
private static final String NEW_RELEASE_ID = "derby.release.id.new";
@@ -138,6 +143,9 @@ public class ReleaseProperties extends T
PrintWriter propertiesPW = null;
try {
+ int drdaMaintID = readDRDAMaintID( target );
+ System.out.println( "XXX ReleaseProperties. drda maint id = " + drdaMaintID );
+
VersionID versionID = new VersionID( _releaseID );
if ( _bump ) { versionID.bump(); }
@@ -150,7 +158,7 @@ public class ReleaseProperties extends T
propertiesPW.println( APACHE_LICENSE_HEADER );
- propertiesPW.println( "drdamaint=0" );
+ propertiesPW.println( DRDA_MAINT + "=" + drdaMaintID );
propertiesPW.println( "maint=" + encodeFixpackAndPoint( versionID ) );
propertiesPW.println( "major=" + major );
propertiesPW.println( "minor=" + minor );
@@ -232,6 +240,25 @@ public class ReleaseProperties extends T
pw.close();
fw.close();
}
+
+ /**
+ * <p>
+ * Read the DRDA maintenance id from the existing release properties.
+ * Returns 0 if the release properties file doesn't exist.
+ * </p>
+ */
+ private int readDRDAMaintID( File inputFile )
+ throws Exception
+ {
+ if ( !inputFile.exists() ) { return DRDA_MAINT_ID_DEFAULT; }
+
+ Properties releaseProperties = new Properties();
+ releaseProperties.load( new FileInputStream( inputFile ) );
+
+ String stringValue = releaseProperties.getProperty( DRDA_MAINT );
+
+ return Integer.parseInt( stringValue );
+ }
/////////////////////////////////////////////////////////////////////////
//