-
Notifications
You must be signed in to change notification settings - Fork 660
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
Added exclude rule with dependsOn #6343
base: main
Are you sure you want to change the base?
Conversation
@NaveenPokhriyal: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/ |
Thanks for opening this 🙏 That's a fair point and something that was indeed lost in v4. I'm a bit wary of adding too many options there since the dependency resolution APIs in Gradle are probably more than just exclude, we might want to revert to a single configuration per service that is extended by all the other ones. Out of curiosity, what's the use case? I didn't expect dependency conflicts to happen there. |
So we have a common module which basicaly inherit a schema module as an dependency so whenever we are publishing the common module metadata it also including metadata info of parenet schema module.
https://docs.gradle.org/current/dsl/org.gradle.api.publish.maven.MavenPublication.html so to resolve this issue earlier i used to exclude parent schema module from the artifact but with V4 i can't do it anymore. |
So your setup is looking like so? common/build.gradle.kts dependencies {
implementation(project(":schema"))
}
apollo {
service("service") {
dependsOn(project(":schema"))
}
} schema/build.gradle.kts apollo {
service("service") {
generateApolloMetadata.set(true)
}
} If yes then you'll need to publish both |
Yes we have similar setup but common does not dependsOn the schema. |
So then there is no need to exclude it or is there? FWIW, I think you have a good idea and allowing to customize dependency resolution in general is a good idea but doing it in a future-proof way might take a bit of design time and I'm trying to understand if there's a way you could have your setup working without this. |
Yes that issue is there cause of that dependency. but i have a local workaround for this. |
Erlier with version 3 we have control over depencies which to include or exclude for apollometadata however it's not the case with newer version of apollo that's why adding support for excluding dependencies from the metadata.
ex : Apollo V3
Apollo V4 : with this implementation