Skip to content
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

Merged
merged 4 commits into from
Apr 20, 2022

Conversation

ViktorHofer
Copy link
Member

Fixes #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.
@ghost
Copy link

ghost commented Apr 19, 2022

Tagging subscribers to this area: @dotnet/area-infrastructure-libraries
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #68218

Makes assemblies with String.resx resources smaller by avoiding the duplicate resources.

Author: ViktorHofer
Assignees: ViktorHofer
Labels:

area-Infrastructure-libraries

Milestone: -

</ItemGroup>

<!-- Include common SR helper when resources are included unless SkipCommonResourcesIncludes is set. -->
<ItemGroup Condition="Exists('$(StringResourcesPath)') and '$(OmitResources)' != 'true' and '$(SkipCommonResourcesIncludes)' == ''">
Copy link
Member Author

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)"
Copy link
Contributor

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?

Copy link
Member Author

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:

If we are concerned about other languages, I can add an Exists check.

eng/resources.targets Outdated Show resolved Hide resolved
@ViktorHofer
Copy link
Member Author

Failure is #66625

@ViktorHofer ViktorHofer merged commit 30a5b1f into main Apr 20, 2022
@ViktorHofer ViktorHofer deleted the ViktorHofer-patch-1 branch April 20, 2022 12:55
directhex pushed a commit to directhex/runtime that referenced this pull request Apr 21, 2022
* Avoid duplicate Strings.resx import & code-cleanup

Fixes dotnet#68218

Makes assemblies with String.resx resources smaller by avoiding the duplicate resources.
@ghost ghost locked as resolved and limited conversation to collaborators May 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Strings.resx is embedded twice into the assembly for projects that set EnableDefaultItems to true
3 participants