Thanks for digging, Dawid! I was not really aware of the choice of modes in
IntelliJ, but I think it is especially important for the "out of the box"
promise that the Gradle mode works? I'll try the patch and report back;
thanks again.

On Fri, Jun 3, 2022 at 4:04 AM Dawid Weiss <dawid.we...@gmail.com> wrote:

>
> This seems to work -
> https://github.com/apache/lucene/pull/945
>
> I have not tested extensively though and I think it is crucial that both
> "compilation modes" in intellij work. I'm in an out for the weekend but
> feedback would be welcome if the above patch works for people (it'd also
> simplify the gradle code).
>
> Dawid
>
> On Fri, Jun 3, 2022 at 9:54 AM Dawid Weiss <dawid.we...@gmail.com> wrote:
>
>>
>> Hmmm... I retried again and this time the gradle build (within intellij)
>> failed but the Idea one (that runs via generated ant tasks) passed. I can
>> also run (some) tests in this mode. Certain tests depend on resources that
>> live under java sources - these resources are not copied by intellij by
>> default so won't work.
>>
>> Back to "gradle" compilation mode - the gradle command IntelliJ uses to
>> compile sources fails there but succeeds if run from command line. I think
>> something has changed that interferes with what we have in modules.gradle -
>> there are conditional classpath settings there that were used to make
>> intellij compile the sources in modular mode. Something has changed and
>> this no longer works properly. This may be a trivial change somewhere but
>> it's a moving target, eh.
>>
>> Dawid
>>
>> On Fri, Jun 3, 2022 at 8:53 AM Dawid Weiss <dawid.we...@gmail.com> wrote:
>>
>>>
>>> Hi Mike,
>>>
>>> It used to work all right - something must have changed somewhere that
>>> caused this regression. :(
>>>
>>> I just reimported the latest main branch in IntelliJ with the default
>>> settings and it compiled fine -
>>>
>>> [image: image.png]
>>>
>>> This, I think, invokes gradle assemble which in turn causes many
>>> additional tasks to be invoked (like jar or javadocs). This can be improved
>>> - we don't need these tasks to be assembled in intellij compilation mode.
>>> It's hacky but I've done it in the past.
>>>
>>> When I switch to (my preferred) intellij compilation, things break. This
>>> is definitely a regression in IntelliJ somewhere because it used to work
>>> very recently - until the last update, I think. Everything in the module
>>> settings seems all right so I don't know...
>>>
>>> For now, the relatively easy workaround is to build and run via gradle
>>> but run tests using intellij (the dialog above). Should work.
>>>
>>> Dawid
>>>
>>>
>>> On Thu, Jun 2, 2022 at 4:44 PM Michael Sokolov <msoko...@gmail.com>
>>> wrote:
>>>
>>>> In IntelliJ building Lucene main branch I see this:
>>>>
>>>> .../workspace/lucene/lucene/core.tests/src/test/module-info.java:23:
>>>> error: module not found: org.apache.lucene.core.tests.main
>>>>   requires org.apache.lucene.core.tests.main;
>>>>                                        ^
>>>>
>>>> Am I doing it wrong? Does anybody else encounter this? I tried
>>>> re-importing the Gradle model, which succeeds, but then when I build
>>>> the project I get the above error.
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
>>>> For additional commands, e-mail: dev-h...@lucene.apache.org
>>>>
>>>>

Reply via email to