Skip to content

Commit

Permalink
add configureEach for AbstractCompile
Browse files Browse the repository at this point in the history
  • Loading branch information
rpalcolea committed Nov 2, 2019
1 parent c0b7324 commit b96cc26
Showing 1 changed file with 23 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,29 @@ class GradleLintPluginTaskConfigurer extends AbstractLintPluginTaskConfigurer {
@Override
void wireJavaPlugin(Project project) {
project.plugins.withType(JavaBasePlugin) {
project.tasks.withType(AbstractCompile) { abstractCompileTask ->
project.rootProject.tasks.named(FIX_GRADLE_LINT).configure(new Action<Task>() {
@Override
void execute(Task fixGradleLintTask) {
fixGradleLintTask.dependsOn(abstractCompileTask)
}
})
project.rootProject.tasks.named(LINT_GRADLE).configure(new Action<Task>() {
@Override
void execute(Task lintGradleTask) {
lintGradleTask.dependsOn(abstractCompileTask)
}
})
project.rootProject.tasks.named(FIX_LINT_GRADLE).configure(new Action<Task>() {
@Override
void execute(Task fixLintGradleTask) {
fixLintGradleTask.dependsOn(abstractCompileTask)
}
})
}
project.tasks.withType(AbstractCompile).configureEach(new Action<AbstractCompile>() {
@Override
void execute(AbstractCompile abstractCompileTask) {
project.rootProject.tasks.named(FIX_GRADLE_LINT).configure(new Action<Task>() {
@Override
void execute(Task fixGradleLintTask) {
fixGradleLintTask.dependsOn(abstractCompileTask)
}
})
project.rootProject.tasks.named(LINT_GRADLE).configure(new Action<Task>() {
@Override
void execute(Task lintGradleTask) {
lintGradleTask.dependsOn(abstractCompileTask)
}
})
project.rootProject.tasks.named(FIX_LINT_GRADLE).configure(new Action<Task>() {
@Override
void execute(Task fixLintGradleTask) {
fixLintGradleTask.dependsOn(abstractCompileTask)
}
})
}
})
}
}

Expand Down

0 comments on commit b96cc26

Please sign in to comment.