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 2010/11/16 18:26:54 UTC
svn commit: r1035702 - in /db/derby/code/branches/10.7: build.xml
java/build/org/apache/derbyBuild/ReleaseNotesTransformer.java
Author: rhillegas
Date: Tue Nov 16 17:26:54 2010
New Revision: 1035702
URL: http://svn.apache.org/viewvc?rev=1035702&view=rev
Log:
DERBY-4855: Port 1035700 from trunk to 10.7 branch.
Modified:
db/derby/code/branches/10.7/build.xml
db/derby/code/branches/10.7/java/build/org/apache/derbyBuild/ReleaseNotesTransformer.java
Modified: db/derby/code/branches/10.7/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.7/build.xml?rev=1035702&r1=1035701&r2=1035702&view=diff
==============================================================================
--- db/derby/code/branches/10.7/build.xml (original)
+++ db/derby/code/branches/10.7/build.xml Tue Nov 16 17:26:54 2010
@@ -2991,6 +2991,7 @@ you should not have to do this.
<transformReleaseNotes
inputFileName="${relnotes.src}"
outputFileName="${relnotes.target.dir}/release-${derby.release.id}.html"
+ cliXconfFileName="${website.root}/src/documentation/conf/cli.xconf"
releaseId="${derby.release.id}"
/>
Modified: db/derby/code/branches/10.7/java/build/org/apache/derbyBuild/ReleaseNotesTransformer.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.7/java/build/org/apache/derbyBuild/ReleaseNotesTransformer.java?rev=1035702&r1=1035701&r2=1035702&view=diff
==============================================================================
--- db/derby/code/branches/10.7/java/build/org/apache/derbyBuild/ReleaseNotesTransformer.java (original)
+++ db/derby/code/branches/10.7/java/build/org/apache/derbyBuild/ReleaseNotesTransformer.java Tue Nov 16 17:26:54 2010
@@ -43,6 +43,12 @@ import org.apache.tools.ant.Task;
* <li><b>Remove TOC</b> - Forrest adds its own table of contents and transforms the original TOC into a block of dead links.</li>
* <li><b>Remove mini TOC</b> - Forrest also transforms the mini TOC in the Issues section into a block of dead links.</li>
* </ul>
+ *
+ * <p>
+ * In addition, this task adds a pointer to the download page to src/documentation/conf/cli.xconf. This causes
+ * the site-building scripts to pull the download page into the build.
+ * </p>
+ *
*/
public class ReleaseNotesTransformer extends Task
{
@@ -140,9 +146,11 @@ public class ReleaseNotesTransformer ext
private Document _inputDoc;
private File _inputFile;
private File _outputFile;
+ private File _cliXconfFile;
private String _inputFileName;
private String _outputFileName;
+ private String _cliXconfFileName;
private String _releaseID;
/////////////////////////////////////////////////////////////////////////
@@ -185,6 +193,18 @@ public class ReleaseNotesTransformer ext
}
/**
+ * Ant accessor to set the name of the cli.xconf file which pulls the download page
+ * into the built site.
+ */
+ public void setCliXconfFileName(String cliXconfFileName) throws Exception
+ {
+ _cliXconfFileName = cliXconfFileName;
+ _cliXconfFile = new File(_cliXconfFileName);
+
+ println( "Writing import instructions to to " + cliXconfFileName + "..." );
+ }
+
+ /**
* Ant accessor to set the release id.
*/
public void setReleaseId(String releaseID) throws Exception
@@ -203,6 +223,8 @@ public class ReleaseNotesTransformer ext
transform();
printOutput();
postProcess();
+
+ wireIntoBuild();
}
catch (Throwable t) {
t.printStackTrace();
@@ -473,6 +495,22 @@ public class ReleaseNotesTransformer ext
}
/**
+ * <p>
+ * Wire the download page into the build instructions.
+ * </p>
+ */
+ private void wireIntoBuild()
+ throws Exception
+ {
+ String contents = readFileIntoString( _cliXconfFile );
+ int insertPoint = contents.indexOf( " </uris>" );
+ String insertion = " <uri type=\"append\" src=\"releases/release-" + _releaseID + ".html\"/>\n";
+ String result = contents.substring( 0, insertPoint ) + insertion + contents.substring( insertPoint );
+
+ writeStringIntoFile( result, _cliXconfFile );
+ }
+
+ /**
* Print a line of text to the console.
*/
private void println(String text)