Use an anonymous inner class instead of lambda for UP-TO-DATE support

This commit is contained in:
Mark Vieira 2019-05-31 16:34:16 -07:00
parent 3a00d08c50
commit 9fdae169ac
No known key found for this signature in database
GPG Key ID: CA947EF7E6D4B105
1 changed files with 7 additions and 1 deletions

View File

@ -23,6 +23,7 @@ import org.gradle.api.Action;
import org.gradle.api.NamedDomainObjectContainer;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.Task;
import org.gradle.api.UnknownTaskException;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.artifacts.ConfigurationContainer;
@ -165,7 +166,12 @@ public class JdkDownloadPlugin implements Plugin<Project> {
}
String extractDir = rootProject.getBuildDir().toPath().resolve("jdks/openjdk-" + jdkVersion + "_" + platform).toString();
TaskProvider<Copy> extractTask = rootProject.getTasks().register(extractTaskName, Copy.class, copyTask -> {
copyTask.doFirst(t -> rootProject.delete(extractDir));
copyTask.doFirst(new Action<Task>() {
@Override
public void execute(Task t) {
rootProject.delete(extractDir);
}
});
copyTask.into(extractDir);
copyTask.from(fileGetter, removeRootDir);
});