I've applied it to branch_9x and main, Andi.

D.

On Mon, Jan 3, 2022 at 6:34 PM Andi Vajda <[email protected]> wrote:

>
> On Mon, 3 Jan 2022, Dawid Weiss wrote:
>
> > Hi Andi,
> >
> > Try this:
> > https://github.com/apache/lucene/pull/576
> >
> > if you run 'gradlew collectRuntimeJars' it'll compile module jars but
> also
> > collect any runtime binary dependencies under each project's build
> folder.
> > For example:
> >
> >> ls lucene/analysis/icu/build/runtimeJars
> > icu4j-70.1.jar
> > lucene-analysis-icu-10.0.0-SNAPSHOT.jar
> >
> > Let me know if this works for you and I'll merge with main.
>
> Yes, this is perfect. This is exactly what I was looking for.
> Thanks !
>
> Andi..
>
> >
> > Dawid
> >
> > On Sun, Jan 2, 2022 at 11:29 PM Andi Vajda <[email protected]> wrote:
> >
> >>
> >> Thank you, Dawid.
> >>
> >> On Sat, 1 Jan 2022, Dawid Weiss wrote:
> >>
> >>>> Or is there an easy way for me to request from the Lucene Gradle build
> >>> that these external jar files be put somewhere more accessible
> >>>
> >>> It's a trivial problem to solve but the question isn't stated right - I
> >>> think you should decide which specific subprojects from Lucene you need
> >>> binary dependencies of. Then we can do any of the following:
> >>
> >> For Lucene 8.x, these are the external jars I've needed to build
> PyLucene:
> >>    ANTLR_JAR=$(LUCENE)/expressions/lib/antlr4-runtime-4.5.1-1.jar
> >>    ASM_JAR=$(LUCENE)/expressions/lib/asm-8.0.1.jar
> >>    ASM_COMMONS_JAR=$(LUCENE)/expressions/lib/asm-commons-8.0.1.jar
> >>    HPPC_JAR=$(LUCENE)/facet/lib/hppc-0.8.1.jar
> >>
> >> I suspect that for Lucene 9 some version numbers changed.
> >>
> >>> 1) prepare either a special task for you to collect everything for
> >> pylucene
> >>> or (perhaps better)
> >>
> >> Currently, ./gradlew jar gets me everything I need except for the
> external
> >> jar files of topic. I don't think a special task is needed for any of
> the
> >> Lucene .jar files. For the external ones, maybe ?
> >>
> >>> 2) a separate project that would include all of Lucene sources, build
> >> them
> >>> and prepare the above binaries,
> >>
> >> I don't think that one fits: I get the sources from git and build the
> >> Lucene jar files using Gradle's jar task.
> >>
> >>> 3) a separate project that would only depend on Lucene binaries and
> fetch
> >>> whatever else is needed based on POMs.
> >>
> >> I don't understand enough about POMs to know how to reply here. If this
> is
> >> what Ivy was doing for us until Lucene 8.x then, yes, something like
> that
> >> using Gradle that puts the external jars in a place I can access via a
> >> filesystem path would be great.
> >>
> >>> I haven't looked at PyLucene's makefiles but if you let me know which
> one
> >>> of the above works best for you, I'll prepare something on the gradle
> >> side.
> >>
> >> If you do something for one of the subprojects (say, the expressions
> one),
> >> I
> >> can then extend this to others as needed. From my newbie understanding
> of
> >> the Lucene Gradle build, I'd think that an extra task that "persists"
> the
> >> external jars somewhere accessible via a simple filesystem path usable
> >> from
> >> a Makefile (by simple I mean, not fishing them out of ~/.gradle) would
> be
> >> easiest to consume by the PyLucene build.
> >>
> >> Andi..
> >>
> >>>
> >>> Dawid
> >>>
> >>>
> >>> On Sat, Jan 1, 2022 at 6:37 PM Andi Vajda <[email protected]> wrote:
> >>>
> >>>>
> >>>> Thank you, Uwe.
> >>>>
> >>>> On Fri, 31 Dec 2021, Uwe Schindler wrote:
> >>>>
> >>>>> As a Gradle project you can depend on Lucene artifacts and use Gradle
> >>>> Apis
> >>>>> in your build files.
> >>>>
> >>>> Until 8.x, PyLucene is built via a Makefile that:
> >>>>    - calls Ant to build Lucene, building a bunch of jars individually
> >>>>    - calls Ant to build Lucene extensions (Java classes extending some
> >>>> Lucene
> >>>>      classes with native methods that are then implemented in Python)
> >>>>    - calls JCC to generate and compile C++/Python PyLucene
> >>>>
> >>>> Now, with the Lucene Gradle build, the Makefile:
> >>>>    - inserts the Lucene extension classes into Lucene's Gradle build
> >> via a
> >>>>      new subproject called 'extensions'
> >>>>    - calls Gradle to build all Lucene jars and the extra
> extensions.jar
> >> in
> >>>>      one command: ./gradlew jar
> >>>>    - calls JCC to generate and compile C++/Python PyLucene
> >>>>
> >>>> But the antlr, asm, asm-commons and hppc jar files are no longer
> >> available.
> >>>> They were made available via Ivy before, in the old Lucene ant build.
> >>>>
> >>>> As you suggested, fishing around ~/.gradle, I can find them all in
> there
> >>>> but
> >>>> that seems very brittle as there are multiple versions present there.
> >>>>
> >>>> If at all possible, I'd like to not create a Maven project (PyLucene
> is
> >>>> not
> >>>> a Java project), mess with pom.xml files or create a new Gradle
> project
> >>>> for
> >>>> PyLucene.
> >>>>
> >>>> But maybe I should actually create a new Gradle project for PyLucene
> >> that
> >>>> replaces its Makefile ? Or is there an easy way for me to request from
> >> the
> >>>> Lucene Gradle build that these external jar files be put somewhere
> more
> >>>> accessible ? Uwe, you say that they are present in the Luke .tgz ?
> What
> >> is
> >>>> the task that produces the Luke .tgz ? I might just be able to fish
> the
> >>>> .jar
> >>>> files out of it then. I tried assembleBinaryTgz but that only makes
> the
> >>>> Lucene one and assembleRelease fails for me on checkWorkingCopyClean
> >> since
> >>>> I
> >>>> have a bunch of changes not ready to be checked in...
> >>>>
> >>>> Thank you for your insights !
> >>>>
> >>>> Andi..
> >>>>
> >>>>> If you have the state of your work (do you use Gradle to build
> >> already?)
> >>>>> we may be able to help you. You may need to write a Gradle task that
> >>>> calls
> >>>>> your compiler. See ECJ (calls Java) or Changes2html (calls python)
> >> tasks
> >>>>> as examples.
> >>>>>
> >>>>> BTW, the jar files are hidden in the Gradle cache folder somewhere in
> >>>> your
> >>>>> home dir. Bit to access them you need Gradle Apis.
> >>>>>
> >>>>> Uwe
> >>>>>
> >>>>> Am 31. Dezember 2021 18:24:47 UTC schrieb Uwe Schindler <
> >> [email protected]
> >>>>> :
> >>>>>> Hi,
> >>>>>>
> >>>>>> The Lucene 9.0 binary tgz no longer contains 3rd party dependencies,
> >>>> unless they are needed to run Luke.
> >>>>>>
> >>>>>> Generally we expect people to parse the pom.xml files and download
> >>>> artifacts as part of a downstream build. If you are able to use Maven,
> >> I'd
> >>>> recommend to create a small Maven Java Project listing the Lucene
> >>>> dependencies and ask it to make a complete distribution.
> >>>>>>
> >>>>>> If you have the source distribution, I'd recommend to make pylucene
> >>>> also use Gradle to build and then you can consume dependencies.
> >>>>>>
> >>>>>> Uwe
> >>>>>>
> >>>>>> Am 31. Dezember 2021 18:12:55 UTC schrieb Andi Vajda <
> >> [email protected]
> >>>>> :
> >>>>>>>
> >>>>>>>  Hi,
> >>>>>>>
> >>>>>>> I've begun adapting PyLucene to Lucene 9.0 and switching it to
> using
> >>>> gradle.
> >>>>>>>
> >>>>>>> The expressions sub-project depends on antlr4 and asm and I'm able
> to
> >>>> build
> >>>>>>> all of Lucene 9.0 without explicitely downloading these jar files.
> >>>>>>>
> >>>>>>> The PyLucene build needs these jar files then to produce wrappers
> for
> >>>> the
> >>>>>>> entrypoints into the expressions sub-project classes.
> >>>>>>>
> >>>>>>> Where are these jar files stored ?
> >>>>>>> $ find lucene-java-9.0.0 -name '*.jar' | grep antlr
> >>>>>>> produces nothing.
> >>>>>>>
> >>>>>>> Thanks !
> >>>>>>>
> >>>>>>> Andi..
> >>>>>>>
> >>>>>>>
> ---------------------------------------------------------------------
> >>>>>>> To unsubscribe, e-mail: [email protected]
> >>>>>>> For additional commands, e-mail: [email protected]
> >>>>>>>
> >>>>>>
> >>>>>> --
> >>>>>> Uwe Schindler
> >>>>>> Achterdiek 19, 28357 Bremen
> >>>>>> https://www.thetaphi.de
> >>>>> --
> >>>>> Uwe Schindler
> >>>>> Achterdiek 19, 28357 Bremen
> >>>>> https://www.thetaphi.de
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: [email protected]
> >>>> For additional commands, e-mail: [email protected]
> >>>>
> >>>>
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [email protected]
> >> For additional commands, e-mail: [email protected]
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to