We have added SonarQube to our build script, which does something with MSBuild that might be what is triggering some issues. Prior to enabling SonarQube everything seems to build fine.
What SonarQube seems to do is to enable analysis of the solution, which triggers that Xamarin.Analysis.targets come into the picture.
With SonarQube enabled our build fails on a iOS Class Library project, which does not have any Entitlements and only has the Platform configuration AnyCPU. Even so, the build fails with the "CompileEntitlements" task failing due to a whole bunch for properties not being set. I have attached the build log, which includes the Diagnostics output from MSBuild to this report.
It appears to me that the CompileEntitlements task is run, because somewhere during the build it changes the Platform from AnyCPU to iPhone, which then triggers it. I believe this shouldn't happen, because no native code is created here and no entitlements need to be compiled.
Looking at the targets:
Platform gets changed to iPhone and _RequireCodesigning is set to true here: https://github.com/xamarin/xamarin-macios/blob/fc55e4306f79491fd269ca2495c6a859799cb1c6/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets#L103
Then falls into the CompileEntitlements section here: https://github.com/xamarin/xamarin-macios/blob/fc55e4306f79491fd269ca2495c6a859799cb1c6/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets#L1250
I could confirm this issue, it seems indeed to come from the fact that SonarQube does a `RunCodeAnalysis` which triggers Xamarin.Analysis which seem to have an issue with iOS libraries.
An easy way to reproduce this is to create a brand new Xamarin.iOS library (New Project > iOS > Library > Class library) and do Project > Run Code Analysis on Solution (menu bar).
We then get: `/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1381,3): error MSB4044: The "CompileEntitlements" task was not given a value for the required parameter "AppBundleDir".`
Full build output: https://gist.github.com/VincentDondain/d1072c74c6a38cb8f88c2e5d6d445aa4
Version information: https://gist.github.com/VincentDondain/53390dbaca03c15a2e50a28a2da86e5c
Want me to handle this one? I think I have an idea for a fix (I just noticed you assigned this to yourself a few seconds ago)
Pending PR: https://github.com/xamarin/xamarin-macios/pull/3084
PR merged: https://github.com/xamarin/xamarin-macios/commit/565d710f4f2b998ce0b96b8c46c8611f3e3dcb09