/**
* Returns the default distribution to use for the specified project.
*/
public Distribution getDefaultDistribution(File projectDir, boolean searchUpwards) {
BuildLayout layout = new BuildLayoutFactory().getLayoutFor(projectDir, searchUpwards);
WrapperExecutor wrapper = WrapperExecutor.forProjectDirectory(layout.getRootDirectory(), System.out);
if (wrapper.getDistribution() != null) {
return new ZippedDistribution(wrapper.getConfiguration(), executorFactory);
}
return getDownloadedDistribution(GradleVersion.current().getVersion());
}