static void ExtractMetaToCache( List <ChangeInfo> changes, Dictionary <string, ChangeInfo> cache) { HashSet <string> indexedPaths = BuildIndexedPathsForChanges(changes); for (int i = changes.Count - 1; i >= 0; i--) { ChangeInfo currentChange = changes[i]; if (!MetaPath.IsMetaPath(currentChange.Path)) { continue; } string realPath = MetaPath.GetPathFromMetaPath(currentChange.Path); if (!indexedPaths.Contains(BuildKey.BuildCacheKey( currentChange.ChangeTypes, realPath))) { continue; } // found foo.c and foo.c.meta // with the same chage types - move .meta to cache cache.Add(BuildKey.ForChange(currentChange), currentChange); changes.RemoveAt(i); } }
static HashSet <string> BuildIndexedPathsForChanges( List <ChangeInfo> changes) { HashSet <string> result = new HashSet <string>(); foreach (ChangeInfo change in changes) { if (MetaPath.IsMetaPath(change.Path)) { continue; } result.Add(BuildKey.ForChange(change)); } return(result); }
static void SetupTokenFile(bool isEdition, string editionTokenFile) { if (isEdition && !File.Exists(editionTokenFile)) { File.Create(editionTokenFile).Dispose(); return; } if (!isEdition && File.Exists(editionTokenFile)) { File.Delete(editionTokenFile); string metaPath = MetaPath.GetMetaPath(editionTokenFile); if (File.Exists(metaPath)) { File.Delete(metaPath); } return; } }
internal static string ForMetaChange(ChangeInfo change) { return(BuildCacheKey( change.ChangeTypes, MetaPath.GetMetaPath(change.Path))); }