xamarin-macios/msbuild/Xamarin.iOS.Tasks
Rolf Bjarne Kvinge a9a638553f
[msbuild/dotnet] Fix building binding projects on Windows in .NET (#14704)
When building a binding project, we need to execute bgen (and csc) on the mac. Figuring
out where these files are on the Mac is rather complicated from a remotely executed
task, so instead we execute a sub-build that computes these properties.

In legacy Xamarin this was accomplished by building the 'Xamarin.iOS.ObjCBinding.Common.props'
file using msbuild, and invoking a custom target that prints the property we're looking
for (the 'targetGetPropertyValue_*' targets).

For multiple reasons this approach doesn't work in .NET anymore (in particular it
seems that the 'Xamarin.iOS.ObjCBinding.Common.After.targets' file with the custom
'targetGetPropertyValue_*' targets is nowhere to be found, but logic has also moved
around in the .targets/.props files which makes just building the 'Xamarin.iOS.ObjCBinding.Common.props'
not work correctly since the properties we need wouldn't be set).

So I'm adding a new task that does a sub-build, using either msbuild or dotnet as
appropriate, to compute the properties we need. Instead of building the 'Xamarin.iOS.ObjCBinding.Common.props'
file, the task creates an actual binding project (an empty one), and executes the
new '_WriteRemoteGeneratorProperties' target in this binding project.

An additional advantage in this new task is that it will only execute one sub-build
where all the properties are computed (the previous approach executed one sub-msbuild
per property).

In order to keep code as similar as possible between legacy Xamarin and .NET, the
new task is being used for legacy Xamarin as well (and the old approach deleted).

This fixes building binding projects on Windows in .NET.
2022-04-22 16:17:03 +02:00
..
Contracts Fix some whitespace issues in various files. (#12399) 2021-08-11 10:06:46 +02:00
Model Fix some whitespace issues in various files. (#12399) 2021-08-11 10:06:46 +02:00
Properties [msbuild] Sign Xamarin.iOS.Tasks.dll and Xamarin.Mac.Tasks.dll. Fixes #9835. (#12831) 2021-09-28 17:31:35 +02:00
Tasks [msbuild/dotnet] Fix building binding projects on Windows in .NET (#14704) 2022-04-22 16:17:03 +02:00
Xamarin.iOS.Tasks.csproj [msbuild] Enable nullability for the CompileAppManifest task. (#14670) 2022-04-06 22:57:10 +02:00