101 references to CacheFormat
Microsoft.NET.ProjectData.Tasks (101)
ForwardCompat.cs (17)
37 private static readonly HashSet<string> KnownSections = new HashSet<string>(CacheFormat.Sections.All, StringComparer.Ordinal); 53 foreach (KeyValuePair<string, string[]> entry in CacheFormat.Sections.MetadataBySection) 202 if (line[0] != CacheFormat.CommentChar) 338 if (line[0] != (byte)CacheFormat.CommentChar) 448 pendingUnknownSections.Add(CacheFormat.SectionHeader(section.Name)); 501 Section? existingProps = existing.Sections.FirstOrDefault(s => s.Name == CacheFormat.Sections.Properties); 516 Section? candidateProps = candidate.Sections.FirstOrDefault(s => s.Name == CacheFormat.Sections.Properties); 521 Section? anchorSection = candidate.Sections.FirstOrDefault(s => s.Name == CacheFormat.Sections.SliceDimensions) 522 ?? candidate.Sections.FirstOrDefault(s => s.Name == CacheFormat.Sections.Project) 525 var block = new List<string> { string.Empty, CacheFormat.SectionHeader(CacheFormat.Sections.Properties) }; 576 if (existingSection.Name is CacheFormat.Sections.Project 577 or CacheFormat.Sections.SliceDimensions 578 or CacheFormat.Sections.Properties) 655 bool atSeparator = i < lines.Length && Trim(lines[i]) == CacheFormat.SliceSeparator; 686 if (raw[0] == CacheFormat.CommentChar) 707 if (current.Name == CacheFormat.Sections.SliceDimensions)
ProjectDataMerger.cs (38)
22 ForwardCompat.TryReadVersionHeader(CacheFormat.VersionHeader, out int major, out _) ? major : 2; 274 bool hasFrameworkAnalyzerAllowList = slices.Any(static s => s.ListSections.ContainsKey(CacheFormat.Sections.FrameworkAnalyzerReferences)); 276 || (AllSlicesHaveSameSection(slices, CacheFormat.Sections.FrameworkPacks) 277 && AllSlicesHaveSameSection(slices, CacheFormat.Sections.FrameworkAnalyzerReferences)); 280 sharedSections[CacheFormat.Sections.FrameworkPacks] = hoistFrameworkPacks 281 ? GetSection(slices[0], CacheFormat.Sections.FrameworkPacks) ?? [] 283 sharedSections[CacheFormat.Sections.FrameworkAnalyzerReferences] = hoistFrameworkPacks 284 ? GetSection(slices[0], CacheFormat.Sections.FrameworkAnalyzerReferences) ?? [] 296 writer.WriteLine(CacheFormat.SectionHeader(CacheFormat.Sections.Properties)); 307 writer.WriteLine(CacheFormat.SectionHeader(section)); 317 writer.WriteLine(CacheFormat.SliceSeparator); 326 writer.WriteLine(CacheFormat.SectionHeader(CacheFormat.Sections.SliceDimensions)); 336 writer.WriteLine(CacheFormat.SectionHeader(CacheFormat.Sections.Properties)); 364 writer.WriteLine(CacheFormat.SectionHeader(section)); 387 writer.WriteLine(CacheFormat.SectionHeader(CacheFormat.Sections.Properties)); 397 writer.WriteLine(CacheFormat.SectionHeader(section)); 407 writer.WriteLine(CacheFormat.SectionHeader(CacheFormat.Sections.Project)); 408 foreach (string line in lines.Where(static l => l.StartsWith(CacheFormat.ProjectHeaderPrefix, StringComparison.Ordinal))) 410 writer.Write(CacheFormat.LanguagePrefix); writer.WriteLine("C#"); 412 writer.WriteLine(CacheFormat.PrimaryMarker); 413 foreach (string line in lines.Where(static l => !l.StartsWith(CacheFormat.ProjectHeaderPrefix, StringComparison.Ordinal))) 514 if (line[0] == CacheFormat.CommentChar) continue; 520 if (currentSection != CacheFormat.Sections.Project && currentSection != CacheFormat.Sections.SliceDimensions && currentSection != CacheFormat.Sections.Properties) 530 case CacheFormat.Sections.Project: 531 if (string.Equals(line, CacheFormat.PrimaryMarker, StringComparison.Ordinal)) 533 else if (!line.StartsWith(CacheFormat.LanguagePrefix, StringComparison.Ordinal)) 536 case CacheFormat.Sections.SliceDimensions: 539 case CacheFormat.Sections.Properties: 543 currentList?.Add(string.Equals(currentSection, CacheFormat.Sections.SdkAnalyzerConfigPolicy, StringComparison.Ordinal) 587 if (string.Equals(line.TrimEnd('\r'), CacheFormat.SliceSeparator, StringComparison.Ordinal)) 704 writer.WriteLine(CacheFormat.VersionHeader);
ProjectDataWriter.cs (46)
169 writer.WriteLine(CacheFormat.VersionHeader); 181 writer.WriteLine(CacheFormat.SectionHeader(CacheFormat.Sections.Project)); 182 writer.Write(CacheFormat.ProjectHeaderPrefix); writer.WriteLine(resolver.ToPortable(projectFilePath)); 183 writer.Write(CacheFormat.LanguagePrefix); writer.WriteLine("C#"); 184 if (isPrimary) writer.WriteLine(CacheFormat.PrimaryMarker); 185 if (lastDtbSucceeded) writer.WriteLine(CacheFormat.LastDtbSucceededMarker); 192 writer.WriteLine(CacheFormat.SectionHeader(CacheFormat.Sections.SliceDimensions)); 219 writer.WriteLine(CacheFormat.SectionHeader(CacheFormat.Sections.Properties)); 254 writer.WriteLine(CacheFormat.SectionHeader(CacheFormat.Sections.CommandLineArguments)); 291 CacheFormat.Sections.AnalyzerConfigFiles, 303 writer.WriteLine(CacheFormat.SectionHeader(CacheFormat.Sections.FrameworkAnalyzerReferences)); 314 EmitSimplePathSectionRequired(writer, CacheFormat.SectionHeader(CacheFormat.Sections.AnalyzerReferences), preparedAnalyzerRefs); 316 EmitSimplePathSection(writer, CacheFormat.SectionHeader(CacheFormat.Sections.AnalyzerConfigFiles), preparedAnalyzerConfigFiles); 319 CacheFormat.SectionHeader(CacheFormat.Sections.AdditionalFiles), 320 PrepareDistinctPortablePaths(additionalFiles, resolver, CacheFormat.Sections.AdditionalFiles, projectFilePath, duplicateItemReporter), 341 writer.WriteLine(CacheFormat.SectionHeader(CacheFormat.Sections.Capabilities)); 350 private static readonly int CurrentMajorVersion = ForwardCompat.TryParseVersion(CacheFormat.VersionHeader, out int major, out _) 352 : throw new InvalidOperationException($"CacheFormat.VersionHeader '{CacheFormat.VersionHeader}' is not a valid 'version=<major>[.<minor>]' header."); 845 writer.WriteLine(CacheFormat.SectionHeader(CacheFormat.Sections.SourceFiles)); 870 duplicateItemReporter(new ProjectDataDuplicateItemDiagnostic(projectFilePath, CacheFormat.Sections.SourceFiles, portable)); 878 writer.WriteLine(CacheFormat.SectionHeader(CacheFormat.Sections.SourceFiles)); 890 writer.WriteLine(CacheFormat.SectionHeader(CacheFormat.Sections.ProjectReferences)); 908 duplicateItemReporter?.Invoke(new ProjectDataDuplicateItemDiagnostic(projectFilePath, CacheFormat.Sections.ProjectReferences, portable)); 1047 AddDistinctPortablePath(result, seenResult, portable, CacheFormat.Sections.AnalyzerReferences, projectFilePath, duplicateItemReporter); 1136 writer.WriteLine(CacheFormat.SectionHeader(CacheFormat.Sections.FrameworkPacks)); 1144 writer.WriteLine(CacheFormat.SectionHeader(CacheFormat.Sections.SdkAnalyzerPacks)); 1152 writer.WriteLine(CacheFormat.SectionHeader(CacheFormat.Sections.SdkAnalyzerConfigPolicy)); 1798 writer.WriteLine(CacheFormat.SectionHeader(CacheFormat.Sections.MetadataReferences)); 2047 writer.WriteLine(CacheFormat.SectionHeader(CacheFormat.Sections.EmbeddedResources));