Skip to content

MSBuild fork of ResX reader/writer - #4090

Closed
rainersigwald wants to merge 20 commits into
dotnet:masterfrom
rainersigwald:resx-reader-copypasta
Closed

rainersigwald wants to merge 20 commits into
dotnet:masterfrom
rainersigwald:resx-reader-copypasta

Conversation

@rainersigwald

@rainersigwald rainersigwald commented Jan 22, 2019 •

Copy link
Copy Markdown
Member

Related: #308, #2221, https://github.com/dotnet/corefx/issues/34204.

ResX types are available and functional on .NET Core, but are in the winforms layer, which we don't want MSBuild to have to be on top of. Fortunately, they're pretty isolated, so we can pull a fork of that source into our repo and use it.

This will also probably help with future work to avoid deserialization/serialization during resource building, but doesn't directly address that yet.

Recommended review strategy:

  • Commit-by-commit
  • Ignore 7d32eb4 because it was just copying winforms stuff

To do:

  • Pull in source
  • make it compile
  • update to latest source
  • ResXFileRef
  • Validate incremental behavior of same

- Merge imported source from the winforms repo
- Change types to internal
- Build them in Tasks
- Scoped resource import to only what's needed in referenced code
- Let MSBuild's loc pass translate stuff
@rainersigwald rainersigwald changed the title MSBuild fork of ResX reader/writer WIP: MSBuild fork of ResX reader/writer Jan 22, 2019
@rainersigwald

Copy link
Copy Markdown
Member Author

Marking as WIP since dotnet/winforms#212 just landed and I should adopt it too.

@danmoseley

Copy link
Copy Markdown

If you didn't already, you might checkout https://github.com/dotnet/corefx/compare/master...danmosemsft:resx2?expand=1 and diff those files against yours, as I know I made various cleanup changes, possibly something will pop out that should come along. Or not.

Special-case ResXFileRef to use forked types when reading resx files
that refer to the original, framework type.
These now pass, or fail for a different reason.

Fixes dotnet#308.

fixup! Enable UnsupportedTextType test
Clearly, instead of through many confusing traits.
Comment thread src/Tasks/GenerateResource.cs Resolved
```
update.cmd s:\winforms fa4cdb0
```

dotnet/winforms@fa4cdb0
Translate backslashes to forward slashes when considering relative paths
read for ResXFileRefs.
This test failed in CI because the CI machines don't have
libgdiplus.dylib available, and the bitmap constructor used doesn't
work without it.
These operations have always been unsupported on .NET Core, but with
improved support for resources in .NET Core 3 in general, it's likely
that they'll be encountered more now.
@rainersigwald
rainersigwald force-pushed the resx-reader-copypasta branch from 09291a5 to 6477233 Compare March 14, 2019 19:08
@rainersigwald rainersigwald changed the title WIP: MSBuild fork of ResX reader/writer MSBuild fork of ResX reader/writer Mar 14, 2019
@rainersigwald

Copy link
Copy Markdown
Member Author

FYI @merriemcgaw, @dreddy-work

@rainersigwald

Copy link
Copy Markdown
Member Author

This is no longer the approach we're going with. I'll put up a new PR shortly with an implementation that uses dotnet/corefx#36906.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants