use of org.gradle.api.internal.GradleInternal in project gradle by gradle.
the class SelectedTaskExecutionAction method execute.
public void execute(BuildExecutionContext context) {
GradleInternal gradle = context.getGradle();
TaskGraphExecuter taskGraph = gradle.getTaskGraph();
if (gradle.getStartParameter().isContinueOnFailure()) {
taskGraph.useFailureHandler(new ContinueOnFailureHandler());
}
taskGraph.addTaskExecutionGraphListener(new BindAllReferencesOfProjectsToExecuteListener());
taskGraph.execute();
}
use of org.gradle.api.internal.GradleInternal in project gradle by gradle.
the class ClientProvidedBuildActionRunner method forceFullConfiguration.
private void forceFullConfiguration(GradleInternal gradle) {
try {
gradle.getServices().get(ProjectConfigurer.class).configureHierarchyFully(gradle.getRootProject());
for (IncludedBuild includedBuild : gradle.getIncludedBuilds()) {
GradleInternal build = ((IncludedBuildInternal) includedBuild).getConfiguredBuild();
forceFullConfiguration(build);
}
} catch (BuildCancelledException e) {
throw new InternalBuildCancelledException(e);
} catch (RuntimeException e) {
throw new BuildExceptionVersion1(e);
}
}
use of org.gradle.api.internal.GradleInternal in project gradle by gradle.
the class SubscribableBuildActionRunner method run.
@Override
public void run(BuildAction action, BuildController buildController) {
if (!(action instanceof SubscribableBuildAction)) {
return;
}
GradleInternal gradle = buildController.getGradle();
SubscribableBuildAction subscribableBuildAction = (SubscribableBuildAction) action;
// register listeners that dispatch all progress via the registered BuildEventConsumer instance,
// this allows to send progress events back to the DaemonClient (via short-cut)
registerListenersForClientSubscriptions(subscribableBuildAction.getClientSubscriptions(), gradle);
try {
delegate.run(action, buildController);
} finally {
for (BuildOperationListener listener : listeners) {
buildOperationService.removeListener(listener);
}
}
}
use of org.gradle.api.internal.GradleInternal in project gradle by gradle.
the class GradleBuildController method doBuild.
private GradleInternal doBuild(final Callable<GradleInternal> build) {
GradleInternal gradle = getGradle();
BuildOperationExecutor buildOperationExecutor = gradle.getServices().get(BuildOperationExecutor.class);
gradle.setBuildOperation(buildOperationExecutor.getCurrentOperation());
try {
// TODO:pm Move this to RunAsBuildOperationBuildActionRunner when BuildOperationWorkerRegistry scope is changed
return workerLeaseService.withLocks(Collections.singleton(workerLeaseService.getWorkerLease()), build);
} finally {
gradle.setBuildOperation(null);
state = State.Completed;
}
}
use of org.gradle.api.internal.GradleInternal in project gradle by gradle.
the class DefaultGradleLauncher method scheduleTasks.
@Override
public void scheduleTasks(final Iterable<String> taskPaths) {
GradleInternal gradle = getConfiguredBuild();
Set<String> allTasks = Sets.newLinkedHashSet(gradle.getStartParameter().getTaskNames());
boolean added = allTasks.addAll(Lists.newArrayList(taskPaths));
if (!added) {
return;
}
gradle.getStartParameter().setTaskNames(allTasks);
// Force back to configure so that task graph will get reevaluated
stage = Stage.Configure;
doBuildStages(Stage.TaskGraph);
}
Aggregations