Search in sources :

Example 1 with BuildLayout

use of org.gradle.initialization.layout.BuildLayout 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)

Example 2 with BuildLayout

use of org.gradle.initialization.layout.BuildLayout in project gradle by gradle.

the class BuildSessionScopeServices method createCacheLayout.

ProjectCacheDir createCacheLayout(StartParameter startParameter, BuildLayoutFactory buildLayoutFactory) {
    BuildLayout buildLayout = buildLayoutFactory.getLayoutFor(new BuildLayoutConfiguration(startParameter));
    File cacheDir = startParameter.getProjectCacheDir() != null ? startParameter.getProjectCacheDir() : new File(buildLayout.getRootDirectory(), ".gradle");
    return new ProjectCacheDir(cacheDir);
}
Also used : BuildLayoutConfiguration(org.gradle.initialization.layout.BuildLayoutConfiguration) File(java.io.File) BuildLayout(org.gradle.initialization.layout.BuildLayout) ProjectCacheDir(org.gradle.initialization.layout.ProjectCacheDir)

Example 3 with BuildLayout

use of org.gradle.initialization.layout.BuildLayout in project gradle by gradle.

the class LayoutToPropertiesConverter method configureFromBuildDir.

private void configureFromBuildDir(File currentDir, boolean searchUpwards, Map<String, String> result) {
    BuildLayout layout = buildLayoutFactory.getLayoutFor(currentDir, searchUpwards);
    maybeConfigureFrom(new File(layout.getRootDirectory(), Project.GRADLE_PROPERTIES), result);
}
Also used : File(java.io.File) BuildLayout(org.gradle.initialization.layout.BuildLayout)

Aggregations

BuildLayout (org.gradle.initialization.layout.BuildLayout)3 File (java.io.File)2 BuildLayoutConfiguration (org.gradle.initialization.layout.BuildLayoutConfiguration)1 BuildLayoutFactory (org.gradle.initialization.layout.BuildLayoutFactory)1 ProjectCacheDir (org.gradle.initialization.layout.ProjectCacheDir)1 WrapperExecutor (org.gradle.wrapper.WrapperExecutor)1