Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[l10n] Use Arcade to generate resource properties (#5270)
Context: 0342fe5 Now that `Xamarin.Android.Build.Tasks.csproj` is a short-form project (03743f3), add a dependency on the [`Microsoft.DotNet.Arcade.Sdk`][0] NuGet package, and switch to using the [`$(GenerateResxSource)` mechanism][1] instead of using `%(EmbeddedResource.Generator)`=`ResXFileCodeGenerator`, which only updates `Resources.Designer.cs` when using the Visual Studio IDEs. For this initial use of `Microsoft.DotNet.Arcade.Sdk`, import only `..\tools\BuildTasks.props` and `..\tools\GenerateResxSource.targets`. Avoid importing the full `Sdk.props` and `Sdk.targets` for now because those files have other consequences that aren't desired at this time. For example, `Sdk.props` indirectly imports `ProjectDefaults.props`, which sets `$(DebugType)`=`embedded` by default, and `[assembly:AssemblyVersion("42.42.42.42")]` is added. An advantage of `$(GenerateResxSource)`=True compared to `ResXFileCodeGenerator` is that contributors no longer need to worry about updating `Resources.Designer.cs` when updating `Resources.resx`. This is especially helpful for contributors who use an editor other than Visual Studio (macOS & Windows), because it means they no longer need to hand-edit the `Resource.Designer.cs` file to match the format that `ResXFileCodeGenerator` generates on Windows. The generated file `obj/$(Configuration)/Xamarin.Android.Tasks.Properties.Resources.cs` has essentially the same setup as the previous `Resources.Designer.cs`. The properties are still `internal` and still include `<summary/>` comments to surface the non-localized messages in IntelliSense, and the file is still updated by a design-time build any time the `.resx` file changes. One difference is that the new generated `.cs` file is not shown in the Solution Explorer because it's located in `obj/`. If any contributors were previously using `Resources.Designer.cs` as a starting place to do "find all references" on the property names, they would now need to open the generated file from the `obj/` directory instead. [0]: https://github.com/dotnet/arcade/tree/0940dc72b8d9886c1605c38f7190b984463903c6/src/Microsoft.DotNet.Arcade.Sdk [1]: https://github.com/dotnet/arcade/blob/c6f24c0d1264f6f80ceb39d2b0477d054c3f8ffc/Documentation/ArcadeSdk.md#generateresxsource-bool
- Loading branch information