예제 #1
0
        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);
        }
예제 #2
0
 private static HostCollection GetHost(DomainEntry entry)
 => _domains.TryGetValue(entry, out var hosts)
                 ? hosts
                 : _domains[entry] = new HostCollection(entry);