use of org.gradle.internal.progress.BuildOperationDetails in project gradle by gradle.
the class InProcessWorkerFactory method getWorker.
@Override
public Worker getWorker(Class<? extends WorkerProtocol> workerImplementationClass, File workingDir, final DaemonForkOptions forkOptions) {
return new Worker() {
@Override
public <T extends WorkSpec> DefaultWorkResult execute(WorkerAction<T> action, T spec) {
return execute(action, spec, buildOperationWorkerRegistry.getCurrent(), buildOperationExecutor.getCurrentOperation());
}
@Override
public <T extends WorkSpec> DefaultWorkResult execute(final WorkerAction<T> action, final T spec, Operation parentWorkerOperation, BuildOperationExecutor.Operation parentBuildOperation) {
BuildOperationWorkerRegistry.Completion workerLease = parentWorkerOperation.operationStart();
BuildOperationDetails buildOperation = BuildOperationDetails.displayName(action.getDisplayName()).parent(parentBuildOperation).build();
try {
return buildOperationExecutor.run(buildOperation, new Transformer<DefaultWorkResult, BuildOperationContext>() {
@Override
public DefaultWorkResult transform(BuildOperationContext buildOperationContext) {
return executeInWorkerClassLoader(action, spec, forkOptions);
}
});
} finally {
workerLease.operationFinish();
}
}
};
}
use of org.gradle.internal.progress.BuildOperationDetails in project gradle by gradle.
the class WorkerDaemonClient method execute.
@Override
public <T extends WorkSpec> DefaultWorkResult execute(final WorkerAction<T> action, final T spec, Operation parentWorkerOperation, BuildOperationExecutor.Operation parentBuildOperation) {
Completion workerLease = parentWorkerOperation.operationStart();
BuildOperationDetails buildOperation = BuildOperationDetails.displayName(action.getDisplayName()).parent(parentBuildOperation).build();
try {
return buildOperationExecutor.run(buildOperation, new Transformer<DefaultWorkResult, BuildOperationContext>() {
@Override
public DefaultWorkResult transform(BuildOperationContext buildOperationContext) {
uses++;
return workerDaemonProcess.execute(action, spec);
}
});
} finally {
workerLease.operationFinish();
}
}
use of org.gradle.internal.progress.BuildOperationDetails in project gradle by gradle.
the class InitScriptHandler method executeScripts.
public void executeScripts(final GradleInternal gradle) {
final List<File> initScripts = gradle.getStartParameter().getAllInitScripts();
if (initScripts.isEmpty()) {
return;
}
BuildOperationDetails operationDetails = BuildOperationDetails.displayName("Run init scripts").progressDisplayName("init scripts").build();
buildOperationExecutor.run(operationDetails, new Action<BuildOperationContext>() {
@Override
public void execute(BuildOperationContext buildOperationContext) {
for (File script : initScripts) {
processor.process(new UriScriptSource("initialization script", script), gradle);
}
}
});
}
use of org.gradle.internal.progress.BuildOperationDetails in project gradle by gradle.
the class BuildOperationExternalResource method createBuildOperationDetails.
private BuildOperationDetails createBuildOperationDetails() {
ExternalResourceMetaData metaData = getMetaData();
DownloadBuildOperationDescriptor downloadBuildOperationDescriptor = new DownloadBuildOperationDescriptor(metaData.getLocation(), metaData.getContentLength(), metaData.getContentType());
BuildOperationDetails buildOperationDetails = BuildOperationDetails.displayName("Download " + metaData.getLocation().toString()).parent(buildOperationExecutor.getCurrentOperation()).operationDescriptor(downloadBuildOperationDescriptor).build();
return buildOperationDetails;
}
Aggregations