I'm trying to build an incremental source generator that will output nested classes with strings for each content file in my project containing its file path like so:
public static class Content
{
public static class SomeDirectory
{
public static readonly string MyFile = "Content/SomeDirectory/MyFile.png";
}
}
A "content" file is a file marked via the Content build action: <Content Include="Content\foobar.png" />.
In my other source generators I have marked any files I needed with the AdditionalFiles build action and then accessed them through the AdditionalTextsProvider property on the source generator context. However for these files they need to be marked as Content and as such do not appear in the AdditionalTextsProvider list of files.
Is it possible to access the content files similarly to AdditionalFiles-files or will I need to resort to manual I/O operations (which I really want to avoid inside a source generator)?
Contentfiles through source generators...