Exemple #1
0
        private static IReadOnlySet <string> GetEmbedddedSourcePaths(CommandLineArguments arguments)
        {
            if (arguments.EmbeddedFiles.IsEmpty)
            {
                return(SpecializedCollections.EmptyReadOnlySet <string>());
            }

            // Note that we require an exact match between source and embedded file paths (case-sensitive
            // and without normalization). If two files are the same but spelled differently, they will
            // be handled as separate files, meaning the embedding pass will read the content a second
            // time. This can also lead to more than one document entry in the PDB for the same document
            // if the PDB document de-duping policy in emit (normalize + case-sensitive in C#,
            // normalize + case-insensitive in VB) is not enough to converge them.
            var set = new HashSet <string>(arguments.EmbeddedFiles.Select(f => f.Path));

            set.IntersectWith(arguments.SourceFiles.Select(f => f.Path));
            return(SpecializedCollections.StronglyTypedReadOnlySet(set));
        }