Search in sources :

Example 6 with FileType

use of org.gradle.internal.file.FileType in project gradle by gradle.

the class NormalizedPathFingerprintCompareStrategy method modified.

private static Change modified(String propertyTitle, FileType previousFingerprintType, String normalizedPath, FilePathWithType modifiedFile) {
    String absolutePath = modifiedFile.getAbsolutePath();
    FileType fileType = modifiedFile.getFileType();
    return DefaultFileChange.modified(absolutePath, propertyTitle, previousFingerprintType, fileType, normalizedPath);
}
Also used : FileType(org.gradle.internal.file.FileType)

Example 7 with FileType

use of org.gradle.internal.file.FileType in project gradle by gradle.

the class FingerprintMapSerializer method readFingerprint.

private FileSystemLocationFingerprint readFingerprint(Decoder decoder) throws IOException {
    FileType fileType = readFileType(decoder);
    HashCode contentHash = readContentHash(fileType, decoder);
    byte fingerprintKind = decoder.readByte();
    switch(fingerprintKind) {
        case DEFAULT_NORMALIZATION:
            String normalizedPath = decoder.readString();
            return new DefaultFileSystemLocationFingerprint(stringInterner.intern(normalizedPath), fileType, contentHash);
        case IGNORED_PATH_NORMALIZATION:
            return IgnoredPathFileSystemLocationFingerprint.create(fileType, contentHash);
        default:
            throw new RuntimeException("Unable to read serialized file fingerprint. Unrecognized value found in the data stream.");
    }
}
Also used : HashCode(org.gradle.internal.hash.HashCode) FileType(org.gradle.internal.file.FileType) DefaultFileSystemLocationFingerprint(org.gradle.internal.fingerprint.impl.DefaultFileSystemLocationFingerprint)

Aggregations

FileType (org.gradle.internal.file.FileType)7 FileSystemLocationFingerprint (org.gradle.internal.fingerprint.FileSystemLocationFingerprint)3 ListMultimap (com.google.common.collect.ListMultimap)1 MultimapBuilder (com.google.common.collect.MultimapBuilder)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Map (java.util.Map)1 Entry (java.util.Map.Entry)1 Entry.comparingByKey (java.util.Map.Entry.comparingByKey)1 Optional (java.util.Optional)1 Set (java.util.Set)1 DefaultFileSystemLocationFingerprint (org.gradle.internal.fingerprint.impl.DefaultFileSystemLocationFingerprint)1 HashCode (org.gradle.internal.hash.HashCode)1