Little help about BuildParticipant

Hi,

I'm trying to understand how to properly use the BuildParticipant interface.

I'm writing a plugin which generates a custom MANIFEST.MF file during the build, for some of the modules, based on some criteria. As far as I could tell, the best way to do this is to implement BuildParticipantProvider which returns a BuildParticipant instance for each participating module.

But my BuildParticipant instance is called more than once for each module, and I'm trying to understand why - have I mis-understood the purpose of BuildParticipant?

Any help would be appreciated,
  Arik.

3 comments
Comment actions Permalink

Hello,

do not use BuildParticipant. This class is obsolete and will be removed in future IDEA versions.
You can use SourceGeneratingCompiler instead. It will generate files in a temp directory and include that directory as additional source root for a
module so generated MANIFEST.MF file will be copied to module output by resource compiler. Implementation of SourceGeneratingCompiler need to be
registered as 'compiler' extension in plugin.xml.

Hi,

>

I'm trying to understand how to properly use the BuildParticipant interface.

>

I'm writing a plugin which generates a custom MANIFEST.MF file during the build, for some of the modules, based on some criteria. As far as I could tell, the best way to do this is to implement BuildParticipantProvider which returns a BuildParticipant instance for each participating module.

>

But my BuildParticipant instance is called more than once for each module, and I'm trying to understand why - have I mis-understood the purpose of BuildParticipant?

>

Any help would be appreciated,
   Arik.

>

---
Original message URL: http://devnet.jetbrains.net/message/5281474#5281474



--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Hi Nikolay,

Thanks for the tip. My manifest generator, however, generates it from the compiled source code, and therefor needs to occur after compilation. I was thinking about using ClassPostProcessingCompiler.

Out of the processing items returned by the 'getProcessingItems(CompileContext)' method in my compiler, which ones will be passed to the 'process(CompileContext,ProcessingItem[])' method?

0
Comment actions Permalink

IDEA passes to 'process' method items changed after the previous compilation. It uses item.getValidityState().equalsTo(prevState) method to determine
whether an item is changed.

Hi Nikolay,

>

Thanks for the tip. My manifest generator, however, generates it from the compiled source code, and therefor needs to occur after compilation. I was thinking about using ClassPostProcessingCompiler.

>

Out of the processing items returned by the 'getProcessingItems(CompileContext)' method in my compiler, which ones will be passed to the 'process(CompileContext,ProcessingItem[])' method?

>

---
Original message URL: http://devnet.jetbrains.net/message/5281502#5281502



--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Please sign in to leave a comment.