public static void ExtractCommonCacheData(IBuildCache cache, IEnumerable <ObjectIdentifier> includedObjects, IEnumerable <ObjectIdentifier> referencedObjects, HashSet <Type> uniqueTypes, List <ObjectTypes> objectTypes, HashSet <CacheEntry> dependencies) { if (includedObjects != null) { foreach (var objectId in includedObjects) { var types = BuildCacheUtility.GetSortedUniqueTypesForObject(objectId); objectTypes.Add(new ObjectTypes(objectId, types)); uniqueTypes.UnionWith(types); } } if (referencedObjects != null) { foreach (var objectId in referencedObjects) { var types = BuildCacheUtility.GetSortedUniqueTypesForObject(objectId); objectTypes.Add(new ObjectTypes(objectId, types)); uniqueTypes.UnionWith(types); dependencies.Add(cache.GetCacheEntry(objectId)); } } dependencies.UnionWith(uniqueTypes.Select(cache.GetCacheEntry)); }