how to exclude transitive dependencies using gradl...
# gradle
o
how to exclude transitive dependencies using gradle plugin? I am doing
add("implementation", project.lib("androidx.compose.constraintlayout"))
but want to exclude certain transitive dependencies
v
What is
project.lib(...)
and more importantly, what does it return, and why don't you use version catalogs?
o
the project.lib is part of an extension function that uses version catelog
v
Ah, ok, so what does it return?
o
Copy code
Provider<MinimalExternalModuleDependency>
v
Hm, it seems there is an overload missing for
add
that takes a provider and a configuration for an external module dependency. You should probably open an issue or PR for it if there is none yet.
You can work-around it by
add("implementation", project.lib("androidx.compose.constraintlayout").get()) { ... }
Or by
Copy code
val implementation by configurations.getting
implementation(project.lib("androidx.compose.constraintlayout")) { ... }
o
Screenshot 2023-04-10 at 2.46.52 PM.png
v
Import the right
add
function?
org.gradle.kotlin.dsl.add
o
the add is a
DependencyHandler
function
Screenshot 2023-04-10 at 2.49.19 PM.png
v
The wrong one, yes