Allow a library to mark a dep as optional
tpetracca opened this issue · 1 comments
The persisted dep state we put in jars has no concept of optionality of deps and so we'd have to modify that (in addition to just updating the api the library interacts with)
// recording a relevant conversation from 9 months ago (largely from @CRogers)
I think it's technically possible (what isn't?) to build something like this:
recommendedProductDependencies {
optionalProductDependency('thing-service')
}
to use in a lib that would optionalise the pdep from depending on the thing-service api jar, but we would want to persist the information here as like a Set<OptionalPdeps>
We haven't configured ignoreUnknownProperties on the object mapper so adding it would break existing stuff
was done in #1280
this next section is likely the hard bit
We'd also have to get the plugin to do some sort of graph manipulation to understand that this optional marker ensures transitive deps that are only brought in by this dep are optional. Currently the code has no idea about this and just gathers everything
we have access to the gradle configuration to get the right info - but it's going to be some "fun" gradle code