This message was deleted.
# dependency-management
s
This message was deleted.
c
Perhaps check out the Nebula resolution rules plugin, specifically creating custom rules (JSON files) to reject, deny, substitute as appropriate. That’s a layer over the underlying Gradle APIs that can do the same thing.
c
hmmm… are dependency substitution rules idempotent/recursion safe? Seems like the friendly way to do this is to declare that the “banned thing” should be substituted for by the internal “blessed thing”?
c
yea. depends on the specifics - replace with a “good” version, substitute with a replacement, or outright fail.
c
regarding how to implement, my first instinct would be to reach for:
Copy code
configurations.all {
  incoming.beforeResolve { deps ->
    //some logic that interrogates deps
  }
}
but I’ve been burnt by trying to do clever things in beforeResolve before…
t
I appreciate the ideas, guys 🙂
👍 2
j
i have done
Copy code
project.configurations.findByName(
                    "implementation"
                )?.dependencies?.any { it.name == "library-name" } ?: false
1
that is in kotlin
m
Technically speaking, even if you look at first level dependencies, you will not know if they were declared in a build script or somewhere else (e.g in a plugin).
👍 1
j
Good point