Search in sources :

Example 1 with WrapperExecutor

use of org.gradle.wrapper.WrapperExecutor in project gradle by gradle.

the class DistributionFactory method getDefaultDistribution.

/**
 * 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());
    if (wrapper.getDistribution() != null) {
        return new ZippedDistribution(wrapper.getConfiguration(), distributionBaseDir, clock);
    }
    return getDownloadedDistribution(GradleVersion.current().getVersion());
}
Also used : WrapperExecutor(org.gradle.wrapper.WrapperExecutor) BuildLayoutFactory(org.gradle.initialization.layout.BuildLayoutFactory) BuildLayout(org.gradle.initialization.layout.BuildLayout)

Aggregations

BuildLayout (org.gradle.initialization.layout.BuildLayout)1 BuildLayoutFactory (org.gradle.initialization.layout.BuildLayoutFactory)1 WrapperExecutor (org.gradle.wrapper.WrapperExecutor)1