/** * Create the release properties file from the release id. Sets the property derby.release.id.new * equal to the resulting release id. */ public void execute() throws BuildException { File target = new File(_releasePropertiesFileName); FileWriter propertiesFW = null; PrintWriter propertiesPW = null; try { VersionID versionID = new VersionID(_releaseID); if (_bump) { versionID.bump(); } int major = versionID.getMajor(); int minor = versionID.getMinor(); int currentYear = getCurrentYear(); propertiesFW = new FileWriter(target); propertiesPW = new PrintWriter(propertiesFW); propertiesPW.println(APACHE_LICENSE_HEADER); propertiesPW.println("drdamaint=0"); propertiesPW.println("maint=" + encodeFixpackAndPoint(versionID)); propertiesPW.println("major=" + major); propertiesPW.println("minor=" + minor); propertiesPW.println("eversion=" + versionID.getBranchName()); propertiesPW.println("beta=" + versionID.isBeta()); propertiesPW.println( "copyright.comment=Copyright 1997, " + currentYear + " The Apache Software Foundation or its licensors, as applicable."); propertiesPW.println("vendor=The Apache Software Foundation"); propertiesPW.println("copyright.year=" + currentYear); propertiesPW.println("release.id.long=" + versionID.toString()); setProperty(NEW_RELEASE_ID, versionID.toString()); } catch (Exception e) { throw new BuildException("Could not generate release properties: " + e.getMessage(), e); } finally { try { finishWriting(propertiesFW, propertiesPW); } catch (Exception ex) { throw new BuildException("Error closing file writers.", ex); } } }