using System; using System.Collections.Generic; using UnityEditor.Build.Content; using UnityEditor.Build.Pipeline.Utilities; namespace UnityEditor.Build.Pipeline.Interfaces { /// /// Base interface for the Build Caching /// public interface IBuildCache : IContextObject { /// /// Gets a CacheEntry for an asset identified by its GUID. /// /// GUID identifier for an asset from the Asset Database /// Version number of the system asking for an entry to distinguish it from previous incompatible entries. (Optional) /// CacheEntry representing current asset. CacheEntry GetCacheEntry(GUID asset, int version = 1); /// /// Gets a CacheEntry for a file identified by its relative path. /// /// Relative path of a file on disk /// Version number of the system asking for an entry to distinguish it from previous incompatible entries. (Optional) /// CacheEntry representing a file on disk. CacheEntry GetCacheEntry(string path, int version = 1); /// /// Gets a CacheEntry for an object identified by an Object Identifier. /// /// Object identifier for an object /// Version number of the system asking for an entry to distinguish it from previous incompatible entries. (Optional) /// CacheEntry representing an object identifier. CacheEntry GetCacheEntry(ObjectIdentifier objectID, int version = 1); /// /// Gets a CacheEntry for a scripting type by a System.Type. /// /// System.Type for a scripting type /// Version number of the system asking for an entry to distinguish it from previous incompatible entries. (Optional) /// CacheEntry representing an object identifier. CacheEntry GetCacheEntry(Type type, int version = 1); /// /// Checks if the CachedInfo passed in needs to be rebuilt /// /// Cached Info to check /// true if the cached info needs to be rebuilt; otherwise, false. bool HasAssetOrDependencyChanged(CachedInfo info); /// /// Returns the path where info data can be saved in the cache /// /// Cache entry to get the path /// Path on disk where to save cached info string GetCachedInfoFile(CacheEntry entry); /// /// Returns the path where artifact data can be saved in the cache /// /// Cache entry to get the path /// Path on disk where to save cached artifacts string GetCachedArtifactsDirectory(CacheEntry entry); /// /// Loads a set of CachedInfos from the cache /// /// List of cache entries to load /// Out list of cached infos loaded void LoadCachedData(IList entries, out IList cachedInfos); /// /// Saves a set of CachedInfos to the cache /// /// List of cached infos to save void SaveCachedData(IList infos); } }