use of org.gradle.initialization.BuildLayoutParameters in project intellij-community by JetBrains.
the class IdeaGradleSystemSettingsControlBuilder method deduceServiceDirectory.
private static void deduceServiceDirectory(@NotNull TextFieldWithBrowseButton serviceDirectoryPathField) {
File gradleUserHomeDir = new BuildLayoutParameters().getGradleUserHomeDir();
serviceDirectoryPathField.setText(FileUtil.toSystemIndependentName(gradleUserHomeDir.getPath()));
serviceDirectoryPathField.getTextField().setForeground(LocationSettingType.DEDUCED.getColor());
}
use of org.gradle.initialization.BuildLayoutParameters in project gradle by gradle.
the class ShutdownCoordinator method stop.
public void stop() {
ServiceRegistry clientServices = clientFactory.createStopDaemonServices(outputEventListener, new DaemonParameters(new BuildLayoutParameters()));
DaemonStopClient client = clientServices.get(DaemonStopClient.class);
client.gracefulStop(daemons);
}
use of org.gradle.initialization.BuildLayoutParameters in project gradle by gradle.
the class BuildLayoutConverter method convert.
public BuildLayoutResult convert(InitialProperties systemProperties, ParsedCommandLine commandLine, @Nullable File workingDir, Consumer<BuildLayoutParameters> defaults) {
BuildLayoutParameters layoutParameters = new BuildLayoutParameters();
if (workingDir != null) {
layoutParameters.setCurrentDir(workingDir);
}
defaults.accept(layoutParameters);
Map<String, String> requestedSystemProperties = systemProperties.getRequestedSystemProperties();
new BuildLayoutParametersBuildOptions().propertiesConverter().convert(requestedSystemProperties, layoutParameters);
buildLayoutConverter.convert(commandLine, layoutParameters);
return new Result(layoutParameters);
}
use of org.gradle.initialization.BuildLayoutParameters in project gradle by gradle.
the class LayoutToPropertiesConverter method convert.
public AllProperties convert(InitialProperties initialProperties, BuildLayoutResult layout) {
BuildLayoutParameters layoutParameters = new BuildLayoutParameters();
layout.applyTo(layoutParameters);
Map<String, String> properties = new HashMap<>();
configureFromHomeDir(layoutParameters.getGradleInstallationHomeDir(), properties);
configureFromBuildDir(layoutParameters.getSearchDir(), properties);
configureFromHomeDir(layout.getGradleUserHomeDir(), properties);
configureFromSystemPropertiesOfThisJvm(Cast.uncheckedNonnullCast(properties));
properties.putAll(initialProperties.getRequestedSystemProperties());
return new Result(properties, initialProperties);
}
use of org.gradle.initialization.BuildLayoutParameters in project intellij-community by JetBrains.
the class GradleExecutionHelper method mergeJvmArgs.
private static List<String> mergeJvmArgs(String serviceDirectory, List<String> jvmArgs, Set<String> jvmArgsFromIdeSettings) {
File gradleUserHomeDir = serviceDirectory != null ? new File(serviceDirectory) : new BuildLayoutParameters().getGradleUserHomeDir();
LOG.debug("Gradle home: " + gradleUserHomeDir);
NativeServices.initialize(gradleUserHomeDir);
Map<String, String> mergedArgs = new LinkedHashMap<>();
for (String jvmArg : ContainerUtil.concat(jvmArgs, jvmArgsFromIdeSettings)) {
int i = jvmArg.indexOf('=');
if (i <= 0) {
mergedArgs.put(jvmArg, "");
} else {
mergedArgs.put(jvmArg.substring(0, i), jvmArg.substring(i));
}
}
List<String> mergedList = new ArrayList<>();
for (Map.Entry<String, String> entry : mergedArgs.entrySet()) {
mergedList.add(entry.getKey() + entry.getValue());
}
JvmOptions jvmOptions = new JvmOptions(null);
jvmOptions.setAllJvmArgs(mergedList);
return jvmOptions.getAllJvmArgs();
}
Aggregations