I thought I'd open a new issue for this one :)
It would be handy if you could just pass the task you want to run as an command-line argument. That way you can run multiple tasks with this plugin via CI.
private String getPathToTask(Project project) {
String taskToRun = Extensions
.getTaskToRunParameter(project)
.orElse(extension.getTaskToRun().getOrNull());
if (project.isRootProject()) {
return String.format(":%s", taskToRun);
} else {
return String.format("%s:%s", project.getPath(), taskToRun);
}
}
public static Optional<String> getTaskToRunParameter(Project project) {
return Optional.of(project)
.map(Project::getRootProject)
.map(p -> p.findProperty(TASK_TO_RUN))
.map(String.class::cast);
}
Not tested yet and not sure if this works.