Fix encoding issue with source file, remove groovy script and do the defaultCodec transformation natively in ANT, hack lowercasing in XSL

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1627353 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2014-09-24 16:09:54 +00:00
parent 3f31f26d3d
commit 669f5b9c20
2 changed files with 9 additions and 12 deletions

View File

@ -198,16 +198,10 @@
<fileset dir="." includes="**/build.xml" excludes="build.xml,analysis/*,build/**,tools/**,site/**"/> <fileset dir="." includes="**/build.xml" excludes="build.xml,analysis/*,build/**,tools/**,site/**"/>
</makeurl> </makeurl>
<property name="Codec.java" location="core/src/java/org/apache/lucene/codecs/Codec.java"/> <property name="Codec.java" location="core/src/java/org/apache/lucene/codecs/Codec.java"/>
<loadfile srcfile="${Codec.java}" property="defaultCodecPackage"> <loadfile srcfile="${Codec.java}" property="defaultCodec" encoding="UTF-8">
<filterchain> <filterchain>
<tokenfilter> <!-- private static Codec defaultCodec = Codec . forName ( "LuceneXXX" ) ; -->
<filetokenizer/> <containsregex pattern="^.*defaultCodec\s*=\s*Codec\s*\.\s*forName\s*\(\s*&quot;([^&quot;]+)&quot;\s*\)\s*;.*$" replace="\1"/>
<scriptfilter language="groovy" classpathref="groovy.classpath"><![CDATA[
// private static Codec defaultCodec = Codec . forName ( "LuceneXXX" ) ;
def defaultCodecMatcher = self.getToken() =~ /defaultCodec\s*=\s*Codec\s*\.\s*forName\s*\(\s*"([^"]+)"\s*\)\s*;/
self.setToken(defaultCodecMatcher[0][1].toLowerCase(Locale.ROOT));
]]></scriptfilter>
</tokenfilter>
</filterchain> </filterchain>
</loadfile> </loadfile>
@ -223,7 +217,7 @@
<outputproperty name="indent" value="yes"/> <outputproperty name="indent" value="yes"/>
<param name="buildfiles" expression="${process-webpages.buildfiles}"/> <param name="buildfiles" expression="${process-webpages.buildfiles}"/>
<param name="version" expression="${version}"/> <param name="version" expression="${version}"/>
<param name="defaultCodecPackage" expression="${defaultCodecPackage}"/> <param name="defaultCodec" expression="${defaultCodec}"/>
</xslt> </xslt>
<pegdown todir="${javadoc.dir}"> <pegdown todir="${javadoc.dir}">
@ -232,7 +226,7 @@
</pegdown> </pegdown>
<copy todir="${javadoc.dir}"> <copy todir="${javadoc.dir}">
<fileset dir="site/html" includes="**/*"/> <fileset dir="site/html"/>
</copy> </copy>
</target> </target>

View File

@ -22,7 +22,10 @@
> >
<xsl:param name="buildfiles"/> <xsl:param name="buildfiles"/>
<xsl:param name="version"/> <xsl:param name="version"/>
<xsl:param name="defaultCodecPackage"/> <xsl:param name="defaultCodec"/>
<!-- ANT cannot lowercase a property, so we hack this here: -->
<xsl:variable name="defaultCodecPackage" select="translate($defaultCodec,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
<!-- <!--
NOTE: This template matches the root element of any given input XML document! NOTE: This template matches the root element of any given input XML document!