lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gregor Heinrich" <heinr...@igd.fhg.de>
Subject [build.xml] Lucene Ant building and Eclipse.
Date Fri, 11 Apr 2003 17:42:56 GMT
Hi there,

I am building Lucene 1.3-rc2dev using Eclipse for partial builds and Ant
scipts for (1) full builds and (2) to create parsers. This turned out to be
very convenient.

However, there have to be some minor changes made to the Lucene distribution
structure and build scripts in order seamlessly work with this "hybrid"
approach. I wonder if this isn't also interesting for future distributions
of Lucene because I don't see any disadvantages in the modified structure if
someone uses Ant exclusively.

This posting is to suggest changes or find out I'm wrong from someone more
experienced...

So here the facts:

The way the distributed build.xml is done and Eclipse (R2.1final) works
causes two conflicts:

1 - Eclipse does not accept any source folder below ${project_root}/bin.
(Source folders are automatically synchronised with Output folders by
Eclipse's project builder.)

2 - The Ant target "demo" copies the java javaCC sources completely to the
${proj_root}/bin/src and builds the demo app from there. I didn't understand
why it is necessary to create duplicate files in the build structure, and
Eclipse complains about exactly these duplications (any other IDE would
probably).

The solution I suggest is (with respect to above items):

1 - Keep the built sources (generated parsers) in a directory outside the
build directory tree, e.g., in ${project_root}/src/build/java and
${project_root}/src/build/demo (for the two parsers generated).

2 - Adjust the build.xml to generate the parsers in place, i.e., from the
original source directories. The snippet for javacc in the "demo" target
would then be:

    <mkdir dir="${build.demo.src}/org/apache/lucene/demo" />
    <mkdir dir="${build.demo.src}/org/apache/lucene/demo/html" />
    <javacc
      target="${demo.src}/org/apache/lucene/demo/html/HTMLParser.jj"
      javacchome="${javacc.zip.dir}"
      outputdirectory="${build.demo.src}/org/apache/lucene/demo/html"
    />

So, an already long debut on this list for me. But maybe it helps some of
us.

Cheers,

Gregor


p.s. If anyone is interested in the complete setup, I am happy to share the
modified build.xml and default.properties or the complete Eclipse project.

p.p.s. Actually, there's also a javaCC plugin for Eclipse, but Ant building
seems just more convenient.

Dipl.-Ing. Gregor Heinrich
Fraunhofer Institut für Graphische Datenverarbeitung
Fraunhoferstrasse 5
64283 Darmstadt
Germany
Tel: ++49.6151.155x209
Fax: ++49.6151.155x559
PGP: public key on request.


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message