use of org.gradle.internal.id.UniqueId in project gradle by gradle.
the class TaskOutputOriginFactory method createReader.
public TaskOutputOriginReader createReader(final TaskInternal task) {
return new TaskOutputOriginReader() {
@Override
public OriginTaskExecutionMetadata execute(InputStream inputStream) {
// TODO: Replace this with something better
Properties properties = new Properties();
try {
properties.load(inputStream);
} catch (IOException e) {
throw UncheckedException.throwAsUncheckedException(e);
}
if (!properties.stringPropertyNames().containsAll(METADATA_KEYS)) {
throw new IllegalStateException("Cached result format error, corrupted origin metadata.");
}
LOGGER.info("Origin for {}: {}", task, properties);
UniqueId originBuildInvocationId = UniqueId.from(properties.getProperty(BUILD_INVOCATION_ID_KEY));
long originalExecutionTime = Long.parseLong(properties.getProperty(EXECUTION_TIME_KEY));
return new OriginTaskExecutionMetadata(originBuildInvocationId, originalExecutionTime);
}
};
}
use of org.gradle.internal.id.UniqueId in project gradle by gradle.
the class ExecuteTaskBuildOperationResult method getOriginBuildInvocationId.
@Nullable
@Override
public String getOriginBuildInvocationId() {
OriginTaskExecutionMetadata originExecutionMetadata = ctx.getOriginExecutionMetadata();
UniqueId originBuildInvocationId = originExecutionMetadata == null ? null : originExecutionMetadata.getBuildInvocationId();
return originBuildInvocationId == null ? null : originBuildInvocationId.asString();
}
Aggregations