use of org.gradle.tooling.internal.protocol.events.InternalOperationDescriptor in project intellij-community by JetBrains.
the class GradleProgressEventConverter method convert.
@NotNull
public static ExternalSystemTaskNotificationEvent convert(ExternalSystemTaskId id, ProgressEvent event) {
final InternalOperationDescriptor internalDesc = event.getDescriptor() instanceof DefaultOperationDescriptor ? ((DefaultOperationDescriptor) event.getDescriptor()).getInternalOperationDescriptor() : null;
final String eventId = internalDesc == null ? event.getDescriptor().getDisplayName() : internalDesc.getId().toString();
final String parentEventId;
if (event.getDescriptor().getParent() == null) {
parentEventId = null;
} else {
parentEventId = internalDesc == null ? event.getDescriptor().getParent().getDisplayName() : internalDesc.getParentId().toString();
}
final String description = event.getDescriptor().getName();
if (event instanceof StartEvent) {
final OperationDescriptor descriptor = convert(event.getDescriptor(), event.getEventTime());
return new ExternalSystemTaskExecutionEvent(id, new ExternalSystemStartEventImpl<>(eventId, parentEventId, descriptor));
} else if (event instanceof FinishEvent) {
final OperationDescriptor descriptor = convert(event.getDescriptor(), event.getEventTime());
return new ExternalSystemTaskExecutionEvent(id, new ExternalSystemFinishEventImpl<>(eventId, parentEventId, descriptor, convert(((FinishEvent) event).getResult())));
} else if (event instanceof TaskProgressEvent) {
final OperationDescriptor descriptor = convert(event.getDescriptor(), event.getEventTime());
return new ExternalSystemTaskExecutionEvent(id, new BaseExternalSystemProgressEvent<>(eventId, parentEventId, descriptor));
} else {
return new ExternalSystemTaskNotificationEvent(id, description);
}
}
use of org.gradle.tooling.internal.protocol.events.InternalOperationDescriptor in project gradle by gradle.
the class TransformOperationMapper method createDescriptor.
@Override
public DefaultTransformDescriptor createDescriptor(ExecuteScheduledTransformationStepBuildOperationDetails details, BuildOperationDescriptor buildOperation, @Nullable OperationIdentifier parent) {
OperationIdentifier id = buildOperation.getId();
String displayName = buildOperation.getDisplayName();
String transformerName = details.getTransformerName();
String subjectName = details.getSubjectName();
Set<InternalOperationDescriptor> dependencies = operationDependenciesResolver.resolveDependencies(details.getTransformationNode());
DefaultTransformDescriptor descriptor = new DefaultTransformDescriptor(id, displayName, parent, transformerName, subjectName, dependencies);
descriptors.put(details.getTransformationNode(), descriptor);
return descriptor;
}
use of org.gradle.tooling.internal.protocol.events.InternalOperationDescriptor in project gradle by gradle.
the class TaskOperationMapper method createDescriptor.
@Override
public DefaultTaskDescriptor createDescriptor(ExecuteTaskBuildOperationDetails details, BuildOperationDescriptor buildOperation, @Nullable OperationIdentifier parent) {
OperationIdentifier id = buildOperation.getId();
String taskIdentityPath = buildOperation.getName();
String displayName = buildOperation.getDisplayName();
String taskPath = details.getTask().getIdentityPath().getPath();
Set<InternalOperationDescriptor> dependencies = operationDependenciesResolver.resolveDependencies(details.getTaskNode());
InternalPluginIdentifier originPlugin = taskOriginTracker.getOriginPlugin(details.getTask().getTaskIdentity());
DefaultTaskDescriptor descriptor = new DefaultTaskDescriptor(id, taskIdentityPath, taskPath, displayName, parent, dependencies, originPlugin);
descriptors.put(details.getTask().getTaskIdentity(), descriptor);
return descriptor;
}
Aggregations