parser.option(CONFIGURE_ON_DEMAND).hasDescription("Only relevant projects are configured in this build run. This means faster build for large multi-project builds.").incubating();
}
public StartParameter convert(final ParsedCommandLine options, final StartParameter startParameter) throws CommandLineArgumentException {
loggingConfigurationCommandLineConverter.convert(options, startParameter);
Transformer<File, String> resolver = new BasicFileResolver(startParameter.getCurrentDir());
Map<String, String> systemProperties = systemPropertiesCommandLineConverter.convert(options, new HashMap<String, String>());
convertCommandLineSystemProperties(systemProperties, startParameter, resolver);
Map<String, String> projectProperties = projectPropertiesCommandLineConverter.convert(options, new HashMap<String, String>());
startParameter.getProjectProperties().putAll(projectProperties);
BuildLayoutParameters layout = new BuildLayoutParameters()
.setGradleUserHomeDir(startParameter.getGradleUserHomeDir())
.setProjectDir(startParameter.getProjectDir())
.setCurrentDir(startParameter.getCurrentDir());
layoutCommandLineConverter.convert(options, layout);
startParameter.setGradleUserHomeDir(layout.getGradleUserHomeDir());
if (layout.getProjectDir() != null) {
startParameter.setProjectDir(layout.getProjectDir());
}
startParameter.setSearchUpwards(layout.getSearchUpwards());
if (options.hasOption(BUILD_FILE)) {
startParameter.setBuildFile(resolver.transform(options.option(BUILD_FILE).getValue()));
}
if (options.hasOption(SETTINGS_FILE)) {
startParameter.setSettingsFile(resolver.transform(options.option(SETTINGS_FILE).getValue()));
}
for (String script : options.option(INIT_SCRIPT).getValues()) {
startParameter.addInitScript(resolver.transform(script));
}
if (options.hasOption(PROJECT_CACHE_DIR)) {
startParameter.setProjectCacheDir(resolver.transform(options.option(PROJECT_CACHE_DIR).getValue()));
}
if (options.hasOption(NO_PROJECT_DEPENDENCY_REBUILD)) {
startParameter.setBuildProjectDependencies(false);
}