xamarin-macios/msbuild/tests
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
..
AppWithExtraArgumentThatOverrides Order additional arguments after response file (#4607) (#4612) (#4769) 2018-09-07 08:52:38 -04:00
Bug60536 [msbuild] Catch json parser exceptions to provide better error reporting (#2992) 2017-12-12 13:54:09 -05:00
IBToolTaskTests [msbuild] Avoid Dictionary clashes in IBToolTask's mapping dictionary (#1981) 2017-04-18 09:01:29 -04:00
My Spaced App [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MyActionExtension [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MyAppWithPackageReference [msbuild] Set 'CopyNuGetImplementations' to true for app extensions. Fixes #4235 and #4237. (#4512) (#4648) (#4773) 2018-09-10 08:29:23 -04:00
MyBindingsReferences [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MyCoreMLApp [msbuild] Added support for building CoreML models (#2714) 2017-11-28 11:16:44 -05:00
MyDocumentPickerExtension [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MyExtensionWithPackageReference [msbuild] Set 'CopyNuGetImplementations' to true for app extensions. Fixes #4235 and #4237. (#4512) (#4648) (#4773) 2018-09-10 08:29:23 -04:00
MyIBToolLinkTest [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MyKeyboardExtension [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MyLinkedAssets [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MyMasterDetailApp [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MyMetalGame [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MyOpenGLApp [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MyPhotoEditingExtension [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MyReleaseBuild [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MySatelliteAssembliesBug [msbuild] Remove BTouchReferencePath in order to fix bug 56317 (#2105) 2017-05-19 15:34:05 -04:00
MySceneKitApp [msbuild] Fix SceneKit asset compilation. Fixes #3766. (#4851) 2018-09-24 18:42:04 +02:00
MySceneKitLibrary [msbuild] Add test case for #5129. (#5821) 2019-04-01 08:14:48 +02:00
MyShareExtension [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MySingleView [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MySpriteKitGame [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MyTVApp [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MyTVServicesExtension [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MyTabbedApplication [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MyTodayExtension [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MyWatch2Container [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MyWatchApp [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MyWatchApp2 [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MyWatchKit2Extension [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MyWatchKit2IntentsExtension [msbuild] Fixed msbuild logic to properly codesign watchos2 intents extensions (#2024) 2017-04-19 08:19:29 -04:00
MyWatchKitApp [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MyWatchKitExtension [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MyWebViewApp [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MyXamarinFormsApp [xibuild] support for SDK-style projects & Xamarin.Forms test (#6461) 2019-07-01 12:20:32 -05:00
MyiOSAppWithBinding [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
MyiOSFrameworkBinding [tests][msbuild] Remove deprecated values from csprojs. (#5995) 2019-05-06 14:40:48 +02:00
Xamarin.iOS.Tasks.Tests [msbuild] $(ProduceReferenceAssembly) support (#6458) 2019-07-12 21:34:06 +02:00