Search in sources :

Example 1 with DefaultTaskExecutionRequest

use of org.gradle.internal.DefaultTaskExecutionRequest in project gradle by gradle.

the class ProviderStartParameterConverter method unpack.

private List<TaskExecutionRequest> unpack(final List<InternalLaunchable> launchables, File projectDir) {
    // Important that the launchables are unpacked on the client side, to avoid sending back any additional internal state that
    // the launchable may hold onto. For example, GradleTask implementations hold onto every task for every project in the build
    List<TaskExecutionRequest> requests = new ArrayList<TaskExecutionRequest>(launchables.size());
    for (InternalLaunchable launchable : launchables) {
        if (launchable instanceof TaskExecutionRequest) {
            TaskExecutionRequest originalLaunchable = (TaskExecutionRequest) launchable;
            TaskExecutionRequest launchableImpl = new DefaultTaskExecutionRequest(originalLaunchable.getArgs(), originalLaunchable.getProjectPath(), originalLaunchable.getRootDir());
            requests.add(launchableImpl);
        } else {
            throw new InternalUnsupportedBuildArgumentException("Problem with provided launchable arguments: " + launchables + ". " + "\nOnly objects from this provider can be built.");
        }
    }
    return requests;
}
Also used : DefaultTaskExecutionRequest(org.gradle.internal.DefaultTaskExecutionRequest) TaskExecutionRequest(org.gradle.TaskExecutionRequest) DefaultTaskExecutionRequest(org.gradle.internal.DefaultTaskExecutionRequest) ArrayList(java.util.ArrayList) InternalUnsupportedBuildArgumentException(org.gradle.tooling.internal.protocol.exceptions.InternalUnsupportedBuildArgumentException) InternalLaunchable(org.gradle.tooling.internal.protocol.InternalLaunchable)

Example 2 with DefaultTaskExecutionRequest

use of org.gradle.internal.DefaultTaskExecutionRequest in project gradle by gradle.

the class ProviderStartParameterConverter method unpack.

private List<TaskExecutionRequest> unpack(final List<InternalLaunchable> launchables) {
    // Important that the launchables are unpacked on the client side, to avoid sending back any additional internal state that
    // the launchable may hold onto. For example, GradleTask implementations hold onto every task for every project in the build
    List<TaskExecutionRequest> requests = new ArrayList<TaskExecutionRequest>(launchables.size());
    for (InternalLaunchable launchable : launchables) {
        if (launchable instanceof TaskExecutionRequest) {
            TaskExecutionRequest originalLaunchable = (TaskExecutionRequest) launchable;
            TaskExecutionRequest launchableImpl = new DefaultTaskExecutionRequest(originalLaunchable.getArgs(), originalLaunchable.getProjectPath(), originalLaunchable.getRootDir());
            requests.add(launchableImpl);
        } else {
            throw new InternalUnsupportedBuildArgumentException("Problem with provided launchable arguments: " + launchables + ". " + "\nOnly objects from this provider can be built.");
        }
    }
    return requests;
}
Also used : DefaultTaskExecutionRequest(org.gradle.internal.DefaultTaskExecutionRequest) TaskExecutionRequest(org.gradle.TaskExecutionRequest) DefaultTaskExecutionRequest(org.gradle.internal.DefaultTaskExecutionRequest) ArrayList(java.util.ArrayList) InternalUnsupportedBuildArgumentException(org.gradle.tooling.internal.protocol.exceptions.InternalUnsupportedBuildArgumentException) InternalLaunchable(org.gradle.tooling.internal.protocol.InternalLaunchable)

Aggregations

ArrayList (java.util.ArrayList)2 TaskExecutionRequest (org.gradle.TaskExecutionRequest)2 DefaultTaskExecutionRequest (org.gradle.internal.DefaultTaskExecutionRequest)2 InternalLaunchable (org.gradle.tooling.internal.protocol.InternalLaunchable)2 InternalUnsupportedBuildArgumentException (org.gradle.tooling.internal.protocol.exceptions.InternalUnsupportedBuildArgumentException)2