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

[Xamarin.Android.Build.Tasks] Add support for Generated Resources via VSForMac #1327

Merged
merged 1 commit into from Feb 22, 2018

Conversation

Projects
None yet
2 participants
@dellis1972
Contributor

dellis1972 commented Feb 21, 2018

Context https://bugzilla.xamarin.com/show_bug.cgi?id=5870

One of the issues with the current resource designer implementation
is that it is not in the intermediate directory. As a result it is
always causing problems for Source control systems.

Additionally normal .net apps create generated files in the
intermediate directory and make use of the a target and make use
of "build time code generation" [1] by making use of the Generator
metadata in MSBuild. Visual studio already has support for this
however VSForMac did not.

The issue with VSForMac is now being solved. With this commit
we will introduce a new target UpdateGeneratedFiles which can be
used by both VS and XS to generate the Resource.Designer.xx file
in the intermediate directory.

All of this is current protected by the AndroidUseIntermediateDesignerFile
property which defaults to false.

[1] https://mhut.ch/journal/2015/06/30/build_time_code_generation_msbuild

[Xamarin.Android.Build.Tasks] Add support for Generated Resources via…
… Xamarin Studio

Context https://bugzilla.xamarin.com/show_bug.cgi?id=5870

One of the issues with the current resource designer implementation
is that it is not in the intermediate directory. As a result it is
always causing problems for Source control systems.

Additionally normal .net apps create generated files in the
intermediate directory and make use of the a target and make use
of "build time code generation" [1] by making use if the Generator
metadata in MSBuild. Visual studio already has support for this
however Xamarin Studio did not.

The issue with Xamarin Studio is now being solved. With this commit
we will introduce a new target UpdateGeneratedFiles which can be
used by both VS and XS to generate the Resource.Designer.xx file
in the intermediate directory.

All of this is current protected by the AndroidUseIntermediateDesignerFile
property which defaults to false.

[1] https://mhut.ch/journal/2015/06/30/build_time_code_generation_msbuild

@dellis1972 dellis1972 requested a review from sgmunn Feb 21, 2018

@jonpryor jonpryor merged commit b1ce544 into xamarin:master Feb 22, 2018

4 checks passed

Ubuntu+xbuild PR Build Build finished. No test results found.
Details
license/cla All CLA requirements met.
Details
macOS+msbuild PR Build Build finished. No test results found.
Details
macOS+xbuild PR Build Build finished. 37130 tests run, 895 skipped, 0 failed.
Details

jonpryor added a commit that referenced this pull request Feb 27, 2018

[Xamarin.Android.Build.Tasks] Add support for Generated Resources via…
… Xamarin Studio (#1327)

Context: https://bugzilla.xamarin.com/show_bug.cgi?id=5870

One of the issues with the current `Resource.designer.cs` behavior
is that it is not in `$(IntermediateOutputPath)`. As a result it is
always causing problems for source control systems such as TFS.

Additionally, normal .NET apps create generated files within
`$(IntermediateOutputPath)` and make use of
[Build Time Code Generation][1] by providing `%(Generator)` MSBuild
item group metadata. Visual Studio on Windows already had support for
`%(Generator)`, however Visual Studio for Mac did not.

Visual Studio for Mac now supports `%(Generator)` item metadata.

Add a new `UpdateGeneratedFiles` target which can be used by both
Visual Studio and Visual Studio for Mac to generate the
`Resource.designer.cs` file within `$(IntermediateOutputPath)`.

All of this is protected by the
`$(AndroidUseIntermediateDesignerFile)` MSBuild property which
defaults to False.

[1]: https://mhut.ch/journal/2015/06/30/build_time_code_generation_msbuild
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment