use of org.gradle.internal.file.RelativeFilePathResolver in project gradle by gradle.
the class BuildInitPlugin method apply.
@Override
public void apply(Project project) {
if (project.getParent() == null) {
project.getTasks().register("init", InitBuild.class, initBuild -> {
initBuild.setGroup("Build Setup");
initBuild.setDescription("Initializes a new Gradle build.");
RelativeFilePathResolver resolver = ((ProjectInternal) project).getFileResolver();
File buildFile = project.getBuildFile();
FileDetails buildFileDetails = FileDetails.of(buildFile, resolver);
File settingsFile = ((ProjectInternal) project).getGradle().getSettings().getSettingsScript().getResource().getLocation().getFile();
FileDetails settingsFileDetails = FileDetails.of(settingsFile, resolver);
initBuild.onlyIf(new InitBuildOnlyIfSpec(buildFileDetails, settingsFileDetails, initBuild.getLogger()));
initBuild.dependsOn(new InitBuildDependsOnCallable(buildFileDetails, settingsFileDetails));
ProjectInternal.DetachedResolver detachedResolver = ((ProjectInternal) project).newDetachedResolver();
initBuild.getProjectLayoutRegistry().getBuildConverter().configureClasspath(detachedResolver, project.getObjects());
initBuild.getInsecureProtocol().convention(InsecureProtocolOption.WARN);
});
}
}
Aggregations