Apache Lucene open-source search software
LUCENE-5341: automate default codec package extraction for use in the generated Lucene documentation's link to the index file format documentation
Steven Rowe0629d8b4a26d
diff --git a/lucene/build.xml b/lucene/build.xmlindex bfc9d92f4f4..a2506a5c0c9 100644--- a/lucene/build.xml+++ b/lucene/build.xml@@ -274,6 +274,24 @@<makeurl property="process-webpages.buildfiles" separator="|"><fileset dir="." includes="**/build.xml" excludes="build.xml,analysis/*,build/**,tools/**,backwards/**,site/**"/></makeurl>+ <property name="Codec.java" location="core/src/java/org/apache/lucene/codecs/Codec.java"/>+ <loadfile srcfile="${Codec.java}" property="defaultCodecPackage">+ <filterchain>+ <tokenfilter>+ <filetokenizer/>+ <scriptfilter language="groovy">+ <classpath>+ <path refid="groovy.classpath"/>+ </classpath><![CDATA[+ // private static Codec defaultCodec = Codec . forName ( "Lucene46" ) ;+ defaultCodecMatcher = self.getToken() =~ /defaultCodec\s*=\s*Codec\s*\.\s*forName\s*\(\s*"([^"]+)"\s*\)\s*;/+ self.setToken(defaultCodecMatcher[0][1].toLowerCase());+ ]]>+ </scriptfilter>+ </tokenfilter>+ </filterchain>+ </loadfile>+<!--The XSL input file is ignored completely, but XSL expects one to be given,so we pass ourself (${ant.file}) here. The list of module build.xmls is given@@ -286,6 +304,7 @@<outputproperty name="indent" value="yes"/><param name="buildfiles" expression="${process-webpages.buildfiles}"/><param name="version" expression="${version}"/>+ <param name="defaultCodecPackage" expression="${defaultCodecPackage}"/></xslt><pegdown todir="${javadoc.dir}">diff --git a/lucene/site/xsl/index.xsl b/lucene/site/xsl/index.xslindex 842f7be3d9d..616c947838e 100644--- a/lucene/site/xsl/index.xsl+++ b/lucene/site/xsl/index.xsl@@ -22,6 +22,7 @@><xsl:param name="buildfiles"/><xsl:param name="version"/>+ <xsl:param name="defaultCodecPackage"/><!--NOTE: This template matches the root element of any given input XML document!@@ -75,7 +76,7 @@<li><a href="SYSTEM_REQUIREMENTS.html">System Requirements</a>: Minimum and supported Java versions.</li><li><a href="MIGRATE.html">Migration Guide</a>: What changed in Lucene 4; how to migrate code from Lucene 3.x.</li><li><a href="JRE_VERSION_MIGRATION.html">JRE Version Migration</a>: Information about upgrading between major JRE versions.</li>- <li><a href="core/org/apache/lucene/codecs/lucene45/package-summary.html#package_description">File Formats</a>: Guide to the supported index format used by Lucene. This can be customized by using <a href="core/org/apache/lucene/codecs/package-summary.html#package_description">an alternate codec</a>.</li>+ <li><a href="core/org/apache/lucene/codecs/{$defaultCodecPackage}/package-summary.html#package_description">File Formats</a>: Guide to the supported index format used by Lucene. This can be customized by using <a href="core/org/apache/lucene/codecs/package-summary.html#package_description">an alternate codec</a>.</li><li><a href="core/org/apache/lucene/search/package-summary.html#package_description">Search and Scoring in Lucene</a>: Introduction to how Lucene scores documents.</li><li><a href="core/org/apache/lucene/search/similarities/TFIDFSimilarity.html">Classic Scoring Formula</a>: Formula of Lucene's classic <a href="http://en.wikipedia.org/wiki/Vector_Space_Model">Vector Space</a> implementation. (look <a href="core/org/apache/lucene/search/similarities/package-summary.html#package_description">here</a> for other models)</li><li><a href="queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package_description">Classic QueryParser Syntax</a>: Overview of the Classic QueryParser's syntax and features.</li>