* Pass and parse the MtouchInterpreter value to dotnet-linker.
* Move required logic from mtouch to shared code to take advantage of existing
code to compute AOT arguments (which we need to compute the correct AOT
arguments for System.Private.Corelib.dll, which is always AOT-compiled).
* Add a linker task to compute the AOT arguments for .NET.
* Add test projects.
This PR is probably best reviewed commit-by-commit.
Fixes https://github.com/xamarin/xamarin-macios/issues/10292.
* [link sdk/link all] Adjust to compile on Mac Catalyst.
* [tests] Adjust the LinkAllRegressionTest.NoFatCorlib to work on Mac Catalyst.
* [tests] Add version checks to make link sdk green on Mac Catalyst.
* [tests] Make the LinkSdkRegressionTest.SpecialFolder test pass on Mac Catalyst.
* [xharness] link sdk and link all are green on Mac Catalyst now.
* Fix test build.
* [tests] Use the 'Apple Developer' code signing key instead of 'iPhone Developer' for xcframework-test.
* [msbuild] Fix resolving the XCFramework for Mac Catalyst.
* [xharness] Enable xcframework-test by default on Mac Catalyst.
See [HOWTO](https://github.com/xamarin/xamarin-macios/wiki/Nullability)
Also small change to generator so strong dictionaries can accept `null`
`NSDictionary`, which was already accepted by the class itself.
and expose two properties that were not usable before
* [tests] Add test case for single-project properties in .NET.
* [msbuild] Add support for the single-project ApplicationId MSBuild property.
* [msbuild] Add support for the single-project ApplicationTitle, ApplicationVersion and AppleShortVersion MSBuild properties.
* [dotnet] Enable the single-project MSBuild properties by default.
* [dotnet] Add a short doc about single project properties.
* [tests] Fix the GeneratePlistTaskTests.BundleIdentifier test according to bundle identifier changes.
This test asserts that the CFBundleIdentifier value in the Info.plist isn't
overwritten, and does so by calling the CompileAppManifest task, giving it a
different value for the bundle identifier than what's in the Info.plist.
The behavior change is that now we do things in the following manner:
DetectSigningIdentityTask will read the Info.plist, compute a bundle
identifier (which will be the value from the Info.plist if it's there), and
returns it to the MSBuild code. Eventually that value will be passed to the
CompileAppManifestTask, which will write it to the Info.plist.
However, this test doesn't run the DetectSigningIdentityTask, which means that
the initial value for the bundle identifier doesn't come from the Info.plist.
* [monotouch-test] Rework big parts of KeyChainTest. Fixes #xamarin/maccore@2365.
'GenericPassword' keychain items are unique by their Service+Account
properties [1]. This means that changing the Label property will not create a
different 'GenericPassword', which has a few consequences:
* It's possible to filter (and try to delete) using the Label property.
* It's possible to try to delete a 'GenericPassword' item, and have that
deletion attempt fail with 'no item found', and then subsequently trying to
add the same item will fail with a DuplicateItem, because the deletion
was filtered using the Label property.
The change I've made is to:
* Make the Label property much more descriptive, and unique per process. This
makes it easier to figure out where things come from in the Keychain Access
app.
* Make the Service property unique per process. This way these tests are
parallel safe and they won't stomp on eachother.
* Keep the Account property the same (a constant value), so that it's easy to
filter to just these items in the Keychain Access app.
* Remove the Label property from all queries, it doesn't matter anyway. The
Label property is still set when adding items to the keychain.
Finally try to clean up after ourselves as good as possible. This way we don't
fill the keychain with test stuff. This involves removing certificates and
passwords we add to the keychain at the end of tests.
Fixes https://github.com/xamarin/maccore/issues/2365.
[1]: https://stackoverflow.com/a/11672200/183422
* Adjust query for RecordTest.AuthenticationType as well to not include fields that don't determine uniqueness.
Also make the InternetPassword items we add to the keychain more descriptive and labelled helpfully.
* [dotnet] Add support for LinkDescription items.
Also use the LinkDescription item group instead of a custom one
(_BundlerXmlDefinitions), since there's no need for the custom one.
* The world (aka mmp) isn't quite ready for this yet.
* Don't parse into LinkDescription, use a temporary variable instead.
And then only use the temporary variable for .NET.
The problem is that parsing mtouch extra args and adding any --xml arguments
to LinkDescription is that the xml file will be passed again to mtouch, and in
this case any ${ProjectDir} properties won't be evaluated.
Ensure we run sanity checks so the `.todo` files remains up-to-date with
the required work. Updated existing `.todo` files to avoid duplication
errors.
Fix the report. The number of columns varies locally (more details) and
on bots. The former was not right since the original catalyst update.
* [monotouch-test] Use a more descriptive label for items added to the keychain in KeyTest.
* [monotouch-test] Use a more descriptive label for some items in CertificateTest.
Also make generated keys non-permanent so that they're not added to the keychain.
* [monotouch-test] Clean up a few items added to the keychain by CertificateTest.
We need to add the prefix to the xharness logs or we will not be able to
acceess them via a click.
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
* [msbuild] Unify how CFBundleName is calculated.
Previously, CFBundleName would default to:
* iOS: CFBundleDisplayName (if set), otherwise the app bundle name.
* all other platforms: the app bundle name.
Now unify the logic so that we have the same behavior on all platforms.
This is a breaking change under the following conditions:
* Building for iOS
* CFBundleName is not set in the Info.plist
* CFBundleDisplayName is set in the Info.plist
* CFBundleDisplayName from the Info.plist is different from AssemblyName in
the csproj (which is the value used to calculate the app bundle name).
The fix would be to:
* Set CFBundleName in the Info.plist to the desired value.
This change works in previous versions of Xamarin.iOS as well.
* Update tests.
* [dotnet-linker] Add the RemoveUserResources sub step.
This comes with a few changes to the RemoveUserResources sub step as well:
* Bail out earlier if we're in the simulator (no need to do any processing at
all - we know at the very beginning if we're building for the simulator).
* Do a positive simulator check, instead of a negative device check (because
Mac[Catalyst] are neither devices - so they pass the negative device check).
* Remove all the conditional mtouch/mmp code, and figure out at runtime which
resource prefixes we need to check for.
It was also necessary to change where steps are added to the pipeline: we have
to remove resources before the OutputStep, but at the same time we have to do
it after the ExtractBindingLibraries step, otherwise the
ExtractBindingLibraries step won't find any binding libraries to extract. So
move the ExtractBindingLibraries, LoadNonSkippedAssemblies and
ListExportedSymbols to before the OutputStep (to keep their internal order),
and then add the RemoveUserResources after those.
This fixes the following link sdk/link all test when running on device:
BundledResources.ResourcesTest
[FAIL] Bundled : No resources
Expected: 0
But was: 2
* [tests] Update the BuildInterdependentBindingProjects test now that we're removing resources.