Search in sources :

Example 1 with ForegroundDaemonAction

use of org.gradle.launcher.daemon.bootstrap.ForegroundDaemonAction in project gradle by gradle.

the class BuildActionsFactory method createAction.

public Runnable createAction(CommandLineParser parser, ParsedCommandLine commandLine) {
    Parameters parameters = parametersConverter.convert(commandLine, new Parameters());
    parameters.getDaemonParameters().applyDefaultsFor(jvmVersionDetector.getJavaVersion(parameters.getDaemonParameters().getEffectiveJvm()));
    if (parameters.getDaemonParameters().isStop()) {
        return stopAllDaemons(parameters.getDaemonParameters(), loggingServices);
    }
    if (parameters.getDaemonParameters().isStatus()) {
        return showDaemonStatus(parameters.getDaemonParameters(), loggingServices);
    }
    if (parameters.getDaemonParameters().isForeground()) {
        DaemonParameters daemonParameters = parameters.getDaemonParameters();
        ForegroundDaemonConfiguration conf = new ForegroundDaemonConfiguration(UUID.randomUUID().toString(), daemonParameters.getBaseDir(), daemonParameters.getIdleTimeout(), daemonParameters.getPeriodicCheckInterval());
        return new ForegroundDaemonAction(loggingServices, conf);
    }
    if (parameters.getDaemonParameters().isEnabled()) {
        return runBuildWithDaemon(parameters.getStartParameter(), parameters.getDaemonParameters(), loggingServices);
    }
    if (canUseCurrentProcess(parameters.getDaemonParameters())) {
        return runBuildInProcess(parameters.getStartParameter(), parameters.getDaemonParameters(), loggingServices);
    }
    return runBuildInSingleUseDaemon(parameters.getStartParameter(), parameters.getDaemonParameters(), loggingServices);
}
Also used : ForegroundDaemonConfiguration(org.gradle.launcher.daemon.configuration.ForegroundDaemonConfiguration) ForegroundDaemonAction(org.gradle.launcher.daemon.bootstrap.ForegroundDaemonAction) DaemonParameters(org.gradle.launcher.daemon.configuration.DaemonParameters) BuildActionParameters(org.gradle.launcher.exec.BuildActionParameters) DefaultBuildActionParameters(org.gradle.launcher.exec.DefaultBuildActionParameters) DaemonParameters(org.gradle.launcher.daemon.configuration.DaemonParameters)

Aggregations

ForegroundDaemonAction (org.gradle.launcher.daemon.bootstrap.ForegroundDaemonAction)1 DaemonParameters (org.gradle.launcher.daemon.configuration.DaemonParameters)1 ForegroundDaemonConfiguration (org.gradle.launcher.daemon.configuration.ForegroundDaemonConfiguration)1 BuildActionParameters (org.gradle.launcher.exec.BuildActionParameters)1 DefaultBuildActionParameters (org.gradle.launcher.exec.DefaultBuildActionParameters)1