private HostCollection GetCollection() { var entry = new DomainEntry(this.BuildEngine4.ProjectFileOfTaskNode, Platform, SourceGenerators.Select(Path.GetFullPath).ToArray()); HostCollection collection = GetHost(entry); if (collection.IsInvalid) { Log.LogMessage("Discarding source generation host, generators files have been modified"); _domains.TryRemove(entry, out collection); UnloadHosts(collection); collection = GetHost(entry); } return(collection); }
private static HostCollection GetHost(DomainEntry entry) => _domains.TryGetValue(entry, out var hosts) ? hosts : _domains[entry] = new HostCollection(entry);