Similar methods in ModuleBuildProperties and BuildProvider

Why there are similar methods in ModuleBuildProperties and BuildProvider (getBuildConfigurable and getBuildParticipants)? When methods of ModuleBuildProperties are invoked? Is it correct to delegate from them to appropriate BuildProvider?

14 comments
Comment actions Permalink

BuildProvider delegates to ModuleBuildProperties, so it's more right to
implement something in ModuleBuildProperties. J2EEBuildParticipant's are
also collected from module components that implement this interface.
getBuildParticipants() is called on Java EE module build.
getBuildConfigurable() is now called only in our internal EJB, JavaEE
application and Web module settings editors (see
ModuleConfigurationEditorProvider), so it's up to you when to call them.

"Marat Radchenko" <valder@yandex.ru> wrote in message
news:1639341.1163792283978.JavaMail.itn@is.intellij.net...

Why there are similar methods in ModuleBuildProperties and BuildProvider
(getBuildConfigurable and getBuildParticipants)? When methods of
ModuleBuildProperties are invoked? Is it correct to delegate from them to
appropriate BuildProvider?



0
Comment actions Permalink

BuildProvider delegates to ModuleBuildProperties, so
it's more right to
implement something in ModuleBuildProperties.

No, it does not delegate :) It's up to module type developer to write a BuildProvider.
Will ModuleBuildProperties#getBuildParticipant be invoked from IDEA code?

J2EEBuildParticipant's are
also collected from module components that implement
this interface.

Hmm... Could you provide more info on this?

getBuildParticipants() is called on Java EE module
build.

As I've understood, this method is called upon building of any module type.

getBuildConfigurable() is now called only in our
internal EJB, JavaEE
application and Web module settings editors (see
ModuleConfigurationEditorProvider), so it's up to you
when to call them.

So it will never be invoked for my module type?
OK, then I'll throw UnsupportedOperationException :)

0
Comment actions Permalink

>> BuildProvider delegates to ModuleBuildProperties, so
>> it's more right to
>> implement something in ModuleBuildProperties.

No, it does not delegate :) It's up to module type developer to write a
BuildProvider.
Will ModuleBuildProperties#getBuildParticipant be invoked from IDEA code?

Oh, yes, more precisely, it's DefaultBuildProvider that does the delegation.
It also collects module components.

>> J2EEBuildParticipant's are
>> also collected from module components that implement
>> this interface.

Hmm... Could you provide more info on this?

module.getComponents(J2EEBuildParticipant.class), and then append to this
array the participant from ModuleBuildProperties.

>
>> getBuildParticipants() is called on Java EE module
>> build.

As I've understood, this method is called upon building of any module
type.

For any module type where isJ2EE() is true.

>> getBuildConfigurable() is now called only in our
>> internal EJB, JavaEE
>> application and Web module settings editors (see
>> ModuleConfigurationEditorProvider), so it's up to you
>> when to call them.

So it will never be invoked for my module type?
OK, then I'll throw UnsupportedOperationException :)

Yes


0
Comment actions Permalink

BTW, there will be another (similar, but simpler) API for the same things in
6.5

"Marat Radchenko" <valder@yandex.ru> wrote in message
news:22745560.1163845966755.JavaMail.itn@is.intellij.net...
>> BuildProvider delegates to ModuleBuildProperties, so
>> it's more right to
>> implement something in ModuleBuildProperties.

No, it does not delegate :) It's up to module type developer to write a
BuildProvider.
Will ModuleBuildProperties#getBuildParticipant be invoked from IDEA code?

>
>> J2EEBuildParticipant's are
>> also collected from module components that implement
>> this interface.

Hmm... Could you provide more info on this?

>
>> getBuildParticipants() is called on Java EE module
>> build.

As I've understood, this method is called upon building of any module
type.

>
>> getBuildConfigurable() is now called only in our
>> internal EJB, JavaEE
>> application and Web module settings editors (see
>> ModuleConfigurationEditorProvider), so it's up to you
>> when to call them.

So it will never be invoked for my module type?
OK, then I'll throw UnsupportedOperationException :)



