Context: dotnet/runtime#68610
Context: https://github.com/xamarin/xamarin-android-tools/commit/0be567a9
In Mono and .NET prior to .NET 8, the
[`System.Environment.SpecialFolder`][0]`.Personal` enum value would refer to
`$HOME` on Unix platforms.
This will be changing in .NET 8, such that
`Environment.SpecialFolder.Personal` will instead refer to
`$XDG_DOCUMENTS_DIR` (if set) or `$HOME/Documents`. This is for "semantic
compatibility" with .NET on Windows.
Replace usage of `Environment.SpecialFolder.Personal` with
`Environment.SpecialFolder.UserProfile`, so that our code continues to work as
expected under .NET 8.
[0]: https://docs.microsoft.com/en-us/dotnet/api/system.environment.specialfolder?view=net-6.0
Apple has deprecated bitcode, and will apparently reject app submissions
containing bitcode starting with Xcode 14. So automatically disable bitcode if
building using Xcode 14+ (and show a warning so that app developers can remove
the 'MtouchEnableBitcode' property from their project files).
Fixes https://github.com/xamarin/xamarin-macios/issues/15210.
Backport of #15804
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Add support for two new MSBuild item groups:
* CodesignBundle: lists additional app bundles inside the main bundle which should
be signed (typically manually copied into the app bundle by the developer).
* SkipCodesignItems: lists files we'd sign by default, but which shouldn't be signed.
Fixes https://github.com/xamarin/xamarin-macios/issues/15594.
This pull request updates the following dependencies
## From https://github.com/dotnet/runtime
- **Subscription**: 0f76eea3-d4b0-4229-e732-08d9ecb01c9c
- **Build**: 20220916.13
- **Date Produced**: September 17, 2022 2:53:53 AM UTC
- **Commit**: cdf48abd370f148a537960141f73769e678660e7
- **Branch**: refs/heads/release/6.0
- **Updates**:
- **Microsoft.NETCore.App.Ref**: [from 6.0.9 to 6.0.10][15]
- **Microsoft.NET.Workload.Emscripten.Manifest-6.0.100**: [from 6.0.9 to
6.0.10][16]
[15]: 531f715...cdf48ab
[16]: 3f6c45a...c3fc739
## Coherency Updates
The following updates ensure that dependencies with a
*CoherentParentDependency*
attribute were produced in a build used as input to the parent
dependency's build.
See [Dependency Description
Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview)
- **Coherency Updates**:
- **Microsoft.NET.Workload.Emscripten.Manifest-6.0.100**: from 6.0.9 to
6.0.10 (parent: Microsoft.NETCore.App.Ref)
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
* Add support for specifying custom entitlements with an MSBuild item group.
* Use this new support to automatically add the 'com.apple.security.cs.allow-jit'
entitlement to .NET desktop apps when building for release, since all apps that
go through notarization will need it in order to be able to use the JIT.
It's possible to override the default behavior by adding something like this to the project file:
<ItemGroup>
<CustomEntitlements Include="com.apple.security.cs.allow-jit" Type="Remove" />
</ItemGroup>
Fixes https://github.com/xamarin/xamarin-macios/issues/15745.
This is the behavior in legacy Xamarin (for mobile projects): if a project
contains a CodesignEntitlements=Entitlements.plist property, we require a
provisioning profile (and failing the build if none is found).
In .NET, the expected behavior is that if a file is in the project directory,
it should be detected automatically and handled accordingly. We didn't do this
for the initial release of .NET, but we implemented it later
(https://github.com/xamarin/xamarin-macios/pull/15729).
However, this turned out to be complicated, because many templates provide an
Entitlements.plist file, and now suddenly just the presence of such a file
would require a provisioning profile, which also means setting up the whole
rigmarole of Apple's certificates and provisioning profiles (and even
potentially getting a paid Apple Developer account).
This usually worked well in legacy Xamarin, because in templates only the
Release configuration would set the CodesignEntitlements=Entitlements.plist
property, and thus we'd only require a provisioning profile for release builds
(and the Entitlements.plist file would be ignored for Debug builds).
Here we change the default behavior when building for .NET so that we only
require a provisioning profile if the Entitlements.plist file is empty (i.e.
doesn't request any entitlements).
I've also implemented an override, where setting the
CodesignRequireProvisioningProfile=true property will override our default
logic.
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1613459.
I always have to look through all the namespaces to figure out where a
specific test is, so this simplifies things a bit.
It's also where the tasks themselves are headed at some point.
This will increase app size a little bit: the space for the MVID + 4 bytes for each
assembly, but we'll be able to validate and show a helpful error message if the generated
static registrar code does not match the assembly loaded at runtime.
It's also a step toward per-assembly static registration (ref: #12067).
Since executables in frameworks usually don't have dots, `%(Filename)` will be
the entire filename, because `%(Extension)` is empty. However, if the
executable happens to have a dot, then we need to include the extension:
`%(Filename)%(Extension)`.
Fixes https://github.com/xamarin/xamarin-macios/issues/15727.
* Add additional app extensions to the list of items we need to sign.
* Improve msbuild test for additional app extensions:
* Build for both device and simulator.
* Hopefully fix the signing problems that occurred on the bots last time we tried.
* Assert that both the container and extension are signed during the build when we build for device.
A 10-line fix with 3300 lines of tests...
Fixes https://github.com/xamarin/xamarin-macios/issues/15598.
This avoids one case where we we embed metadata tokens to a different assembly
in the generated static registrar code.
This is required for supporting per-assembly static registration
(https://github.com/xamarin/xamarin-macios/issues/12067).
We used to do the following:
1. Have abstract task classes in the Xamarin.*.Task.Core assembly (with all
the actual code for the task in question to work properly on macOS).
2. Subclassed task in the Xamarin.*.Task assembly, which did nothing.
3. On Windows we'd inject a different Xamarin.*.Task assembly, with
Windows-specific overrides for the implementation in the abstract base
class.
However, we no longer do point 3, which means that we no longer need to split
our tasks across two assemblies.
This means that we can remove the Xamarin.\*.Task.Core assemblies, and move all
the code into the corresponding Xamarin.\*.Task assembly instead.
This simplifies our code and speeds up the build.
There are more simplifications that can be done; those will come in later PRs.
NuGet seems to struggle with the network on the bots for this particular test,
so ignore the test if there are any nuget failures.
Fixes https://github.com/xamarin/maccore/issues/2612.
* Update dependencies from https://github.com/dotnet/runtime build 20220727.6
Microsoft.NETCore.App.Ref
From Version 6.0.8 -> To Version 6.0.8
* Update dependencies from https://github.com/dotnet/runtime build 20220727.6
Microsoft.NETCore.App.Ref
From Version 6.0.8 -> To Version 6.0.8
* Update dependencies from https://github.com/dotnet/runtime build 20220813.7
Microsoft.NETCore.App.Ref
From Version 6.0.8 -> To Version 6.0.9
Dependency coherency updates
Microsoft.NET.Workload.Emscripten.Manifest-6.0.100
From Version 6.0.4 -> To Version 6.0.8 (parent: Microsoft.NETCore.App.Ref
* Update dependencies from https://github.com/dotnet/runtime build 20220815.11
Microsoft.NETCore.App.Ref
From Version 6.0.8 -> To Version 6.0.9
Dependency coherency updates
Microsoft.NET.Workload.Emscripten.Manifest-6.0.100
From Version 6.0.4 -> To Version 6.0.9 (parent: Microsoft.NETCore.App.Ref
* Update dependencies from https://github.com/dotnet/runtime build 20220816.8
Microsoft.NETCore.App.Ref
From Version 6.0.8 -> To Version 6.0.9
Dependency coherency updates
Microsoft.NET.Workload.Emscripten.Manifest-6.0.100
From Version 6.0.4 -> To Version 6.0.9 (parent: Microsoft.NETCore.App.Ref
* Update dependencies from https://github.com/dotnet/runtime build 20220819.3
Microsoft.NETCore.App.Ref
From Version 6.0.8 -> To Version 6.0.9
Dependency coherency updates
Microsoft.NET.Workload.Emscripten.Manifest-6.0.100
From Version 6.0.4 -> To Version 6.0.9 (parent: Microsoft.NETCore.App.Ref
* [tests] Adjust InvalidRuntimeIdentifier_Restore to expect failure for Mac Catalyst.
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>