Skip to content

Commit

Permalink
feat: isRequiredBy changed in order not to break configuration avoi…
Browse files Browse the repository at this point in the history
…dance (#356)
  • Loading branch information
gmazzo authored May 9, 2022
1 parent a3a9e1d commit c4a7e8e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,11 @@ class TasksConfigurator {
void isRequiredByCore(Task task, boolean fromConfigure) {
task.dependsOn upTask
task.finalizedBy downTask
project.tasks.findAll { Task.class.isAssignableFrom(it.class) && ((Task) it).name.toLowerCase().contains('classes') }
.each { classesTask ->
if (fromConfigure) {
upTask.get().shouldRunAfter classesTask
} else {
upTask.configure { it.shouldRunAfter classesTask }
}
}
if (fromConfigure) {
upTask.get().shouldRunAfter task.taskDependencies
} else {
upTask.configure { it.shouldRunAfter task.taskDependencies }
}
if (task instanceof ProcessForkOptions) task.doFirst { composeSettings.exposeAsEnvironment(task as ProcessForkOptions) }
if (task instanceof JavaForkOptions) task.doFirst { composeSettings.exposeAsSystemProperties(task as JavaForkOptions) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class DockerComposePluginTest extends Specification {
when:
project.dockerCompose.isRequiredBy(project.tasks.test)
then:
project.tasks.composeUp.shouldRunAfter.mutableValues.any { it == project.tasks.testClasses }
project.tasks.composeUp.shouldRunAfter.getDependencies(null).any { it == project.tasks.testClasses }
noExceptionThrown()
}
Expand Down

0 comments on commit c4a7e8e

Please sign in to comment.