use of org.gradle.internal.execution.BuildOutputCleanupRegistry in project gradle by gradle.
the class DefaultBuildWorkPreparer method finalizeWorkGraph.
@Override
public void finalizeWorkGraph(GradleInternal gradle, ExecutionPlan plan) {
TaskExecutionGraphInternal taskGraph = gradle.getTaskGraph();
taskGraph.populate(plan);
BuildOutputCleanupRegistry buildOutputCleanupRegistry = gradle.getServices().get(BuildOutputCleanupRegistry.class);
buildOutputCleanupRegistry.resolveOutputs();
}
use of org.gradle.internal.execution.BuildOutputCleanupRegistry in project gradle by gradle.
the class LifecycleBasePlugin method addClean.
private void addClean(final ProjectInternal project) {
Provider<Directory> buildDir = project.getLayout().getBuildDirectory();
// Register at least the project buildDir as a directory to be deleted.
final BuildOutputCleanupRegistry buildOutputCleanupRegistry = project.getServices().get(BuildOutputCleanupRegistry.class);
buildOutputCleanupRegistry.registerOutputs(buildDir);
final Provider<Delete> clean = project.getTasks().register(CLEAN_TASK_NAME, Delete.class, cleanTask -> {
cleanTask.setDescription("Deletes the build directory.");
cleanTask.setGroup(BUILD_GROUP);
cleanTask.delete(buildDir);
});
buildOutputCleanupRegistry.registerOutputs(clean.map(cl -> cl.getTargetFiles()));
}
use of org.gradle.internal.execution.BuildOutputCleanupRegistry in project gradle by gradle.
the class JavaPlugin method apply.
@Override
public void apply(final Project project) {
if (project.getPluginManager().hasPlugin("java-platform")) {
throw new IllegalStateException("The \"java\" or \"java-library\" plugin cannot be applied together with the \"java-platform\" plugin. " + "A project is either a platform or a library but cannot be both at the same time.");
}
final ProjectInternal projectInternal = (ProjectInternal) project;
project.getPluginManager().apply(JavaBasePlugin.class);
project.getPluginManager().apply("org.gradle.jvm-test-suite");
JavaPluginExtension javaExtension = project.getExtensions().getByType(JavaPluginExtension.class);
projectInternal.getServices().get(ComponentRegistry.class).setMainComponent(new BuildableJavaComponentImpl(project, javaExtension));
BuildOutputCleanupRegistry buildOutputCleanupRegistry = projectInternal.getServices().get(BuildOutputCleanupRegistry.class);
SourceSet mainSourceSet = javaExtension.getSourceSets().create(SourceSet.MAIN_SOURCE_SET_NAME);
configureSourceSets(project, javaExtension, buildOutputCleanupRegistry, mainSourceSet);
configureConfigurations(project, javaExtension, mainSourceSet);
configureJavadocTask(project, javaExtension);
configureArchivesAndComponent(project, javaExtension);
configureBuild(project);
}
Aggregations