Slackbot
03/15/2023, 9:01 AMmelix
03/15/2023, 9:17 AMjacocoReport
, which has no dependency, so the dependsOn
wouldn't be executed. I think the reason it kind of works is because you use map
, which will trigger eager configuration of the test tasks.Jendrik Johannes
03/15/2023, 9:19 AMVampire
03/15/2023, 9:25 AMjacocoReport.executionData(project.tasks.withType(Test::class.java)
?Vampire
03/15/2023, 9:26 AM.all
on the given task collection, but at least it is more succinct and doesn't need an explicit dependsOn
Vampire
03/15/2023, 9:27 AMmustRunAfter
😞Vampire
03/15/2023, 9:29 AMval tests = project.tasks.withType(Test::class.java)
jacocoReport.executionData(tests)
jacocoReport.dependsOn(tests)
Vampire
03/15/2023, 9:30 AMmap
with all
in your version.Jendrik Johannes
03/15/2023, 9:30 AMjacocoReport.executionData(project.tasks.withType(Test::class.java))
Thanks!Vampire
03/15/2023, 9:30 AMJendrik Johannes
03/15/2023, 9:31 AMmelix
03/15/2023, 9:31 AMmelix
03/15/2023, 9:31 AMTest
to be the test reports...Jendrik Johannes
03/15/2023, 9:31 AMmelix
03/15/2023, 9:32 AMJendrik Johannes
03/15/2023, 9:32 AMVampire
03/15/2023, 9:32 AMpublic void executionData(TaskCollection tasks) {
tasks.all((Action<Task>) this::executionData);
}
and
public void executionData(Task... tasks) {
for (Task task : tasks) {
final JacocoTaskExtension extension = task.getExtensions().findByType(JacocoTaskExtension.class);
if (extension != null) {
executionData(new Callable<File>() {
@Override
public File call() {
return extension.getDestinationFile();
}
});
mustRunAfter(task);
}
}
}
melix
03/15/2023, 9:35 AMall
will eagerly configure 😞Jendrik Johannes
03/15/2023, 9:35 AMDefaultTaskCollection#all(Action) on task set cannot be executed in the current context.
This is pretty broken in the JacocoReportTask impl 😕Vampire
03/15/2023, 9:35 AMVampire
03/15/2023, 9:36 AMJendrik Johannes
03/15/2023, 11:12 AM