use of org.gradle.api.internal.file.IdentityFileResolver in project gradle by gradle.
the class CommandLineActionFactory method createActionFactories.
protected void createActionFactories(ServiceRegistry loggingServices, Collection<CommandLineAction> actions) {
actions.add(new GuiActionsFactory());
actions.add(new BuildActionsFactory(loggingServices, new ParametersConverter(), new CachingJvmVersionDetector(new DefaultJvmVersionDetector(new DefaultExecActionFactory(new IdentityFileResolver())))));
}
use of org.gradle.api.internal.file.IdentityFileResolver in project gradle by gradle.
the class CurrentProcess method inferJvmOptions.
private static JvmOptions inferJvmOptions() {
// Try to infer the effective jvm options for the currently running process.
// We only care about 'managed' jvm args, anything else is unimportant to the running build
JvmOptions jvmOptions = new JvmOptions(new IdentityFileResolver());
jvmOptions.setAllJvmArgs(ManagementFactory.getRuntimeMXBean().getInputArguments());
return jvmOptions;
}
use of org.gradle.api.internal.file.IdentityFileResolver in project gradle by gradle.
the class BuildProcess method configureForBuild.
/**
* Attempts to configure the current process to run with the required build parameters.
* @return True if the current process could be configured, false otherwise.
*/
public boolean configureForBuild(DaemonParameters requiredBuildParameters) {
boolean javaHomeMatch = getJvm().equals(requiredBuildParameters.getEffectiveJvm());
final JvmOptions jvmOptions = new JvmOptions(new IdentityFileResolver());
jvmOptions.systemProperties(getJvmOptions().getImmutableSystemProperties());
List<String> currentImmutables = jvmOptions.getAllImmutableJvmArgs();
List<String> requiredImmutables = requiredBuildParameters.getEffectiveSingleUseJvmArgs();
requiredImmutables.removeAll(DaemonParameters.DEFAULT_JVM_ARGS);
boolean noImmutableJvmArgsRequired = requiredImmutables.equals(currentImmutables);
if (javaHomeMatch && noImmutableJvmArgsRequired) {
// Set the system properties and use this process
Properties properties = new Properties();
properties.putAll(requiredBuildParameters.getEffectiveSystemProperties());
System.setProperties(properties);
return true;
}
return false;
}
Aggregations