Java Code Examples for org.gradle.StartParameter#getBuildFile()
The following examples show how to use
org.gradle.StartParameter#getBuildFile() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SettingsHandler.java From pushfish-android with BSD 2-Clause "Simplified" License | 6 votes |
public SettingsInternal findAndLoadSettings(GradleInternal gradle) { StartParameter startParameter = gradle.getStartParameter(); SettingsInternal settings = findSettingsAndLoadIfAppropriate(gradle, startParameter); ProjectSpec spec = ProjectSpecs.forStartParameter(startParameter, settings); if (spec.containsProject(settings.getProjectRegistry())) { setDefaultProject(spec, settings); return settings; } // Try again with empty settings StartParameter noSearchParameter = startParameter.newInstance(); noSearchParameter.useEmptySettings(); settings = findSettingsAndLoadIfAppropriate(gradle, noSearchParameter); // Set explicit build file, if required if (noSearchParameter.getBuildFile() != null) { ProjectDescriptor rootProject = settings.getRootProject(); rootProject.setBuildFileName(noSearchParameter.getBuildFile().getName()); } setDefaultProject(spec, settings); return settings; }
Example 2
Source File: SettingsHandler.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 6 votes |
public SettingsInternal findAndLoadSettings(GradleInternal gradle) { StartParameter startParameter = gradle.getStartParameter(); SettingsInternal settings = findSettingsAndLoadIfAppropriate(gradle, startParameter); ProjectSpec spec = ProjectSpecs.forStartParameter(startParameter, settings); if (spec.containsProject(settings.getProjectRegistry())) { setDefaultProject(spec, settings); return settings; } // Try again with empty settings StartParameter noSearchParameter = startParameter.newInstance(); noSearchParameter.useEmptySettings(); settings = findSettingsAndLoadIfAppropriate(gradle, noSearchParameter); // Set explicit build file, if required if (noSearchParameter.getBuildFile() != null) { ProjectDescriptor rootProject = settings.getRootProject(); rootProject.setBuildFileName(noSearchParameter.getBuildFile().getName()); } setDefaultProject(spec, settings); return settings; }
Example 3
Source File: GradleParameters.java From gradle-metrics-plugin with Apache License 2.0 | 6 votes |
public static GradleParameters fromGradle(org.gradle.api.invocation.Gradle gradle) { StartParameter start = gradle.getStartParameter(); List<KeyValue> projectProperties = KeyValue.mapToKeyValueList(start.getProjectProperties()); return new GradleParameters(start.getTaskRequests(), start.getExcludedTaskNames(), start.isBuildProjectDependencies(), start.getCurrentDir(), start.getProjectDir(), projectProperties, start.getGradleUserHomeDir(), start.getSettingsFile(), start.getBuildFile(), start.getInitScripts(), start.isDryRun(), start.isRerunTasks(), start.isProfile(), start.isContinueOnFailure(), start.isOffline(), start.getProjectCacheDir(), start.isRefreshDependencies(), start.getMaxWorkerCount(), start.isConfigureOnDemand() ); }
Example 4
Source File: ProjectSpecs.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
static ProjectSpec forStartParameter(StartParameter startParameter, SettingsInternal settings) { File explicitProjectDir = startParameter.getProjectDir(); File explicitBuildFile = startParameter.getBuildFile(); if (explicitBuildFile != null) { return new BuildFileProjectSpec(explicitBuildFile); } if (explicitProjectDir != null) { return new ProjectDirectoryProjectSpec(explicitProjectDir); } return new DefaultProjectSpec(startParameter.getCurrentDir(), settings); }
Example 5
Source File: ProjectSpecs.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
static ProjectSpec forStartParameter(StartParameter startParameter) { String explicitProjectPath = startParameter.getProjectPath(); File explicitProjectDir = startParameter.getProjectDir(); File explicitBuildFile = startParameter.getBuildFile(); ProjectSpec spec = explicitProjectPath != null ? new ProjectPathProjectSpec(explicitProjectPath) : explicitBuildFile != null ? new BuildFileProjectSpec(explicitBuildFile) : explicitProjectDir == null ? new DefaultProjectSpec(startParameter.getCurrentDir()) : new ProjectDirectoryProjectSpec(explicitProjectDir); return spec; }
Example 6
Source File: ProjectSpecs.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
static ProjectSpec forStartParameter(StartParameter startParameter, SettingsInternal settings) { File explicitProjectDir = startParameter.getProjectDir(); File explicitBuildFile = startParameter.getBuildFile(); if (explicitBuildFile != null) { return new BuildFileProjectSpec(explicitBuildFile); } if (explicitProjectDir != null) { return new ProjectDirectoryProjectSpec(explicitProjectDir); } return new DefaultProjectSpec(startParameter.getCurrentDir(), settings); }
Example 7
Source File: ProjectSpecs.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
static ProjectSpec forStartParameter(StartParameter startParameter) { String explicitProjectPath = startParameter.getProjectPath(); File explicitProjectDir = startParameter.getProjectDir(); File explicitBuildFile = startParameter.getBuildFile(); ProjectSpec spec = explicitProjectPath != null ? new ProjectPathProjectSpec(explicitProjectPath) : explicitBuildFile != null ? new BuildFileProjectSpec(explicitBuildFile) : explicitProjectDir == null ? new DefaultProjectSpec(startParameter.getCurrentDir()) : new ProjectDirectoryProjectSpec(explicitProjectDir); return spec; }