XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 4.10.2
    • None
    • general/build
    • None
    • PYTHON 2.6
      JDK 1.7.0.45
      ANT 1.9.2

    • New, Patch Available

    Description

      <!--attempt to run python w/o PYTHONHOME and PYTHONPATH defined causes regenerate task to fubar and not generate .jflex file -->
      <!-- fix is here -->
      <target name="regenerate" >
      <property name="python.exe" value="%CYGWIN_HOME%/bin/python.exe" />
      <!-- target name="generate-jflex-html-char-entities" -->
      <echo>Running ${python.exe} on htmlentity.py</echo>
      <exec executable="cmd.exe">
      <arg value="/c"/>
      <arg value="pythonit.bat"/>
      </exec>
      <fixcrlf file="src/java/org/apache/lucene/analysis/charfilter/HTMLCharacterEntities.jflex" encoding="UTF-8"/>
      </target>

      <!--end contents of pythonit.<bat/sh> -->

      <!--this will gen the Impl.java from the .jflex input -->
      <target name="jflex-HTMLCharacterEntities" depends="regenerate">
      <taskdef name="jflex-1.5.1" classname="JFlex.anttask.JFlexTask" classpath="%ANT_HOME%/lib"/>
      <echo>Run jflex-HTMLCharacterEntities</echo>
      <!-- run-jflex-and-disable-buffer-expansion dir="%LUCENE_HOME%/analysis/common/src/java/org/apache/lucene/analysis/standard" name="StandardTokenizerImpl"/ -->
      <property name="dir" value="%LUCENE_HOME%/analysis/common/src/java/org/apache/lucene/analysis/standard" />
      <property name="name" value="HTMLCharacterEntitiesImpl" />
      <jflex-1.5.1 file="%LUCENE_HOME%/analysis/common/src/java/org/apache/lucene/charfilter/HTMLCharacterEntities.jflex" outdir="%LUCENE_HOME%/analysis/common/src/java/org/apache/lucene/charfilter" nobak="off" />
      <!-- /macrodef -->
      </target>

      when I regen'ed HTMLCharacterEntities.jflex I wanted to use jflex to generate the HtmlCharacterEntitiesImpl.java file the above target jflex-HTMLCharacterEntities will gen that file for you

      Nota Bene; take note of the bat/sh that properly sets PYTHONHOME and PYTHONPATH so Python can locate subordinate .pyc components

      I also had to tweak Gerwin Kleins JFlex library from 2003 to take inputFile and outputDir parameters

      Erik/Michael: does the original regenerate work for you?
      Martin Gainty 8 Dec 2014

      Attachments

        Activity

          People

            Unassigned Unassigned
            mgainty@hotmail.com Martin Gainty
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified