-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Figgle Generator not creating strings. #19
Comments
Does your To see generated files you need to set the <PropertyGroup>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
</PropertyGroup> This will write a file to a location such as Note that source generators don't write this file by default for performance reasons. The disk IO is avoidable. |
Thanks for the quick response. I do not have that in setting configured. I'll test that tomorrow. So if the string is generated there, how is it usable as a reference in my source elsewhere? Or is the string just something that you go copy and put in your code where you need it? |
With the source generator, the output string is computed at compile time, rather than at run time, so it's faster when your program runs (nothing to compute) and you don't need to ship Figgle binaries (which include large font files, embedded). So your program could resemble this: [GenerateFiggleTextAttribute("DevelopmentString", "standard", "Development")]
public partial class StartupBanners
{
}
public static class Greeter
{
public static void PrintDevelopment() => Console.WriteLine(StartupBanners.DevelopmentString);
} |
Thank you for your help with this. I appreciate it. How difficult is it to remove all the fonts except one from the runtime package? |
It would require some refactoring of the packages I think. You can easily parse a single figlet file using the APIs, but today the core fonts are embedded for convenience. See #12. |
Do you mind if I pull the source and give it a shot? |
You're welcome to play with it! But if you're hoping to land a change in this repo, I recommend sharing a proposal as to how that might work before submitting a PR. That could save you a bunch of time. Let's continue the discussion in #12. Looks like the original issue here has been addressed so I'll close this. |
Hello,
I'm trying to use the generator.
Visual Studio 2022 v17.8.4
.Net 8
Project type: library
Pacakge: Figgle.Generator v0.5.1
My class code:
Filename: StartupBanners.cs
When I compile the app I see no partial class code generation.
I've tried the following.
Without a StartupBanners.partial`1.cs file
With a StartupBanners.partial`1.cs file
Am I missing something?
Thank you,
Howard Shank
The text was updated successfully, but these errors were encountered: