extra-java-module-info icon indicating copy to clipboard operation
extra-java-module-info copied to clipboard

Configuration options to (de)activate the plugin for selected Configurations and Source Sets

Open tg-freigmbh opened this issue 6 months ago • 5 comments

Hello. So A bit of context: I am pulling artifacts together, so they can be put in a native (outside of gradle) installer. I am doing this using a configuration, and adding the dependencies to the configuration. Now I still need to add the extraJavaModuleInfo to project, or else I will untransformed jars without jpms infos and that wont work.

However the plugin currently only registers itself with configurations that are related to sourceSets my configurations isnt related to one.. After skimming through the code it seems there is an Attribute "javaModules" of type Boolean, so I thought maybe i can use that.


val gimme by configurations.registering{
    isCanBeConsumed=false
    attributes{
        attribute(Attribute.of("javaModule", Boolean::class.java),true )

Howerver that gives me

Build file 'G:\development\java21\blub\zInstaller\Setup-JournalReportingTool2\External-Artifacts\build.gradle.kts' line: 9

Could not create domain object 'gimme' (Configuration)
> Unexpected type for attribute 'javaModule' provided. Expected a value of type boolean but found a value of type java.lang.Boolean.

And it seems like kotlins boolean handling is an absolute nightmare and there is no way to get a correct primitive java boolean... as a workaround i am gonna try to add an empty dummy sourceset tomorrow and see if that gets me somewhere . Best regards

tg-freigmbh avatar Jul 29 '24 15:07 tg-freigmbh