-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Avoid duplicate Strings.resx import & code-cleanup #68220
Conversation
Fixes #68218 Makes assemblies with String.resx resources smaller by avoiding the duplicate resources.
Tagging subscribers to this area: @dotnet/area-infrastructure-libraries Issue DetailsFixes #68218 Makes assemblies with String.resx resources smaller by avoiding the duplicate resources.
|
</ItemGroup> | ||
|
||
<!-- Include common SR helper when resources are included unless SkipCommonResourcesIncludes is set. --> | ||
<ItemGroup Condition="Exists('$(StringResourcesPath)') and '$(OmitResources)' != 'true' and '$(SkipCommonResourcesIncludes)' == ''"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SkipCommonResourcesIncludes
switch is dead-code as it isn't used anywhere anymore.
GenerateSource="true" | ||
ClassName="$(StringResourcesNamespace).$(StringResourcesClassName)" /> | ||
<!-- Include common SR helper when resources are included. --> | ||
<Compile Include="$(CommonPath)/System/SR$(DefaultLanguageSourceExtension)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does DefaultLanguageSourceExtension make sense here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it does. The SDK, roslyn and other components use it as well to include code specific to a language:
- https://github.com/dotnet/sdk/blob/41de3649581a9d1f0651d969bb8cb0a4fa7623c9/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.GenerateGlobalUsings.targets#L23
- https://github.com/dotnet/roslyn/blob/c0e6f5886809b376f72bb786fd0ed2a8c100cf8f/eng/targets/XUnit.targets#L27
runtime/Directory.Build.targets
Line 37 in ccd67b0
<None Include="$(MSBuildProjectDirectory)\**\*$(DefaultLanguageSourceExtension)" - https://github.com/search?p=2&q=org%3Adotnet+DefaultLanguageSourceExtension&type=Code
If we are concerned about other languages, I can add an Exists check.
Failure is #66625 |
* Avoid duplicate Strings.resx import & code-cleanup Fixes dotnet#68218 Makes assemblies with String.resx resources smaller by avoiding the duplicate resources.
Fixes #68218
Makes assemblies with String.resx resources smaller by avoiding the duplicate resources.