ElectronicObserverEN / ElectronicObserver

Electronic Observer is a game viewer for Kantai Collection.
Other
82 stars 19 forks source link

Use ResXGenerator #376

Closed myangelkamikaze closed 1 year ago

myangelkamikaze commented 1 year ago

Replaces the old code generators with a source generator. Code wise basically nothing changes. The only difference is a lot less clutter in the csproj file.

Note that I had to rename some resource files to avoid conflicts with namespaces and other class names. I think we should name all resx files with the Resource suffix from now on, to avoid conflicts like this. I also deleted some old winforms code, which was causing conflicts even though it's not used anymore.

Looks like there's a bug with WPF projects, where the generated files don't work. You can fix it with a workaround that throws all generated files in the same namespace.

<ItemGroup>
    <EmbeddedResource Update="**\*.resx">
        <CustomToolNamespace>ElectronicObserver.Translations</CustomToolNamespace>
    </EmbeddedResource>
</ItemGroup>

In ElectronicObserverTypes it works normally, so this workaround isn't needed.

sonarcloud[bot] commented 1 year ago

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

0.0% 0.0% Coverage
1.4% 1.4% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint