Is there a way in gradle to remove a dependency fr...
# multiplatform
j
Is there a way in gradle to remove a dependency from a parent source set, with the goal to replace with another variant of the same library?
h
What about
exclude
?
j
My understanding of
exclude
is to be able to exclude a transitive dependency. Can it also remove a dependency not added as transitive?
I think I found a solution. If I declare the dependency as
compileOnly
in the parent source set, I can then add the appropriate variant in child source sets. The parent dependency is the desired dependency in one of the children, so I just re-add it as
api
.