- https://bugzilla.xamarin.com/show_bug.cgi?id=59474
- The idea is to force Full and Modern to expand facades the same way. That way, we get the same, working behavior.
- f79f2e4 was not sufficient, even though it matched XI, because of the difference between XI (and Modern) and what Full was doing.
- Some context:
PR #2685
And that was problematic because it was expanding the netstandard facades from `Microsoft.NET.Build.Extensions`
in the `ImplicitlyExpandNETStandardFacades` target.
But we want to build against XM's bundled facades *only*. So we disable the ns facades completely
by setting `$(ImplicitlyExpandNETStandardFacades) = false`.
But now we are in the situation where a XM/Full project referencing a ns project might fail to build
because of a missing `netstandard.dll` reference! And this same case was fixed for XM/Modern projects in
https://github.com/xamarin/xamarin-macios/pull/2643 . So, we enable the use of that for XM/Full projects too
through `Xamarin.Mac.msbuild.targets`.
The existence of Microsoft.NET.Build.Extensions.Tasks.dll depends on the installed workloads on VS.
-Note: For XI/XM projects referencing a ns2.0 project the build will continue failing (with a different error message) if the dependency does not exist, because the GetDependsOnNETStandard task is being skipped.
Fixes Bug #59588 - XI GetDependsOnNETStandard task could not be loaded from Microsoft.NET.Build.Extensions.Tasks.dll
https://bugzilla.xamarin.com/show_bug.cgi?id=59588
...even if it is a simulator build.
Turns out that starting with Xcode9, sim builds need to be codesigned
for App Groups entitlements to work properly. Interestingly, the
DetectSigningIdentity logic had a comment about needing to codesign
simulator builds for some entitlements to work already starting with
Xcode 8 but apparently the iOS targets did not respect this.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=59379
Building a XI or XM (Modern) project that references a netstandard 2.0
project with msbuild fails because of a missing reference to
`netstandard.dll`.
AppDelegate.cs(21,52): error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
The reason is that XI and XM (Modern) projects have
`$(TargetFrameworkIdentifier) != .NETFramework`, so targets from
`Microsoft.NET.Build.Extensions` which provide ns2.0 support don't get
imported. `ImplicitlyExpandNETStandardFacades` in particular, which
would have added a reference to `netstandard.dll`.
`netstandard.dll` gets included as part of the facades expanded by
`ImplicitlyExpandDesignTimeFacades`, but this gets skipped if the
project does not have a `System.Runtime` dependent reference.
Instead, we want to expand the facades if any reference depends on
`System.Runtime` OR `netstandard`. And for that we scan all the
references for a `netstandard` dependency using the
`GetDependsOnNETStandard` task.
Partially fixes bxc #58504 .
This is to handle the case of XM/Full project referencing a netstandard project.
For XM/Full, $(TargetFrameworkDirectory) is `lib/mono/4.5` which has
`netstandard.dll`. This causes ImplicitlyExpandNETStandardFacades to
skip expanding assuming that when ImplicitlyExpandDesignTimeFacades
expands facades, `netstandard.dll` would also get referenced.
But if the XM project does NOT have any System.Runtime facades, then
ImplicitlyExpandDesignTimeFacades will not expand the facades and so we
end up with no `netstandard.dll` reference!
With `$(NETStandardInbox) == false`,
`ImplicitlyExpandNETStandardFacades` behaves as if `netstandard.dll` was
not available in the framework directories and will expand the facades
if required.
Partially fixes bxc #58504 .
Regression from:
----------------
commit e5d012c5b8
Author: Chris Hamons <chris.hamons@xamarin.com>
Date: Mon Aug 14 13:17:10 2017 -0500
[macos] System mono should resolve non-XM libraries from system (#2480)
----------------
The way this manifests is that for (eg.) a `TargetFrameworkName=Full` project,
after the `FixTargetFrameworkDirectory`(X.M.Common.targets) target we end up with
`$(TargetFrameworkDirectory)` having value of:
/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/4.5
/Library/Frameworks/Mono.framework/Versions/5.4.0/lib/mono/4.6.1-api/Facades/
.. and the second path is incorrect. It should have been:
/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/4.5/Facades
This path fixup is done by `FixDesignTimeFacades` (X.M.msbuild.targets)
target, but this target is running *after*
`FixTargetFrameworkDirectory`, so it doesn't see the fixed facade path!
Both `FixTargetFrameworkDirectory` and `FixDesignTimeFacades` have
`AfterTargets="GetReferenceAssemblyPaths`. But since
`FixTargetFrameworkDirectory` is defined before the
`Xamarin.Mac.msbuild.targets` import, so it gets executed before
`FixDesignTimeFacades`.
The MtouchVerbosity value is set when building from VSfM, and in that case the
logic works fine.
However, when building from the command line, or from VS, the default value
for MtouchVerbosity would be '0', which would mean 'Quiet', which is not what
we want the default verbosity to be.
So set the default MtouchVerbosity value to '2' (Normal verbosity), and at the
same time adjust the values passed to mtouch so that 'Normal' actually means
the default (neither quiet nor verbose).
These targets were failing to build on design-time builds for mostly 2 reasons:
- When loading the project VS is not connected to the Mac, which is required for binding projects.
- Since a reduce amount of targets are ran, the ReferencePath list is empty and makes _GeneratedSourcesFileList fail
Anyway, we shouldn't run targets that we don't need on a design-time build to avoid impacting on its performance
Why these targets were being executed on design-time builds? It's a side effect of adding them to CompileDependsOn.
Reference to design-time builds: https://github.com/dotnet/project-system/blob/master/docs/design-time-builds.md#what-is-a-design-time-build
Fixes bug 387900 - Referenced component could not be found for Binding Library projects
https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/387900
Using the FullPath property breaks the build from Windows, since the metadata will contain a Windows path.
Partial fix for Bug #51759 - Getting build error for iOS sample 'Simpleapp-with-framework'
https://bugzilla.xamarin.com/show_bug.cgi?id=51759
This is part of PR 2430: avoid duplicating degine constants if they exist. This commit splits the condition and definition of the properties in two, because xbuild doesn't support the regex part in a condition. msbuild does, but we need to support both.
The previous change had the fault of considering __UNIFIED__ANYTHING__ the same as __UNIFIED__ and if a user set that property, then he would lose the other (pointed out by jstedfast in the PR).
This commit fixes that.
In VS the property page for Build will show whatever is in DefineConstants, and then save it. Without this, that means that any time the Build page is saved, it duplicates the constants.
This fixes bug#32765: Bug 32765 - Conditional compilation symbols are duplicated everytime I reload the project or restart visual studio (https://bugzilla.xamarin.com/show_bug.cgi?id=32765)
https://bugzilla.xamarin.com/show_bug.cgi?id=58479
_AssignAppExtensionConfiguration assigns project configuration from
`$(CurrentSolutionConfigurationContents)`, using the
`AssignProjectConfiguration` task, which is set if
`$(BuildingSolutionFile)` or `$(BuildingVisualStudio)` is true. We check
only for the former. It would be simpler to just check for ..
`$(CurrentSolutionConfigurationContents) != ''`
.. like the iOS targets. This mapping from this task is used when
invoking `GetBundleTargetPath` on the extension project:
Properties="%(_AppExtensionReferenceWithConfigurationExistent.SetConfiguration); %(_AppExtensionReferenceWithConfigurationExistent.SetPlatform)"
Details:
This failed for a project that had a reference to an app extension
project, with VSMac/msbuild. The app extension project was being built
with `Configuration==Debug` and `Platform==x86` for which the project
does not define any properties (like `$(OutputPath)`).
When the main project is built, we invoke `GetBundleTargetPath` on
the extension project, which in this case, has a different
config+platform mapping than the one for the referencing project. But
since the earlier `AssignProjectConfiguration` was skipped due to the
incorrect condition, `GetBundleTargetPath` is invoked with no
config+platform, thus falling back to extension project's defaults.
Note: The referencing project was being built with Debug|x86 and the
referenced project was expected to be built with Debug|AnyCPU .
This project:
- VSMac/xbuild - Works
- This happens to work because the default from the extension
project is Debug|AnyCPU, so even though
`AssignProjectConfiguration` didn't set those properties, it
builds just fine.
- command line xbuild/msbuild - works!
- `AssignProjectConfiguration` works because this time the
condition `$(BuildingSolutionFile) == 'true'` is True.
- VSMac/msbuild - fails
- In this case, the default case does not work because in VSMac,
we use `SetGlobalProperty` to set config+platform properties
when starting the build for the referencing project.
- And when the referencing project builds the referenced project
(via `GetBundleTargetPath`), it is built with config+platform
global properties set, and thus defaults from the referenced
don't get picked up!
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- With the `AssignProjectConfiguration` fix, we set the
properties via the `MSBuild` task, so it works.
But this needs to be fixed in VSMac anyway.
* [msbuild] Re-added wildcard (*) expandsion for application-identifier in Entitlements.plist (#2186)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=57119
* Bump mono (#2213)
* Framework tests were still binding non-linked Simple class which errors now (#2216) (#2218)
- Improve Makefile to rebuild when projects build with errors
* Bump mono to get cecil fix for bug #56808. (#2222)
https://bugzilla.xamarin.com/show_bug.cgi?id=56808
* [msbuild] Use @(ReferencePath) instead of @(ResolvedFiles) (#2188) (#2214)
This allows things to work on both xbuild and msbuild.
In xbuild, both lists are exactly the same and on msbuild,
only @(ReferencePath) exists.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=55147
* NSActivityOptions.IdleDisplaySleepDisabled had wrong value (#2232) (#2239)
This was due to an integer overflow. The original value was based on Int32
1 << 40 == 256
The correct value should be based on a UInt64.
1UL << 40 == 1099511627776
* [tests] Fix bug 57699 - [iOS]InternalsTest failure (Linkall) tests on device (#2243)
Strip native debugging symbols should not be checked for debug builds
* Bump mono to get fix for bug #57780.
https://bugzilla.xamarin.com/show_bug.cgi?id=57780
* [mtouch] Don't allow building for 32-bit when deployment target is >= 11. Fixes#57966.
Also bump maccore to get an mlaunch error for launching a 32-bit app in a 64-bit-only simulator.
https://bugzilla.xamarin.com/show_bug.cgi?id=57966
* [tests][msbuild] Make sure all Info.plists have deployment targets.
Otherwise we get different behavior (32-bit allowed or not) depending on which
Xcode is used to build.
* [mtouch] Default to 64-bit arch if not specified and targeting iOS 11+.
* [tests] Tweak tests to either specify a deployment target < 11 or not build a 32-bit arch.
This can save a significant amount of space when using code-sharing: the PIX
app saved ~11mb in release mode (when stripping).
`man strip` says:
```
For dynamic shared libraries, the maximum level of stripping is usually -x (to remove all non-global symbols).
-x Remove all local symbols (saving only global symbols).
```
This allows things to work on both xbuild and msbuild.
In xbuild, both lists are exactly the same and on msbuild,
only @(ReferencePath) exists.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=55147
Set the min deployment target to 7.0 for a test to make sure ibtool doesn't
complain, and fix the list of expected bundle resources by adding Assets.car
to the list.
Fixes the following failures:
1. Xamarin.iOS.Tasks.TargetTests.BuildExecutable : #RunTarget-ErrorCount
ibtool exited with code 1
Compiling IB documents for earlier than iOS 7 is no longer supported.
Expected: 0
But was: 2
2. Xamarin.iOS.Tasks.TargetTests.BundleResources : #RunTarget-ErrorCount
ibtool exited with code 1
Compiling IB documents for earlier than iOS 7 is no longer supported.
Expected: 0
But was: 2
3. Xamarin.iOS.Tasks.TargetTests.CleanExecutable : #RunTarget-ErrorCount
ibtool exited with code 1
Compiling IB documents for earlier than iOS 7 is no longer supported.
Expected: 0
But was: 2
4. Xamarin.iOS.Tasks.TargetTests.CopyContentToBundle : #RunTarget-ErrorCount
ibtool exited with code 1
Compiling IB documents for earlier than iOS 7 is no longer supported.
Expected: 0
But was: 2
5. Xamarin.iOS.Tasks.TargetTests.Disappearing_Bundle_Resource : #2
Expected: True
But was: False
6. Xamarin.iOS.Tasks.TargetTests.Disappearing_Content : #2
Expected: True
But was: False
7. Xamarin.iOS.Tasks.TargetTests.OptimizePngs_DefaultValue : #RunTarget-ErrorCount
ibtool exited with code 1
Compiling IB documents for earlier than iOS 7 is no longer supported.
Expected: 0
But was: 2
8. Xamarin.iOS.Tasks.TargetTests.OptimizePngs_False : #RunTarget-ErrorCount
ibtool exited with code 1
Compiling IB documents for earlier than iOS 7 is no longer supported.
Expected: 0
But was: 2
9. Xamarin.iOS.Tasks.TargetTests.OptimizePngs_True : #RunTarget-ErrorCount
ibtool exited with code 1
Compiling IB documents for earlier than iOS 7 is no longer supported.
Expected: 0
But was: 2
10. Xamarin.iOS.Tasks.TargetTests.RebuildExecutable_NoModifications : #RunTarget-ErrorCount
ibtool exited with code 1
Compiling IB documents for earlier than iOS 7 is no longer supported.
Expected: 0
But was: 2
11. Xamarin.iOS.Tasks.TargetTests.RebuildExecutable_TouchLibraryDll : #RunTarget-ErrorCount
ibtool exited with code 1
Compiling IB documents for earlier than iOS 7 is no longer supported.
Expected: 0
But was: 2
12. Xamarin.iOS.Tasks.TargetTests.UnpackLibraryResources_ExecutableProject : #RunTarget-ErrorCount
ibtool exited with code 1
Compiling IB documents for earlier than iOS 7 is no longer supported.
Expected: 0
But was: 2
* [msbuild] Added EnableOnDemandResources option
Disabling this option causes the ACTool task to pass
--enable-on-demand-resources NO (instead of YES) to actool.
It will also cause the ResourceTags property on BundleResource
and InterfaceBuilder items to be ignored.
* Fixed unit tests
Replace https://github.com/xamarin/xamarin-macios/pull/1973 expect that
the test parts are still needed.
* Add XM SDK + LinkSkip test
* [macos] Add platform linking support to msbuild
* [macos] Add full SDK test
* [macios] Diable classic from using linkplatform
- Extended test infrastructure change to allow classic projects that include bundling
- Setting linkplatform in MonoBundlingExtraArgs since we don't even read project setting LinkMode - Platform for classic
The runtime team is going to change the default for the float 32 option.
Therefore, to avoid breaking users who are currently **not** using this option,
we need to force the use of `-float32`.
* Add new test to cover UseFloat32 = false
It does not make sense to support incremental builds for the simulator (since
no AOT compilation is done), it just makes the test matrix more complicated.
So simplify things by removing support for incremental builds.
We also ignore any (other) --assembly-build-target arguments, because building
to frameworks doesn't make sense either in the simulator.
https://bugzilla.xamarin.com/show_bug.cgi?id=55712
CompileSceneKitAssetsTaskBase tries to set `DefiningProjectFullPath`
metadata on a new TaskItem, if it is available on the original one.
But with msbuild, this is a reserved metadata and cannot be set.
If we create the new item based on the original one, then we get the
metadata too. And we also get a `OriginalItemSpec`, which we don't need
and can remove.
This fixes a regression caused by msbuild/XS switching to use the
msbuild implementations of `Microsoft.Build.{Tasks,Utilities}.{v4.0,v12.0}`
assemblies (-> `.Core`) instead of the xbuild ones.
It manifested as:
`error MSB4018: System.ArgumentException: "DefiningProjectFullPath" is a reserved item metadata, and cannot be modified or deleted.`
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=55480https://bugzilla.xamarin.com/show_bug.cgi?id=55389
For windows, ideSdkPath was defined twice.
Also the base tasks are being built only on the Mac, VSW get those from the bundle.zip, so the Windows check should be done at runtime.
First: only run `EnsureSdkPath` if `EnsureAppleSdkRoot` passed.
Both are based on similar install checks, `SdkIsInstalled` (used for `SdkIsInstalled`) is empty
if `IsInstalled` (used by `EnsureAppleSdkRoot`) is false.
This avoid having 2 error messages when only 1 at a time is needed.
Second: improved `EnsureAppleSdkRoot` error message mentioning the wrong Xcode developer path (which triggered the error)
as well as the exact way to fix it.