Allow Gradle to set dependency between Jar and ScanApi tasks. (#1962)

This commit is contained in:
Chris Rankin 2017-10-31 14:14:33 +00:00 committed by GitHub
parent 6ebba9dea1
commit 7f96205b99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,11 +32,11 @@ public class ApiScanner implements Plugin<Project> {
project.getLogger().info("Adding scanApi task to {}", project.getName());
project.getTasks().create("scanApi", ScanApi.class, scanTask -> {
scanTask.setClasspath(compilationClasspath(project.getConfigurations()));
// Automatically creates a dependency on jar tasks.
scanTask.setSources(project.files(jarTasks));
scanTask.setExcludeClasses(extension.getExcludeClasses());
scanTask.setVerbose(extension.isVerbose());
scanTask.setEnabled(extension.isEnabled());
scanTask.dependsOn(jarTasks);
// Declare this ScanApi task to be a dependency of any
// GenerateApi tasks belonging to any of our ancestors.