0
Comment actions Permalink

Hmm... isJ2EE() == true??? Then how modules with isJ2EE() == false are built?

0
Comment actions Permalink

DefaultBuildProvider is good. And is there DefaultBuildDescriptor? :)
My plugin contains several module types and it seems to me I have to make N absolutely identical BuildDescriptors, which differ only in component name. Not very beautiful. Or, maybe, there is some way to attach one module component to several module types?

Currently I have:

com.intellij.javaee.make.ModuleBuildDescriptor com.mycompany.AModuleBuildDescriptor com.intellij.javaee.make.ModuleBuildDescriptor com.mycompany.BModuleBuildDescriptor ]]>

0
Comment actions Permalink

DefaultBuildProvider is good. And is there DefaultBuildDescriptor? :)
My plugin contains several module types and it seems to me I have to make N absolutely identical BuildDescriptors, which differ only in component name. Not very beautiful. Or, maybe, there is some way to attach one module component to several module types?

Currently I have:

com.intellij.javaee.make.ModuleBuildDescriptor com.mycompany.AModuleBuildDescriptor com.intellij.javaee.make.ModuleBuildDescriptor com.mycompany.BModuleBuildDescriptor ]]>

0
Comment actions Permalink

DefaultBuildProvider is good. And is there DefaultBuildDescriptor? :)
My plugin contains several module types and it seems to me I have to make N absolutely identical BuildDescriptors, which differ only in component name. Not very beautiful. Or, maybe, there is some way to attach one module component to several module types?

Currently I have:

com.intellij.javaee.make.ModuleBuildDescriptor com.mycompany.AModuleBuildDescriptor com.intellij.javaee.make.ModuleBuildDescriptor com.mycompany.BModuleBuildDescriptor ]]>

0
Comment actions Permalink

Damn :) it wasn't intentional :)

0
Comment actions Permalink

Hmm... isJ2EE() == true??? Then how modules with isJ2EE() == false are
built?

As usual. Without all this jar packing and copying stuff.


0
Comment actions Permalink

DefaultBuildProvider is good. And is there DefaultBuildDescriptor? :)

J2EEModuleBuildDescriptor seems to be very default. Absolutely empty.

My plugin contains several module types and it seems to me I have to make
N absolutely identical BuildDescriptors, which differ only in component
name. Not very beautiful. Or, maybe, there is some way to attach one
module component to several module types?

>

Currently I have:

>

<module-components>
<component>

<interface-class>com.intellij.javaee.make.ModuleBuildDescriptor</interface-class>

<implementation-class>com.mycompany.AModuleBuildDescriptor</implementation-class>
<option name="type" value="A_MODULE" />
</component>
<component>

<interface-class>com.intellij.javaee.make.ModuleBuildDescriptor</interface-class>

<implementation-class>com.mycompany.BModuleBuildDescriptor</implementation-class>
<option name="type" value="B_MODULE" />
</component>
</module-components>


You can write

com.intellij.javaee.make.ModuleBuildDescriptor com.mycompany.ModuleBuildDescriptor ]]>


0
Comment actions Permalink

J2EEModuleBuildDescriptor seems to be very default.
Absolutely empty.

I love it :) Somehow skipped it when was searching.

You can write
<option name="type" value="A_MODULE;B_MODULE" />

Thanks. Hope this will go into docs so others will know that there is such useful feature.

0
Comment actions Permalink

I disagree :) I have module type with isJ2EE() == false and all the same machinery is invoked for it (BuildProvider & friends). Actually I don't see difference at this point between J2EE and not-J2EE module type. Have I missed something?

0
Comment actions Permalink

Oh yes... It wasn't very evident from the code, sorry. I think that it's
more bug than feature.

"Marat Radchenko" <valder@yandex.ru> wrote in message
news:23135466.1164052294154.JavaMail.itn@is.intellij.net...
>I disagree :) I have module type with isJ2EE() == false and all the same
>machinery is invoked for it (BuildProvider & friends). Actually I don't see
>difference at this point between J2EE and not-J2EE module type. Have I
>missed something?


0

Please sign in to leave a comment.