xamarin-macios/msbuild/Xamarin.iOS.Tasks.Core
Jonathan Peppers 7c2cf9aa52 [msbuild] $(ProduceReferenceAssembly) support (#6458)
Context: http://feedback.devdiv.io/600039
Context: 6321934237/Documentation/guides/MSBuildReferenceAssemblies.md
Context: https://github.com/dotnet/roslyn/blob/master/docs/features/refout.md#msbuild

For Xamarin.Android, we have been doing a bit of work to enable a new
MSBuild/Roslyn feature called "reference assemblies". You can opt into
this by setting $(ProduceReferenceAssembly)=true in a netstandard
project.

The benefit being that if the public API doesn't change in the
netstandard library, the head projects don't need to run `CoreCompile`
or `<Csc/>` during an incremental build.

Unfortunately, this seems to have uncovered a problem in the
Xamarin.iOS MSBuild targets. If you do a build with a XAML-only change,
you get:

    Target "_CompileToNative" in file "/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets":
    Skipping target "_CompileToNative" because all output files are up-to-date with respect to the input files.
    Input files: /Users/jonathanpeppers/Projects/HelloForms/HelloForms.iOS/bin/iPhoneSimulator/Debug/HelloForms.iOS.exe
    Output files: bin/iPhoneSimulator/Debug/device-builds/iphone11.8-12.2/HelloForms.iOS.app/HelloForms.iOS;bin/iPhoneSimulator/Debug/device-builds/iphone11.8-12.2/mtouch.stamp

Because we are using `$(ProduceReferenceAssembly)` the
`HelloForms.iOS.exe` assembly will have no changes. Only
`HelloForms.dll`, the netstandard project, has changes. We were able
to skip `CoreCompile` in the iOS head project. Faster builds, yeah!

However, we actually need `_CompileToNative` to run, or we won't see
any changes on the device or simulator... It only runs if
`$(TargetPath)` changes.

The fix here is to add new `Inputs`, so `_CompileToNative` runs when
any referenced assemblies change:

    <_CompileToNativeInput Include="$(TargetDir)$(TargetFileName);@(ReferencePath);@(MTouchReferencePath)" />

This fixes incremental builds (or changes) for:

* Any `<ProjectReference/>` that has `$(ProduceReferenceAssembly)`
* Any NuGet package that ships a reference assembly alongside its
"regular" assembly

I also moved the `<ItemGroup>`'s, just so the code made sense --
so we have all the important `<ItemGroup>`'s in one place.

I also updated the `XamarinForms` test to verify things are working.

I added a couple helpers to assist in writing MSBuild tests:

* `IsTargetSkipped` to check if a specific MSBuild target ran
* `Logger.Clear` to clear past MSBuild events within a single test
2019-07-12 21:34:06 +02:00
..
Tasks [msbuild] Add non-ui version of com.apple.AudioUnit-UI in lists (#6098) 2019-05-22 08:14:51 -05:00
IPhoneSdks.cs Build MSBuild targets & assemblies. 2016-04-24 14:48:44 -04:00
NoCode.cs Enables CoreCompile target for WatchOS App projects (#826) 2016-09-16 14:16:32 -04:00
Xamarin.MonoTouch.CSharp.targets [msbuild] Remove support for XI/Classic. (#976) 2016-10-13 10:47:46 +02:00
Xamarin.MonoTouch.FSharp.targets [msbuild] Remove support for XI/Classic. (#976) 2016-10-13 10:47:46 +02:00
Xamarin.TVOS-FrameworkList.xml.in [msbuild/tests] Ensure our FrameworkList files have correct assemblies (#5367) 2019-01-11 13:59:22 -05:00
Xamarin.TVOS.AppExtension.CSharp.targets [msbuild] Enable nuget package conflict resolution (#4945) 2018-10-10 20:14:31 -04:00
Xamarin.TVOS.AppExtension.Common.props [msbuild] Add tvOS AppExtension targets 2016-04-26 10:19:54 -04:00
Xamarin.TVOS.AppExtension.Common.targets [msbuild] Enable nuget package conflict resolution (#4945) 2018-10-10 20:14:31 -04:00
Xamarin.TVOS.AppExtension.FSharp.targets [msbuild] Enable nuget package conflict resolution (#4945) 2018-10-10 20:14:31 -04:00
Xamarin.TVOS.CSharp.targets [msbuild] Enable nuget package conflict resolution (#4945) 2018-10-10 20:14:31 -04:00
Xamarin.TVOS.Common.props Build MSBuild targets & assemblies. 2016-04-24 14:48:44 -04:00
Xamarin.TVOS.Common.targets Build MSBuild targets & assemblies. 2016-04-24 14:48:44 -04:00
Xamarin.TVOS.FSharp.targets [msbuild] Enable nuget package conflict resolution (#4945) 2018-10-10 20:14:31 -04:00
Xamarin.TVOS.ObjCBinding.CSharp.targets [msbuild] Repack all iOS Task assemblies into Xamarin.iOS.Tasks.dll (#3168) 2018-01-08 14:29:52 -05:00
Xamarin.WatchOS-FrameworkList.xml.in [msbuild/tests] Ensure our FrameworkList files have correct assemblies (#5367) 2019-01-11 13:59:22 -05:00
Xamarin.WatchOS.App.CSharp.targets [msbuild] Enable nuget package conflict resolution (#4945) 2018-10-10 20:14:31 -04:00
Xamarin.WatchOS.App.Common.props Build MSBuild targets & assemblies. 2016-04-24 14:48:44 -04:00
Xamarin.WatchOS.App.Common.targets [msbuild] Always set IOSDebugOverWiFi to true for WatchOS apps/extensions (#5035) 2018-10-24 20:11:17 -04:00
Xamarin.WatchOS.App.FSharp.targets [msbuild] Enable nuget package conflict resolution (#4945) 2018-10-10 20:14:31 -04:00
Xamarin.WatchOS.AppExtension.CSharp.targets [msbuild] Enable nuget package conflict resolution (#4945) 2018-10-10 20:14:31 -04:00
Xamarin.WatchOS.AppExtension.Common.props [msbuild] Fixed IsWatchExtension state property (#913) 2016-10-03 13:44:31 -04:00
Xamarin.WatchOS.AppExtension.Common.targets [msbuild] Make using the fake watchOS 4.3 SDK disabled by default. 2019-05-10 08:28:43 +02:00
Xamarin.WatchOS.AppExtension.FSharp.targets [msbuild] Enable nuget package conflict resolution (#4945) 2018-10-10 20:14:31 -04:00
Xamarin.WatchOS.CSharp.targets [msbuild] Enable nuget package conflict resolution (#4945) 2018-10-10 20:14:31 -04:00
Xamarin.WatchOS.Common.props Build MSBuild targets & assemblies. 2016-04-24 14:48:44 -04:00
Xamarin.WatchOS.Common.targets Build MSBuild targets & assemblies. 2016-04-24 14:48:44 -04:00
Xamarin.WatchOS.FSharp.targets [msbuild] Enable nuget package conflict resolution (#4945) 2018-10-10 20:14:31 -04:00
Xamarin.WatchOS.ObjCBinding.CSharp.targets [msbuild] Repack all iOS Task assemblies into Xamarin.iOS.Tasks.dll (#3168) 2018-01-08 14:29:52 -05:00
Xamarin.iOS-FrameworkList.xml.in [msbuild/tests] Ensure our FrameworkList files have correct assemblies (#5367) 2019-01-11 13:59:22 -05:00
Xamarin.iOS.AppExtension.CSharp.targets [msbuild] Enable nuget package conflict resolution (#4945) 2018-10-10 20:14:31 -04:00
Xamarin.iOS.AppExtension.Common.props Build MSBuild targets & assemblies. 2016-04-24 14:48:44 -04:00
Xamarin.iOS.AppExtension.Common.targets [msbuild] Prevent rebuilds from re-codesigning if the app bundle is unchanged (#1373) 2016-12-17 22:51:25 -05:00
Xamarin.iOS.AppExtension.FSharp.targets [MSBuild] Fix the codesign of f# app extensions. (#5884) 2019-04-11 00:43:58 +02:00
Xamarin.iOS.CSharp.targets [msbuild] Enable nuget package conflict resolution (#4945) 2018-10-10 20:14:31 -04:00
Xamarin.iOS.Common.props Bump to mono:2018-06 (#4277) 2018-10-10 11:02:28 -04:00
Xamarin.iOS.Common.targets [msbuild] $(ProduceReferenceAssembly) support (#6458) 2019-07-12 21:34:06 +02:00
Xamarin.iOS.FSharp.targets [msbuild] Enable nuget package conflict resolution (#4945) 2018-10-10 20:14:31 -04:00
Xamarin.iOS.ObjCBinding.CSharp.props [msbuild] Remove smcs compiler overrides 2017-03-14 11:47:06 +01:00
Xamarin.iOS.ObjCBinding.CSharp.targets Add 'NoBindingEmbedding' style binding project support (#5167) 2018-12-12 09:55:57 -05:00
Xamarin.iOS.ObjCBinding.Common.props Adds pdb handling to mtouch 2017-03-14 11:51:08 +01:00
Xamarin.iOS.ObjCBinding.Common.targets [msbuild] Repack all iOS Task assemblies into Xamarin.iOS.Tasks.dll (#3168) 2018-01-08 14:29:52 -05:00
Xamarin.iOS.Tasks.Core.csproj Add 'NoBindingEmbedding' style binding project support (#5167) 2018-12-12 09:55:57 -05:00
Xamarin.iOS.WatchApp.CSharp.targets [msbuild] Enable nuget package conflict resolution (#4945) 2018-10-10 20:14:31 -04:00
Xamarin.iOS.WatchApp.Common.props Build MSBuild targets & assemblies. 2016-04-24 14:48:44 -04:00
Xamarin.iOS.WatchApp.Common.targets [msbuild] Rename and unify to IsMacEnabled (#193) 2016-06-16 13:14:43 -04:00