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.
Please sign in to leave a comment.
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.
>
>
>
>
>
--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
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?
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.
>
>
>
--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"