This message was deleted.
# community-support
s
This message was deleted.
e
other than trying to parse the build script manually of course
my idea so far is to “tag” dependencies added with the plugin using the
reason
field. don’t love that though.
c
Perhaps create a BuildService; have your custom plugin register “blessed” dependencies there. On build events (build services can listen to these events), grab the dependencies used in a project and compare them.
e
that’s kinda sorta what i tried first - except my own plugin adds the dependencies i want to prevent people from adding manually, so the plugin ended up reporting its own actions as invalid
is there a way to differentiate dependencies added in the buildscript vs added programmatically elsewhere?
c
If you implement the BuildService, it would have an
internal
(Kotlin) method for the plugin itself to register approved dependencies (hence restricting anyone else from registering approved dependencies), and either a listener or another method for projects (consumers of the plugin) to register what they actually used (this is where the comparison of approved / used would take place).
e
oh! this seems so obvious in retrospect.
thank you
i already had the internal method setup to tag the dependency. this is even easier.
👍 1