Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow a library to mark a dep as optional #1208

Open
tpetracca opened this issue Sep 23, 2021 · 1 comment
Open

Allow a library to mark a dep as optional #1208

tpetracca opened this issue Sep 23, 2021 · 1 comment

Comments

@tpetracca
Copy link
Contributor

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)

@tpetracca
Copy link
Contributor Author

// 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant