dropbox / dependency-guard

A Gradle plugin that guards against unintentional dependency changes.
Apache License 2.0
406 stars 15 forks source link

Hook dependency guard task automatically into check task #30

Closed vanniktech closed 2 years ago

vanniktech commented 2 years ago

What's your opinion on this? So far this isn't done yet:

./gradlew -m check | grep "dependencyGuard" returns nothing

vanniktech commented 2 years ago

Currently, I'm doing:

tasks.named("check").configure {
  it.dependsOn(tasks.named("dependencyGuard"))
}
handstandsam commented 2 years ago

I'm not opposed to it, but am not sure what other libraries do this? Do you know of any plugins that add to the check task? If it is a common thing, I can run it by a few others and we could consider.

@autonomousapps any thoughts on this idea?

handstandsam commented 2 years ago

Found this which suggests we should add it to check.

https://tomgregory.com/gradle-check-task-essentials/

autonomousapps commented 2 years ago

I agree it's fairly common. As a counter-example, my plugin doesn't do this because the analysis it does is far too expensive; and it's also easy for consumers to hook that up if they want. I can't think of any reasons for you not to do it.

vanniktech commented 2 years ago

AGP / Java Plugins hook their test tasks automatically into check. Android also does it for the integration tests.

Since dependency guard is fast, I'd add it to the check task.

handstandsam commented 2 years ago

Sounds great. I'll add this to the next version milestone 0.3.0 so it gets in. Should be a trivial code change 👍

Great suggestion!

handstandsam commented 2 years ago

This is now part of 0.3.0 which I just kicked off the publishing job for with the @vanniktech plugin 😄