Skip to content

Commit

Permalink
Fixes #38
Browse files Browse the repository at this point in the history
  • Loading branch information
handstandsam committed Jun 8, 2022
1 parent 76c5837 commit 5328991
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,16 @@ public class DependencyGuardPlugin : Plugin<Project> {
)
}

private fun attachToCheckTask(target: Project, dependencyGuardTask: TaskProvider<DependencyGuardListTask>) {
// Required to add the "check" lifecycle task
target.plugins.apply(LifecycleBasePlugin::class.java)
private fun attachToCheckTask(
target: Project,
dependencyGuardTask: TaskProvider<DependencyGuardListTask>
) {
val checkTask = target.tasks.findByName(LifecycleBasePlugin.CHECK_TASK_NAME)

if (checkTask == null) {
// Add the "check" lifecycle task since it doesn't exist
target.plugins.apply(LifecycleBasePlugin::class.java)
}

// Attach the "dependencyGuard" task to the "check" lifecycle task
target.tasks.named(LifecycleBasePlugin.CHECK_TASK_NAME).configure {
Expand Down

0 comments on commit 5328991

Please sign in to comment.