Search in sources :

Example 1 with FileCollectionFingerprint

use of org.gradle.internal.fingerprint.FileCollectionFingerprint in project gradle by gradle.

the class DefaultPreviousExecutionStateSerializer method readFingerprints.

private ImmutableSortedMap<String, FileCollectionFingerprint> readFingerprints(Decoder decoder) throws Exception {
    int count = decoder.readSmallInt();
    ImmutableSortedMap.Builder<String, FileCollectionFingerprint> builder = ImmutableSortedMap.naturalOrder();
    for (int fingerprintIdx = 0; fingerprintIdx < count; fingerprintIdx++) {
        String property = decoder.readString();
        FileCollectionFingerprint fingerprint = fileCollectionFingerprintSerializer.read(decoder);
        builder.put(property, fingerprint);
    }
    return builder.build();
}
Also used : ImmutableSortedMap(com.google.common.collect.ImmutableSortedMap) FileCollectionFingerprint(org.gradle.internal.fingerprint.FileCollectionFingerprint) FileCollectionFingerprint(org.gradle.internal.fingerprint.FileCollectionFingerprint)

Example 2 with FileCollectionFingerprint

use of org.gradle.internal.fingerprint.FileCollectionFingerprint in project gradle by gradle.

the class DefaultInputFileChanges method accept.

@Override
public boolean accept(String propertyName, ChangeVisitor visitor) {
    CurrentFileCollectionFingerprint currentFileCollectionFingerprint = current.get(propertyName);
    FileCollectionFingerprint previousFileCollectionFingerprint = previous.get(propertyName);
    FingerprintCompareStrategy compareStrategy = determineCompareStrategy(currentFileCollectionFingerprint);
    return compareStrategy.visitChangesSince(previousFileCollectionFingerprint, currentFileCollectionFingerprint, TITLE, visitor);
}
Also used : CurrentFileCollectionFingerprint(org.gradle.internal.fingerprint.CurrentFileCollectionFingerprint) FileCollectionFingerprint(org.gradle.internal.fingerprint.FileCollectionFingerprint) CurrentFileCollectionFingerprint(org.gradle.internal.fingerprint.CurrentFileCollectionFingerprint)

Example 3 with FileCollectionFingerprint

use of org.gradle.internal.fingerprint.FileCollectionFingerprint in project gradle by gradle.

the class DefaultPreviousExecutionStateSerializer method read.

@Override
public PreviousExecutionState read(Decoder decoder) throws Exception {
    OriginMetadata originMetadata = new OriginMetadata(decoder.readString(), Duration.ofMillis(decoder.readLong()));
    ImplementationSnapshot taskImplementation = implementationSnapshotSerializer.read(decoder);
    // We can't use an immutable list here because some hashes can be null
    int taskActionsCount = decoder.readSmallInt();
    ImmutableList.Builder<ImplementationSnapshot> taskActionImplementationsBuilder = ImmutableList.builder();
    for (int j = 0; j < taskActionsCount; j++) {
        ImplementationSnapshot actionImpl = implementationSnapshotSerializer.read(decoder);
        taskActionImplementationsBuilder.add(actionImpl);
    }
    ImmutableList<ImplementationSnapshot> taskActionImplementations = taskActionImplementationsBuilder.build();
    ImmutableSortedMap<String, ValueSnapshot> inputProperties = readInputProperties(decoder);
    ImmutableSortedMap<String, FileCollectionFingerprint> inputFilesFingerprints = readFingerprints(decoder);
    ImmutableSortedMap<String, FileSystemSnapshot> outputFilesSnapshots = readSnapshots(decoder);
    boolean successful = decoder.readBoolean();
    return new DefaultPreviousExecutionState(originMetadata, taskImplementation, taskActionImplementations, inputProperties, inputFilesFingerprints, outputFilesSnapshots, successful);
}
Also used : ValueSnapshot(org.gradle.internal.snapshot.ValueSnapshot) ImmutableList(com.google.common.collect.ImmutableList) OriginMetadata(org.gradle.caching.internal.origin.OriginMetadata) FileCollectionFingerprint(org.gradle.internal.fingerprint.FileCollectionFingerprint) FileSystemSnapshot(org.gradle.internal.snapshot.FileSystemSnapshot) FileCollectionFingerprint(org.gradle.internal.fingerprint.FileCollectionFingerprint) ImplementationSnapshot(org.gradle.internal.snapshot.impl.ImplementationSnapshot)

Aggregations

FileCollectionFingerprint (org.gradle.internal.fingerprint.FileCollectionFingerprint)3 ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableSortedMap (com.google.common.collect.ImmutableSortedMap)1 OriginMetadata (org.gradle.caching.internal.origin.OriginMetadata)1 CurrentFileCollectionFingerprint (org.gradle.internal.fingerprint.CurrentFileCollectionFingerprint)1 FileSystemSnapshot (org.gradle.internal.snapshot.FileSystemSnapshot)1 ValueSnapshot (org.gradle.internal.snapshot.ValueSnapshot)1 ImplementationSnapshot (org.gradle.internal.snapshot.impl.ImplementationSnapshot)1