Граф коммитов

710 Коммитов

Автор SHA1 Сообщение Дата
Peter Collins 2d887be16b
[build] Version .NET VS manifest file (#15192)
As part of supporting .NET 6 projects with our .NET 7 workload, we will
want to be able to insert both .NET 6 and .NET 7 workload packs into VS.

Historically, we have replaced the [VS manifest file][0] every time we
update our workload.  For .NET 7 we will likely want two VS manifests
side by side, one which contains our .NET 6 packs and one for .NET 7.

Add a version to the .NET VS manifest file to support this potential
side by side scenario.

[0]: https://devdiv.visualstudio.com/DevDiv/_git/VS?path=/.corext/Configs/dotnet-workloads-components.json&version=GBmain&line=10&lineEnd=11&lineStartColumn=1&lineEndColumn=1&lineStyle=plain&_a=contents

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-06-03 10:44:49 +02:00
Rolf Bjarne Kvinge 0e5b2c32c1
[dotnet] Remove some dead build logic. (#15180)
The _BTouchCompileCommand property is never used, so we can just delete it.
2022-06-03 10:41:09 +02:00
Rolf Bjarne Kvinge b062f2be6c
[dotnet] Change condition when to include the System.Runtime.InteropServices.NFloat.Internal package reference. (#15183)
'BundledNETCorePlatformsPackageVersion' will be 7.0 when building with .NET 7
and using the 'net6.0-*' TFM, but we still need the package reference in that
case. So change the condition to go off TargetFrameworkVersion instead.
2022-06-03 10:40:07 +02:00
Rolf Bjarne Kvinge 331ca3e3b6 [dotnet] Fix ios-tabbed template. 2022-05-26 09:40:25 +02:00
dotnet-maestro[bot] 155016c3aa
[net7.0] Update dependencies from dotnet/installer (#14650)
* Update dependencies from https://github.com/dotnet/installer build 20220404.1

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22204.1

Dependency coherency updates

Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref
 From Version 7.0.0-preview.4.22181.10 -> To Version 7.0.0-preview.4.22201.3 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220405.16

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22205.16

Dependency coherency updates

Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref
 From Version 7.0.0-preview.4.22181.10 -> To Version 7.0.0-preview.4.22205.1 (parent: Microsoft.Dotnet.Sdk.Internal

* [tests] Remove dead code.

* Update dependencies from https://github.com/dotnet/installer build 20220407.2

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22207.2

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22206.2 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220407.24

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22207.24

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22206.2 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220408.2

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22208.2

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22206.2 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220411.1

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22211.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22208.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220412.1

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22212.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22211.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220412.35

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22212.35

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22211.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220414.1

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22214.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22211.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220414.17

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22214.17

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22211.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220415.7

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22215.7

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22211.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220417.3

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22217.3

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22211.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220418.29

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22218.29

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22213.2 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220419.19

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22219.19

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22213.2 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220420.23

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22220.23

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22213.2 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220421.9

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22221.9

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22213.2 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220425.1

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22225.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22213.2 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220427.1

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22227.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22226.2 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220427.8

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22227.8

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22227.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220428.6

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22228.6

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22227.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220429.2

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22229.2

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22228.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220503.34

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22253.34

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22228.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220505.1

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22255.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22228.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220506.2

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22256.2

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22228.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220506.8

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22256.8

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22228.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220507.3

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22257.3

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22228.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220508.1

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22258.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22228.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220510.3

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22260.3

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22259.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220510.20

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22260.20

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22259.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220511.8

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22261.8

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22259.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220512.14

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22262.14

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22259.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220513.22

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22263.22

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22259.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220517.11

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22267.11

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22266.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Attempt workaround for https://github.com/dotnet/linker/issues/2759

* [runtime] Skip passing ICU_DAT_FILE_PATH to the runtime if we don't have an ICU data file.

* [dotnet] Write our own code for the global using for nfloat.

This way we can ignore this compiler warning:

    The type name 'nfloat' only contains lower-cased ascii characters. Such names may become reserved for the language.

* Update dependencies from https://github.com/dotnet/installer build 20220523.1

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22273.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22270.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Revert "Attempt workaround for https://github.com/dotnet/linker/issues/2759"

This reverts commit 8650556904.

* [src] Fix computing the value type size of System.UIntPtr.

* Why is this needed?

> SpriteKit/SKNode.cs(89,29): error CS0121: The call is ambiguous between the following methods or properties: 'NSMutableSet<TKey>.NSMutableSet(NativeHandle)' and 'NSMutableSet<TKey>.NSMutableSet(nint)'

* Update dependencies from https://github.com/dotnet/installer build 20220524.1

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22274.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22273.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220524.9

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22274.9

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22273.1 (parent: Microsoft.Dotnet.Sdk.Internal

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-05-26 08:43:43 +02:00
Rolf Bjarne Kvinge db36bd83c1 Merge remote-tracking branch 'origin/main' into net7.0 2022-05-25 09:34:42 +02:00
Rolf Bjarne Kvinge da7dd02dfd
[dotnet] Make sure to not run the linker when we're on a disconnected Windows build. (#15076)
This also means that we shouldn't load the linker's output. Note that we need
to check _LoadLinkerOutput even if we've already disabled the linker, because
there may be linker output from a previous (connected) build, and we don't
want to load that.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1542438.
2022-05-23 16:33:09 +02:00
Rolf Bjarne Kvinge 75e1c6b211 [devops] Shorten vs workload names even more. 2022-05-20 17:38:21 +02:00
Rolf Bjarne Kvinge f5dfe434bd Merge remote-tracking branch 'origin/main' into net7.0 2022-05-19 23:20:20 +02:00
Rolf Bjarne Kvinge 4c2ddcf349
[dotnet-linker] Bump default trampoline count when using the interpreter on x64 in .NET. Fixes #14887. (#15025)
Fixes https://github.com/xamarin/xamarin-macios/issues/14887.
2022-05-18 11:27:28 +02:00
Rolf Bjarne Kvinge 8b9cd60dc6
[dotnet] Update localized json files. (#15024)
This is just changing line endings, ignoring whitespace shows no changes.
2022-05-13 20:49:51 +02:00
VS MobileTools Engineering Service 2 7d9dad24fc
Localized file check-in by OneLocBuild Task: Build definition ID 14411: Build ID 6124703 (#14931)
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2022-05-12 12:25:41 -05:00
Rolf Bjarne Kvinge 92eda7f353
[dotnet] Add support for selecting whether to create P/Invoke wrappers or not. Fixes #4940. (#14961)
* This is a potential mitigation for slower transition to native code when
  exception marshalling is enabled (#14812).
* A minor modification was required in the linker, to make sure any modified
  assemblies are saved.

Fixes https://github.com/xamarin/xamarin-macios/issues/4940.
2022-05-11 16:42:01 +02:00
Rolf Bjarne Kvinge f2bcedd441
[msbuild/dotnet] Add support for passing --aot arguments to the AOT compiler. (#14936)
Pick up --aot arguments in MtouchExtraArgs and pass them to the AOT compiler
when building a .NET project. This makes it possible to work around #14887 by
manually increasing the number of trampolines.

Ref: https://github.com/xamarin/xamarin-macios/issues/14887
2022-05-10 16:25:19 +02:00
Rolf Bjarne Kvinge d1b7606181
Adjust versioning scheme for .NET to make the third field the commit distance. (#14923)
Adjust our versioning scheme so that the NuGet version is
`Major.Minor.CommitDistance`. The previous scheme ("Major.Minor.<fixed-ish
version>") causes problems on branches producing stable builds, because each
new commit would end up with the same NuGet version, and we wouldn't be able
to push those to a NuGet feed because there might already be an existing
version there.

By using the commit distance in the NuGet version we ensure that every commit
has a different version.
2022-05-10 09:28:39 +02:00
Rolf Bjarne Kvinge 525407b104 Merge remote-tracking branch 'origin/main' into net7.0 2022-05-09 15:50:41 +02:00
Rolf Bjarne Kvinge 01c3127c8c
[dotnet] Don't set '_RunAotCompiler' on macOS if 'MtouchInterpreter' is set. (#14874)
There's no AOT compiler for macOS, so setting _RunAotCompiler causes problems
because if it's set, we try to find the AOT compiler, and because there is
none, the build fails.

So don't set '_RunAotCompiler' if 'MtouchInterpreter' is set (which also
indirectly means if 'UseInterpreter' is set) to avoid the problem altogether.
2022-05-05 16:16:40 +02:00
Rolf Bjarne Kvinge 86b14a77a2 Merge remote-tracking branch 'origin/main' into net7.0 2022-05-05 09:04:10 +02:00
Rolf Bjarne Kvinge 2684b1de5e
[dotnet] Update generated files after template changes. (#14851) 2022-05-03 10:06:27 +02:00
Peter Collins e1073eb630
[dotnet/Templates] Remove preview language (#14842)
Removes the "(Preview)" string from the title of the .NET templates.
2022-04-29 09:56:56 +02:00
Eric Sink b84b80902c
Build fixes (-dotnet) for app extensions (#14685)
Resolves #14285 

1.  Make sure `libextension-dotnet.a` gets built, and with the `-DEXTENSION` flag.
2.  Make sure `libextension-dotnet.a` gets included in the package alongside `libxamarin-dotnet.a`
3. At build time, make sure to link with the correct lib[tv]extension-dotnet.a library depending when we need to.
4. Add some tests.

Co-authored-by: Eric Sink <eric@Erics-MacBook-Pro.local>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-04-25 16:56:52 +02:00
Rolf Bjarne Kvinge a9a638553f
[msbuild/dotnet] Fix building binding projects on Windows in .NET (#14704)
When building a binding project, we need to execute bgen (and csc) on the mac. Figuring
out where these files are on the Mac is rather complicated from a remotely executed
task, so instead we execute a sub-build that computes these properties.

In legacy Xamarin this was accomplished by building the 'Xamarin.iOS.ObjCBinding.Common.props'
file using msbuild, and invoking a custom target that prints the property we're looking
for (the 'targetGetPropertyValue_*' targets).

For multiple reasons this approach doesn't work in .NET anymore (in particular it
seems that the 'Xamarin.iOS.ObjCBinding.Common.After.targets' file with the custom
'targetGetPropertyValue_*' targets is nowhere to be found, but logic has also moved
around in the .targets/.props files which makes just building the 'Xamarin.iOS.ObjCBinding.Common.props'
not work correctly since the properties we need wouldn't be set).

So I'm adding a new task that does a sub-build, using either msbuild or dotnet as
appropriate, to compute the properties we need. Instead of building the 'Xamarin.iOS.ObjCBinding.Common.props'
file, the task creates an actual binding project (an empty one), and executes the
new '_WriteRemoteGeneratorProperties' target in this binding project.

An additional advantage in this new task is that it will only execute one sub-build
where all the properties are computed (the previous approach executed one sub-msbuild
per property).

In order to keep code as similar as possible between legacy Xamarin and .NET, the
new task is being used for legacy Xamarin as well (and the old approach deleted).

This fixes building binding projects on Windows in .NET.
2022-04-22 16:17:03 +02:00
Manuel de la Pena 45650ee23a
[Dotnet] Fix the template on iOS and Catalyst to use the system background color. (#14766) 2022-04-20 07:54:49 -04:00
Rolf Bjarne Kvinge e886e954af
[dotnet] Update localized json files. (#14770)
These files are updated during the build, and the working copy is left dirty,
so commit these files.
2022-04-19 16:26:24 +02:00
VS MobileTools Engineering Service 2 001920f754
Localized file check-in by OneLocBuild Task: Build definition ID 14411: Build ID 6035860 (#14756) 2022-04-18 18:10:04 -04:00
Rolf Bjarne Kvinge a806c658c9 Merge remote-tracking branch 'origin/main' into net7.0 2022-04-07 09:36:50 +02:00
Rolf Bjarne Kvinge 9c185e1fff
[msbuild] Ask ditto to thin native libraries according to the architectures we're targetting. Fixes #13081. (#14403)
Ask ditto to thin native libraries and frameworks when copying them to the app
bundle to remove slices for architectures we're not building for.

Also add tests.

Fixes https://github.com/xamarin/xamarin-macios/issues/13081.

Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2022-04-07 08:17:01 +02:00
Rolf Bjarne Kvinge df3a04804c Merge remote-tracking branch 'origin/main' into net7.0 2022-04-06 21:32:03 +02:00
Rolf Bjarne Kvinge 7a0c7428b8
[dotnet] Don't list OS versions we don't support. (#14665)
Our min OS target versions are different between legacy Xamarin and .NET
(former supports earlier versions). The list of versions in the Versions.plist
contain all the versions supported by legacy Xamarin, but that's not correct
for .NET, so don't list any version in Version.plist that's lower than the
minimum OS version we support for a given platform.
2022-04-06 17:53:06 +02:00
Rolf Bjarne Kvinge a98fefaea0 Merge remote-tracking branch 'origin/main' into net7.0 2022-04-06 10:17:54 +02:00
Emanuel Fernandez Dell'Oca 3af92421f9
[dotnet] Adds platform specific RID options (#14643)
This enables Visual Studio to set a specific `RuntimeIdentifier` for each platform when building all target frameworks in a MAUI project.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-04-06 09:39:33 +02:00
Rolf Bjarne Kvinge 6f09631349 Merge remote-tracking branch 'origin/main' into net7.0 2022-04-04 14:37:26 +02:00
Rolf Bjarne Kvinge 6e348f0e65
[dotnet] Port the iOS tabbed app template to .NET. (#14592)
Ref: https://github.com/xamarin/xamarin-macios/issues/10747
2022-04-04 10:05:08 +02:00
Rolf Bjarne Kvinge c4879f5142
[dotnet] Adjust template descriptions to not say .NET 6, just plain .NET instead. (#14607) 2022-04-04 09:52:02 +02:00
Rolf Bjarne Kvinge a6536d45f1 Merge remote-tracking branch 'origin/main' into net7.0 2022-04-01 18:37:34 +02:00
Chris Hamons 11a7c84d52
[dotnet] Update macos template to visible at launch (#14581)
Fixes https://github.com/xamarin/xamarin-macios/issues/14420

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-04-01 10:20:28 -05:00
Rolf Bjarne Kvinge 4f46162e2b Merge remote-tracking branch 'origin/main' into net7.0 2022-03-31 09:11:54 +02:00
Rolf Bjarne Kvinge 6fa6b75f19
[dotnet] Don't include @(Compile) and @(EmbeddedResource) items in @(BundleResource) items by default. Fixes #14442. (#14571)
Fixes https://github.com/xamarin/xamarin-macios/issues/14442.
2022-03-31 08:17:53 +02:00
Alexander Köplinger b8c493c3e1
Set IsImplicitlyDefined="true" on the System.Runtime.InteropServices.NFloat.Internal PackageReference (#14532)
* Set IsImplicitlyDefined="true" on the System.Runtime.InteropServices.NFloat.Internal

This unbreaks Central Package Management via https://github.com/microsoft/MSBuildSdks/tree/main/src/CentralPackageVersions which is being worked on for NuGet, see https://github.com/NuGet/Home/issues/6764

* Add test case

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-03-30 10:13:39 +02:00
Rolf Bjarne Kvinge 25c18bf770 [dotnet] Adjust template descriptions to not say .NET 6, just plain .NET instead. 2022-03-29 17:30:04 +02:00
Rolf Bjarne Kvinge e652068e5e Merge remote-tracking branch 'origin/main' into darc-main-fc6e47e2-7b69-4464-b65f-8f67ca26b4e8 2022-03-25 14:32:42 +01:00
Rolf Bjarne Kvinge 43f87ec4c1
[msbuild] Only conditionally copy the entire input directory from Windows in the Ditto task. (#14495)
Sometimes we want to copy the entire input directory from Windows to the Mac
when executing the Ditto task remotely, and sometimes we don't.

In particular we do not want to copy the input directory when the directory on
Windows is an incomplete mirror of what's on the Mac - one scenario being when
copying the app bundle to prepare for IPA creation. The .app directory on
Windows is not complete - all the files are there (maybe? not quite sure, but
that's beside the point here), but some may be empty, because when we only
care about the timestamp for a file, we'll create an empty file on Windows to
mirror the actual file on Mac. Copying this incomplete directory to the Mac,
overwriting the correct files there, will break things badly.

However, sometimes we're not mirroring a directory on Windows, but instead we
have directories as actual build input (for instances frameworks from NuGets),
and in that case we want to copy everything to the Mac.

So this PR adds a parameter to the Ditto task to optionally copy the directory
from Windows for remote builds, and we enable this behavior when we want it -
specifically when copying frameworks.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1506009 while not
regressing https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1492635.

Ref: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1506009
Ref: https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1492635
Ref: https://github.com/xamarin/xamarin-macios/pull/14375
2022-03-25 14:08:05 +01:00
Rolf Bjarne Kvinge c4f0087c98 Merge remote-tracking branch 'origin/main' into darc-main-fc6e47e2-7b69-4464-b65f-8f67ca26b4e8 2022-03-25 09:46:57 +01:00
Rolf Bjarne Kvinge a1a4771448
[dotnet] Update doc about breaking nfloat changes and when we generate a global using directive. (#14487) 2022-03-25 07:40:23 +01:00
Rolf Bjarne Kvinge fff82a980c [dotnet] Create manifest workload with the correct name (appending the prerelease component). 2022-03-24 22:59:58 +01:00
Rolf Bjarne Kvinge d95f2d15ad
[dotnet] Use a variable for 'net6.0' instead of hardcoding it. (#14481)
This makes it easier to bump to 'net7.0' when that time comes.
2022-03-24 16:41:29 +01:00
Rolf Bjarne Kvinge 78963700e7
[dotnet] Only add a global nfloat using if we're compiling for C# 10 or later. Fixes #14434. (#14475)
Fixes https://github.com/xamarin/xamarin-macios/issues/14434.
2022-03-24 10:14:16 +01:00
Rolf Bjarne Kvinge d9e3206125
Merge branch 'main' into dotnet-dsyms 2022-03-23 22:24:51 +01:00
Rolf Bjarne Kvinge cbaa6e8f5d [devops] Attempt to install sdk manifest to make workload installs possible. 2022-03-23 09:59:19 +01:00
Rolf Bjarne Kvinge cb1189e2fa Merge remote-tracking branch 'origin/main' into darc-main-fc6e47e2-7b69-4464-b65f-8f67ca26b4e8 2022-03-23 09:06:27 +01:00
Rolf Bjarne Kvinge e44d0fd047
[.NET] Rename several DOTNET6_* variables to to DOTNET_*. (#14463)
Also rename DOTNET_VERSION to SYSTEM_DOTNET_VERSION to make it clear what it's
referring to (and to not clash with DOTNET6_VERSION which has now been renamed
to DOTNET_VERSION).

.NET 7 is right around the corner.
2022-03-23 08:07:34 +01:00
Rolf Bjarne Kvinge e5c81564e2 [msbuild/dotnet] Rework how we handle app bundle post processing. Fixes #14067.
Change dSYM generation and native stripping to occur immediately before code signing,
in a newly minted post processing target.

Challenges:

* Both calling 'strip' and 'codesign' on an executable modifies that executable,
  which means that we must make sure to not call 'dsymutil' on the same binary at
  a later point unless it's been rebuilt.
* Thus we must make sure to update 'dsymutil's stamp file whenever we call 'strip'
  and/or 'codesign' on an executable.
* Just like for code signing, we must store the libraries (either static or dynamic)
  we post process in extension/watch/rid-specific projects, so that these libraries
  can be loaded in containing projects and processed there.
* In universal .NET builds, debug symbols are created for the universal app bundle,
  not for each rid-specific version of the app bundle. So I had to add logic to create
  the native symbol lists (MtouchSymbolsList) for each rid-specific build, but then
  collect them and merge those lists for the universal app bundle.

The existing SymbolStrip call we did right after linking the native executable has
been removed, because we have to do that after creating the dSYM (which the GenerateDebugSymbols
target does).

Also add tests.

Fixes https://github.com/xamarin/xamarin-macios/issues/14067.
2022-03-22 16:14:26 +01:00
Rolf Bjarne Kvinge 24eff5d8ff Merge remote-tracking branch 'origin/main' into darc-main-fc6e47e2-7b69-4464-b65f-8f67ca26b4e8 2022-03-22 08:20:30 +01:00
Rolf Bjarne Kvinge e369f466f7
[dotnet] Rename the DOTNET6 make variable to DOTNET. (#14441)
This is the follow-up to where the DOTNET variable was renamed SYSTEM_DOTNET.
2022-03-21 15:56:57 +01:00
Rolf Bjarne Kvinge 76080a5e79 Merge remote-tracking branch 'origin/main' into darc-main-fc6e47e2-7b69-4464-b65f-8f67ca26b4e8 2022-03-14 20:35:15 +01:00
Rolf Bjarne Kvinge bae720f7f8 Make the manifest version band include prerelease components.
Ref: 7e25f16c88/documentation/general/workloads/workload-preview-bands.md
2022-03-14 20:35:12 +01:00
Rolf Bjarne Kvinge 8b6d7d5914
[dotnet] Update template strings. (#14399)
When adding support for localizing template strings, this wasn't included
because it was merged after the template localization work started.
2022-03-14 18:21:16 +01:00
Rolf Bjarne Kvinge b365959400 Merge remote-tracking branch 'origin/main' into darc-main-fc6e47e2-7b69-4464-b65f-8f67ca26b4e8 2022-03-11 17:20:13 +01:00
Bekir Ozturk af30c26381
[Localization] Turn on template localization on dotnet CLI (#14213) 2022-03-11 10:30:47 -05:00
Rolf Bjarne Kvinge 3f4cbb5e44 Merge remote-tracking branch 'origin/main' into darc-main-fc6e47e2-7b69-4464-b65f-8f67ca26b4e8 2022-03-11 14:34:02 +01:00
Tim Miller d61f187614
Update code-behind templates to correctly support Dark Mode, bind text to the center of the screen (#14367) 2022-03-11 09:05:59 +01:00
Rolf Bjarne Kvinge bb655a3840
[dotnet] Only validate the RuntimeIdentifier if we need/use it. Fixes #13482. (#14339)
Fixes https://github.com/xamarin/xamarin-macios/issues/13482.
2022-03-09 08:22:52 +01:00
Rolf Bjarne Kvinge 3da0665ff5
[msbuild] Make the _NoSymbolStrip and _NoDSymUtil properties public by removing the leading underscore. (#14248)
These are useful properties that were exposed in legacy Xamarin as Mtouch*
properties.
2022-02-28 11:27:44 +01:00
Rolf Bjarne Kvinge c589b4cf4e
[msbuild] Store the .NET version in the app's Info.plist when building an app using .NET. Fixes #14108. (#14215)
Also change the key for our Info.plist entry with the version number in .NET, and document the change.

We now use "com.microsoft.<platform in lower case>" instead of "com.xamarin.ios" (for all platforms).

Fixes https://github.com/xamarin/xamarin-macios/issues/14108.

Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2022-02-24 20:44:42 +01:00
Rolf Bjarne Kvinge bd97933b60
[runtime] Remove ObjCRuntime.nfloat in favor of System.Runtime.InteropServices.NFloat. (#14197)
* Remove ObjCRuntime.nfloat (in favor of   System.Runtime.InteropServices.NFloat).
* Automatically add a reference to the System.Runtime.InteropServices.Internal
  package, so that developers get the new NFloat API (with operators) we've
  added post .NET 6 (but don't do this for .NET 7).
* Automatically add a global using alias for
  System.Runtime.InteropServices.NFloat -> nfloat. This is not behind the
  usual `ImplicitUsings` condition our other implicit usings are, because
  they're off by default for existing projects, and the main target for the
  global using alias for nfloat is upgraded projects.
* Automatically generate a global using alias (like above) in the generator
  for all code the generator compiles.
* Update xtro entries to reference System.Runtime.InteropServices.NFloat
  instead of ObjCRuntime.nfloat.
* Add a workaround for a hopefully temporary issue with .NET/CoreCLR where the
  wrong runtime pack is selected otherwise (without the new NFloat API, so
  nothing works at runtime).

Ref: https://github.com/xamarin/xamarin-macios/issues/13087
2022-02-24 16:51:12 +01:00
Rolf Bjarne Kvinge c0074d0c79
[dotnet] Hardcode the version band instead of inferring it. (#14225) 2022-02-23 20:43:27 +01:00
Rolf Bjarne Kvinge 4fd770c3c4
[msbuild/generator] Pass .NET's C# compiler to bgen to use. Fixes #12922. (#14192)
We can't execute mono's C# compiler when using .NET, so we need to tell bgen
where csc is in that case.

Fixes https://github.com/xamarin/xamarin-macios/issues/12922.
2022-02-23 09:36:43 +01:00
Rolf Bjarne Kvinge 166f42b987
[dotnet] Name all templates as preview templates. (#14210)
All templates except one were named "... (Preview)".

Now the one outlier has joined the rest.
2022-02-23 08:19:23 +01:00
Rolf Bjarne Kvinge 78b17e1a24 More bumps. 2022-02-21 22:27:34 +01:00
Rolf Bjarne Kvinge 1bdd8f9a32 Bump templates. 2022-02-21 21:43:56 +01:00
Rolf Bjarne Kvinge 96c32e380e
[msbuild/dotnet] Make codesigning createdump work in universal apps. Fixes #14155. (#14196)
We don't sign each rid-specific bundle, but we sign the final merged app bundle instead.
This means that we must store the list of files to codesign from the rid-specific
build and load those lists before running codesign on the merged app bundle.

https://github.com/xamarin/xamarin-macios/issues/14155.
2022-02-21 08:24:09 +01:00
Alex Soto 72aa44989b
Update SignList.xml to look for our new Microsoft.* assemblies 2022-02-18 11:36:52 -05:00
Rolf Bjarne Kvinge 21d7dd8de3
[msbuild] Move debug-related targets to shared code. (#14180) 2022-02-18 16:35:28 +01:00
Rolf Bjarne Kvinge e25163f573
[.NET] Rename our product assemblies. Fixes #13748. (#13847)
Rename our product assemblies to:

* Microsoft.iOS.dll
* Microsoft.tvOS.dll
* Microsoft.macOS.dll
* Microsoft.MacCatalyst.dll

This makes it easy to distinguish between legacy Xamarin and .NET whenever the
product assembly is mentioned, and I've also chosen the platform part of the
name to match how the platforms are named elsewhere (this also makes it
possible to simplify our build logic, since we can remove a lot of special
casing).

Fixes https://github.com/xamarin/xamarin-macios/issues/13748.
2022-02-16 21:30:32 +01:00
Rolf Bjarne Kvinge 5b8250486f
[dotnet/msbuild] Run install_name_tool to fix the id for dylibs. Fixes #13999. (#14147)
Fixes https://github.com/xamarin/xamarin-macios/issues/13999.
2022-02-16 21:13:40 +01:00
Rolf Bjarne Kvinge a404081365
[dotnet] Add support for the PublishFolderType metadata on Content and BundleResource items. (#14162)
Add support for the PublishFolderType metadata on Content and BundleResource
items, which makes it possible to change the location in the app bundle for
these items (this was possible to do before with the Link metadata), but most
importantly it also makes it possible to choose to *not* bundle these items in
the app bundle (which was not possible before with the Link metadata, nor any
other means).

At first I thought setting CopyToPublishDirectory /
CopyToOutputDirectory=Never would accomplish that, but it turns out we don't
honor those, and since we already have this behavior of ignoring
CopyToPublishDirectory / CopyToOutputDirectory in legacy Xamarin, I didn't
want to change it in .NET.

So I added support for honoring the PublishFolderType metadata instead, which
is new and we already support for other item groups. This is accomplished by
adding all Content and BundleResource items with PublishFolderType set to the
ResolvedFileToPublish item group (where we already handle any
PublishFolderType values), and then we ignore such Content and BundleResource
items in our CollectBundleResources task.

Also update the documentation and add tests.
2022-02-16 20:54:14 +01:00
Rolf Bjarne Kvinge 404b6e9af5
[msbuild/dotnet] Set NoBindingEmbedding to 'true' by default in .NET. Fixes #12530. (#12694)
Not embedding third-party libraries in the binding assembly is the future, and
let's try to enable it by default starting with .NET.

Fixes https://github.com/xamarin/xamarin-macios/issues/12530.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-02-16 10:30:41 +01:00
Eric Erhardt 0f68a8231b
Default VerifyDependencyInjectionOpenGenericServiceTrimmability (#14130)
We need to use better default values for `$(VerifyDependencyInjectionOpenGenericServiceTrimmability)`.

This feature switch ensures that DynamicallyAccessedMembers are applied correctly to open generic types used in Dependency Injection.

In the base SDK, this switch is enabled when `PublishTrimmed=true`. However, iOS apps don't set `PublishTrimmed=true` until a Target. So devs are missing out on this validation.

Conversely, in published apps, we don't want to pay the cost of doing this validation. It was showing up in startup profiles on Android. So turning the feature switch off in Release builds (builds without debugging enabled).

Port of 90f546cacc

Note, in Android we used `PublishTrimmed` to set this property, but in iOS `PublishTrimmed` isn't set yet. So I followed the same pattern as `UseSystemResourceKeys`, which is the same scenario - when a dev is developing the app vs. a production build.
2022-02-15 08:39:28 +01:00
Rolf Bjarne Kvinge d8e7d2c854
[dotnet] Sign the 'createdump' executable. Fixes #13417. (#14111)
Fixes https://github.com/xamarin/xamarin-macios/issues/13417.
2022-02-15 08:28:29 +01:00
Rolf Bjarne Kvinge 8b3b6a7adf
[dotnet/runtime] Fix a few issues with regards to extensions in .NET. Fixes #13742. (#14115)
* Propagate the IsAppExtension variable correctly.

* Don't try to call mono_domain_set_config for app extensions in .NET.

  It doesn't look like it's needed, and it also immediately aborts anyway, so
  if it turns out to be needed, another solution would have to be implemented.

Fixes https://github.com/xamarin/xamarin-macios/issues/13742.
2022-02-15 08:27:25 +01:00
Rolf Bjarne Kvinge 5e462b1c21
[dotnet] Fix non-bundling of debug files for release builds. Fixes #14085. (#14103)
Fixes https://github.com/xamarin/xamarin-macios/issues/14085.
2022-02-09 16:46:04 +01:00
Rolf Bjarne Kvinge 352a0d818a
[dotnet] Include all files in the Resources subdirectory as bundle resources. Fixes #13808. (#14018)
Include all files in the project's Resources subdirectory as BundleResource
items (except .DS_Store files, which are pretty omnipresent on macOS).

Also, contrary to the other default includes, add a condition so files are
only included if we have a resource prefix (typically "Resources"), otherwise
the entire hard drive might be included, and that's not really what we want.

Fixes https://github.com/xamarin/xamarin-macios/issues/13808.
2022-02-07 18:55:31 +01:00
Rolf Bjarne Kvinge 42c87ab2f7
[runtime] Make Runtime.Arch a readonly field in .NET. Fixes #5518. (#14076)
* Make Runtime.Arch a readonly field.
* Tell the AOT compiler Runtime.Arch is a constant value.
* Tell the linker to stub out the method we use to fetch the current
  architecture from native code (it turned out a bit complicated to set the
  Arch field when it's readonly - the solution I came up with was to call a
  P/Invoke).

Test case (size of the main executable): link all (debug)

* Before:  33.522.704 bytes
* After:   33.506.112 bytes
* Difference: -16.592 bytes (-0.05 %)

There were no size differences in release mode, nor were there any size
differences in the "don't link" test, neither for debug nor release mode.

Fixes https://github.com/xamarin/xamarin-macios/issues/5518.
2022-02-07 08:05:41 +01:00
Rolf Bjarne Kvinge 9efcac2eb7
[dotnet] Update breaking changes docs. (#14044)
Make note about:

* Caveat with regards to IntPtr constructors having to be manually changed to
  be NativeHandle constructors.
* Moving NSFileProvider types.
2022-02-04 15:36:30 +01:00
Rolf Bjarne Kvinge 83e113f8f8
[CFNetwork] Remove the MessageHandler type from .NET. (#14056)
This type has been obsolete for over 3 years, it hasn't been updated in many
more years, and there are multiple newer and better alternatives available.

This meant we could remove a few more other (private/related) types as well.
2022-02-04 07:54:39 +01:00
Rolf Bjarne Kvinge 0bcb737d8a
[dotnet] Update docs about default inclusion in binding projects. (#14035)
Binding projects enable default compile items now, so the documentation saying
otherwise is outdated and must be rectified.

Ref: 499a69e772
2022-02-03 17:22:45 +01:00
imhameed adff9df98d
Link against the Compression framework. (#14034)
Mono will eventually use functions from the Compression framework to
decompress ICU data files during the runtime's initialization. Prepare
for this by linking against the compression framework.

Also see https://developer.apple.com/documentation/compression?language=objc.
2022-02-03 10:05:57 +01:00
Rolf Bjarne Kvinge 68aaef9ff7
[dotnet] Ask the linker to not mark copied assemblies if we're in a 'don't link' scenario. (#14011)
This speeds up builds significantly when the linker is disabled.

Test case: building tests/dotnet/MySimpleApp for macOS.

* Before: 37s
* After: 9s
* Difference: 26s (4x faster)

Test case: run the .NET tests

* Before: 2h55
* After: 1h43
* Difference: 1h12 (1.7x faster)

Contributes towards https://github.com/xamarin/xamarin-macios/issues/10251.
Ref: https://github.com/dotnet/linker/issues/2089
2022-02-02 08:36:17 +01:00
Rolf Bjarne Kvinge b1ce33ba51
[Foundation/ObjCRuntime] Use 'ObjCException' as the native exception type name for all platforms in .NET. Fixes #13855. (#13915)
* Use 'ObjCException' instead of 'MonoTouchException' as the managed exception
  type wrapping an NSException for all platforms in .NET (that was already the
  case for macOS, so no change there).
* Make the ObjCException class behave like the MonoTouchException class does.
* Move the ObjCException type to the ObjCRuntime namespace in .NET.

Fixes https://github.com/xamarin/xamarin-macios/issues/13855.

Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2022-02-01 17:24:57 +01:00
Rolf Bjarne Kvinge 4d2db6463b
[dotnet] Fix templates to use NativeHandle instead of IntPtr. Fixes #13979. (#14001)
Also make the (NativeHandle) constructor protected instead of public, to make
it clearer that it's not for public consumption.

And modify the template tests to execute the template if we can.

Fixes https://github.com/xamarin/xamarin-macios/issues/13979.
2022-02-01 17:22:53 +01:00
Rolf Bjarne Kvinge aaee4d9f27
[ModelIO] Adopt XAMCORE_4_0 changes in .NET. (#13941)
This turned out a bit complex, because numerous ModelIO APIs were initially bound
with wrong matrix types, and had to be rebound later (our matrix type was transposed
with regards to the native matrix type). The new versions often had to use worse
names, so that's being fixed now. This means that numerous tests had to be updated,
because the original API now returns non-transposed matrices.
2022-02-01 08:08:50 +01:00
Sebastien Pouliot 9e639d51d0
[net][objcruntime] Remove `UseAutoreleasePoolInThreadPool` in net profile (#13960)
and add it to the `BreakingChanges.md` document
2022-01-31 16:45:05 +01:00
Rolf Bjarne Kvinge a14712d6e3
[dotnet] Convert windows dir separators to mac dir separators for relative paths in the _StripAssemblyIL target. Fixes #13838. (#13919)
It seems that MSBuild doesn't always automatically convert directory
separators for relative paths, so we have to do it ourselves.

Thanks to @lauxjpn for diagnosing this and coming up with a fix.

Fixes https://github.com/xamarin/xamarin-macios/issues/13838.
2022-01-28 10:28:47 +01:00
Vlada Shubina 4a98896977
Ensure PackageType = Template for template packages (#13894)
## Problem

Template package does not appear on nuget.org correctly, as `packageType` in nupkg is set to `DotnetPlatform`.

## Solution

Disabled loading Microsoft.DotNet.SharedFramework.Sdk for template package build.
it doesn't seems to be needed and overwrites PackageType to DotnetPlatform, even though initially it is correctly set to 'PackageType'
2022-01-28 10:17:31 +01:00
Chris Hamons 6ce1ff7093
[NET6] Add binding project template for iOS and MacCatalyst (#13840)
- Fixes https://github.com/xamarin/xamarin-macios/issues/13578
- Uses older-style namespace with {} instead of top level due to https://github.com/xamarin/xamarin-macios/issues/13837
2022-01-25 10:05:56 -06:00
Rolf Bjarne Kvinge fa2173e5ef
[CFNetwork] Move the CFHost and CFHTTP* types to the CFNetwork namespace in .NET. (#13761)
These types come from the CFNetwork.framework, but for some reason they were bound inside CoreServices many years ago.

This resolves a potential issue where we might end up linking with the
CoreServices framework instead of CFNetwork framework (because we use the
namespace of types to determine which framework they belong to).
2022-01-19 08:07:06 +01:00
Rolf Bjarne Kvinge 6564841c6a Merge remote-tracking branch 'origin/main' into dotnet-resolvedfiletopublish 2022-01-14 11:00:16 +01:00
Rolf Bjarne Kvinge 9894605c4f
[SceneKit] Make SCNMatrix4 column-major in .NET. Fixes #4652. (#13695)
* Implement a column-major version of SCNMatrix4 in .NET to match native code.
* This was done by copying the existing SCMatrix4 implementation, and modify it
  as required (doing it with conditional compilation in the same file turned out
  to be quite messy, so I opted for using different files for legacy Xamarin and
  .NET).
* There was one major change: the matrix inversion algorithm is new (copied from
   .NET instead), because the legacy Xamarin version showed strange results with
  some test values.
* Add setters for SCNMatrix4.Column[0-3] for legacy Xamarin to match the .NET API.
* Add CreateFromColumns methods for legacy Xamarin to match the .NET API.
* Add tests for all the new API.

Fixes https://github.com/xamarin/xamarin-macios/issues/4652.
2022-01-14 07:30:19 +01:00
Rolf Bjarne Kvinge b5908a72d2 [dotnet] Use a task to collect decompressed *.[xc]frameworks. 2022-01-13 22:36:41 +01:00
Mauro Agnoletti 5c342f0283
Include Broker satellite assemblies to the sign list (#13688) 2022-01-13 16:30:33 -05:00
Rolf Bjarne Kvinge a2e4438536 Merge remote-tracking branch 'origin/main' into dotnet-resolvedfiletopublish 2022-01-13 22:13:00 +01:00
Rolf Bjarne Kvinge 4c2d0fe103 [dotnet] Split decompressing zip files and figuring out what was inside the zip files in two different tasks.
Split decompressing zip files and figuring out what was inside the zip files
in two different tasks, so that we do the second part even if the first part
isn't done (it could have been done in a previous build).

This is required for rebuilds to work correctly.
2022-01-13 22:11:58 +01:00
Rolf Bjarne Kvinge 205f22ff75 [dotnet] Touch all the destination files when copying a directory to an app bundle.
This fixes the following problem:

* App with framework is built and signed.
* App is rebuilt, and the framework is copied in again.
* This time, the framework's executable's timestamp will be earlier than the
  timestamp when it was last signed, and as such it won't be signed again.

Fix this by touching all the copied files when copying a directory to the app bundle.
2022-01-13 22:09:02 +01:00
Rolf Bjarne Kvinge 473df24a2e
[dotnet] Update breaking changes documentation to talk about nint/nuint. (#13675) 2022-01-12 12:45:52 +01:00
Rolf Bjarne Kvinge 214064d430 Merge remote-tracking branch 'origin/main' into dotnet-resolvedfiletopublish 2022-01-11 17:32:26 +01:00
TJ Lambert a0ad207ea7
[Dotnet] Automatically Allow Assets of all types and Test (#13346) 2022-01-10 08:32:05 -06:00
James Parsons 321ceb62a4
Remove xamarin iOS designtime targets import (#13659)
These files are no longer used by the XamarinVS extension and the import is therefore unnecessary.
2022-01-10 13:03:33 +01:00
Rolf Bjarne Kvinge fa8f6a6f5c [dotnet] Update comment. 2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge acdd27a9ef [dotnet] Update the relative path of every item left in ResolveFileToPublish.
Update the relative path of every item in the ResolveFileToPublish item group to
be relative to the root of the app bundle.
2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge 62e5655009 [dotnet] Collect binding resource packages and remove them from the ResolvedFileToPublish item group.
Collect all the binding resource packages, add our binding resource packages to the
items that need to be resolved, and remove them from the ResolvedFileToPublish item
group.

Depending on the resolved content (static library, dynamic library, framework) of
a binding resource package, we must do different things , so these items must be
removed from the ResolvedFileToPublish item group.
2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge 007bd92830 [dotnet] Collect dynamic libraries, add them to the _FileNativeReference item group, and remove them from the ResolvedFileToPublish item group.
Any dynamic libraries in _FileNativeReference will be copied to the app bundle elsewhere.
2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge 6331fc6f23 [dotnet] Link with any static libraries, but remove them from the ResolvedFileToPublish item group.
Static libraries are not copied to the app bundle.
2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge 434178fa2d [dotnet] Collect compressed plugins and remove them from the ResolvedFileToPublish item group.
The _DecompressPlugIns target will process all the items in the _CompressedPlugIns
item group, decompress them and add them to _DirectoriesToPublish. The compressed
file itself is not copied to the app bundle.
2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge b27ef8033d [dotnet] Collect plugins and remove them from the ResolvedFileToPublish item group.
We can't keep plugins in the ResolvedFileToPublish item group, because plugins are
usually directories, which may contain symlinks, which the built-in publish logic
doesn't handle correctly.
2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge 5423457fd8 [dotnet] Collect compressed frameworks into the _CompressedAppleFrameworks item group and remove them from ResolvedFileToPublish.
The _DecompressAppleFrameworks target will process all the items in the _CompressedAppleFrameworks
item group, decompress them and add them to _FrameworkNativeReference. The compressed
file itself is not copied to the app bundle.
2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge 2244a45e56 [dotnet] Collect and resolve .xcframeworks into .frameworks and add the result to the _FrameworkNativeReference item group. 2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge c61c71409a [dotnet] Add frameworks to the _FrameworkNativeReference item group, and remove them from ResolvedFileToPublish. 2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge 010e7e216b [dotnet] The first thing we do after computing the bundle location for each path, is to re-populate the ResolvedFileToPublish item group with the results. 2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge 583230824d [dotnet] Remove _BundleResourceWithOutputPath from ResolvedFileToPublish, we're already handling those files elsewhere. 2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge 86b9fb4ea9 [dotnet] The 'createdump' executable goes in the same directory as all the assemblies 2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge 7096d7626d [msbuild] Remove the static libraries (.a) we ship with Xamarin from ResolvedFileToPublish 2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge 07f0f3eefb [dotnet] Only publish a single icu*.dat file 2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge 59096ba942 [dotnet] We're not bundling the runtimeconfig.json file.
It's parsed at build time (in the _CreateRuntimeConfiguration target), and stored
in a binary format, so we don't need the original json file.
2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge 22220b149c [dotnet] Start using the new ComputeBundleLocation task 2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge 3dc0fe881a [dotnet] Add target to decompress compressed binding resource packages.
This new target will process all the items in the _CompressedAppleBindingResourcePackage
item group, decompress them, and then resolve the extracted results.
2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge ee55170feb [dotnet] Add target to decompress compressed plugins.
This new target will process all the items in the _CompressedPlugIns item group,
decompress them, and add them to _DirectoriesToPublish for later copying into the
app bundle.
2021-12-22 10:17:35 +01:00
Rolf Bjarne Kvinge e617903fac [dotnet] Add target to decompress compressed frameworks.
This new target will process all the items in the _CompressedAppleFrameworks item
group, decompress them, resolve them if necessary (for .xcframeworks) and add them
to _FrameworkNativeReference.
2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge 0d0b0bc86b [dotnet] Always set 'UseAppHost' and '_RuntimeIdentifierUsesAppHost' to 'false' in .NET.
Otherwise .NET might want to include an app host in the app, which ends up with a
build warning, because we don't use apphosts.
2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge 86a3689b77 [dotnet] Make sure that MSBuild doesn't strip away our PublishFolderType metadata 2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge 19de8ca69e [dotnet] Add documentation about how we determine where files go in the app bundle 2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge 94b1536ba8 [dotnet] There's no need to compute the publish location if we're not building a (publishable) app 2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge 3b187b4075 [msbuild] Rename the _CopyFrameworksToBundle target to _CopyDirectoriesToBundle
We're soon going to use this task to copy other types of directories (such as plugins)
as well, and in that case the old target name would be misleading.
2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge 55f11650b3 [msbuild] Move list of target dependencies for _ComputeFrameworkFilesToPublish to a separate property 2021-12-22 10:17:33 +01:00
Rolf Bjarne Kvinge b695c8c837
[dotnet] Don't add FileNativeReferences to the main libraries to link with. Fixes #13503. (#13598)
Don't add FileNativeReferences to the main libraries to link with, because we
pass that list of main libraries to the LinkNativeCodeTask, and we're already
passing the FileNativeReferences for a different task parameter.

This means that we end up adding the file native reference twice to the linker
arguments, and that's wasteful. It can also cause problems if those linker
arguments aren't always computed in the same way (once as a relative path,
once as an absolute path for instance).

Fixes https://github.com/xamarin/xamarin-macios/issues/13503.
2021-12-21 08:13:53 +01:00
Rolf Bjarne Kvinge 40905dd1f7
[msbuild/dotnet] Add a FilterStaticFramework task to filter out frameworks of static libraries from frameworks we copy to the app bundle. (#13551)
A later PR will include a test case for this.
2021-12-16 07:41:53 +01:00
Chris Hamons 4cf12e3623
[msbuild] Teach _StripAssemblyIL task to support inputs with duplicate file names but different paths (#13571)
- Fixes https://github.com/xamarin/xamarin-macios/issues/13526
- F#, along with some other cases, have files to publish that have the same filename but different folder
- The most obvious example being resources assemblies: cs/FSharp.Core.resources.dll vs de/FSharp.Core.resources.dll
- I naively copied all files into one directory ignoring path, which does not work here at all
- DestinationSubPath seems to be set unconditionally by ResolvePackageAssets but #msbuild suggested not assuming it was always there (0fc72ddb75/src/Tasks/Common/ItemUtilities.cs (L126-L128))
- So use DestinationSubPath when it is around, else fall back to the old Filename + Extension
- Since there are now subdirectories inside stripped folder, extend MakeDir to cover all file's Directory path
- Tested by hand with FSharpiOSCoolApp (.NET), I can extend an auto test if desired
2021-12-15 16:35:41 -06:00
Rolf Bjarne Kvinge b169c806fc
[dotnet] Remove Runtime.Arch and ObjCRuntime.Arch from Mac Catalyst. Fixes #10312. (#13562)
Remove Runtime.Arch and ObjCRuntime.Arch from Mac Catalyst, because they don't
apply for a Mac Catalyst app (which is neither a simulator environment, nor a
device environment).

This means that code using these APIs will have to be re-evaluated to
determine what's the correct behavior for Mac Catalyst.

Also update our tests accordingly.

Fixes https://github.com/xamarin/xamarin-macios/issues/10312.
2021-12-15 22:32:14 +01:00
Rolf Bjarne Kvinge 69015b3cec
[dotnet] Honor 'TrimMode' to specify linker behavior if LinkMode/MtouchLink aren't set. Fixes #13518. (#13543)
* Change dotnet-linker to only care about whether we're actually trimming anything or not.
* Allow LinkMde/MtouchLink to not be set if TrimMode is set.
* Detect if any assemblies are linked or not by checking the global TrimMode
  property + any TrimMode properties on assemblies.

Fixes https://github.com/xamarin/xamarin-macios/issues/13518.
2021-12-15 09:27:00 +01:00
Marek Safar 462d6286c5
Include recently two more feature switches (#13532)
NullabilityInfoContextSupport - saves a lot by trimming all C# compiler generated nullable information
BuiltInComInteropSupport - no COM support on iOS
2021-12-15 08:17:37 +01:00
Rolf Bjarne Kvinge 342b312a73
Our current behavior is to detect any None, BundleResource or Content item that's (#13550)
named 'Info.plist', and assume that's the app manifest.

That doesn't quite work when we end up with multiple 'Info.plist' entries in any
of those item groups (one example being a framework as a BundleResource - all frameworks
have an Info.plist, and there's no good way to distinguish what the developer's intention
was).

So:

1. Implement a 'AppManifestDetectionEnabled' property to disable automatic app manifest
   detection.

2. Add a public 'AppBundleManifest' property that specifies the app manifest
   (this is just a renamed version of our previously private '_AppManifest' property).

This makes it possible for app developers to:

* Disable automatic app manifest detection.
* Still have an app manifest by specifying it manually.
* Disable automatic app manifest detection, but also not specify an app manifest
  manually (so no custom app manifest at all).

Also:

* Rename '_AppBundleManifest' to '_AppBundleManifestPath' to make it less confusing
  with the new 'AppBundleManifest' property.
2021-12-14 20:56:52 +01:00
Rolf Bjarne Kvinge c85d7721d5
[dotnet] Pass -dead_strip to the native linker when we can. (#13541)
Pass -dead_strip to the native linker like we do for legacy Xamarin:

* If there are no custom linker arguments.
* If all third-party bindings in the app has SmartLink = true (this doesn't
  show up in the PR, but the logic exists for legacy Xamarin and is already
  executed for .NET, the resulting Application.DeadStrip value just wasn't
  taken into account).

This shrinks the app size a bot for a Hello World app:

* Before:     10.659.731 (https://gist.github.com/rolfbjarne/b5892a5c7fb8663d38e2b69f67bce90c)
* After:       9.940.240 (https://gist.github.com/rolfbjarne/8404394180fb9971bd2f1475b747c70a)
* Difference:   -719.491 (-6.7 %)
2021-12-13 20:41:43 +01:00
Rolf Bjarne Kvinge b8e9c61409
[dotnet] Parse the -gcc_flags and -link_flags mtouch/mmp arguments and pass them to the native linker. (#13521) 2021-12-13 08:33:26 +01:00
Marek Safar c3943dbe58
Enable AggressiveAttributeTrimming (#13523)
This enables removing all kinds of infrastructure attributes for example SupportedOSPlatformAttribute (like old XI did).
2021-12-10 08:23:10 +01:00
Rolf Bjarne Kvinge cc75748c90 [builds] Download & install the Mono workload as well. 2021-12-07 20:59:52 +01:00
Rolf Bjarne Kvinge 80dec2841f
[dotnet] Generate an itemgroup with the valid runtime identifiers and use it to detect invalid runtime identifiers. (#13484)
This way we don't have to update the runtime identifier validation when we add
support for new runtime identifiers.

We'll also have an item group that lists the valid runtime identifiers, which
is making it possible (although the item group is currently private) to query
the valid runtime identifiers (which is something the IDEs have expressed
interest in).
2021-12-03 07:57:08 +01:00
Rolf Bjarne Kvinge f8b6699ab2 Merge remote-tracking branch 'origin/main' into arm64-sim 2021-12-02 09:38:36 +01:00
Rolf Bjarne Kvinge 5cc92ac564
[src] Add a new ObjCRuntime.NativeHandle type to represent native handles for .NET. Fixes #13126. (#13356)
Add a new struct, ObjCRuntime.NativeHandle, which will be used to represent
native handles for .NET (instead of using IntPtr). The main purpose is to be
able to use 'nint' as a number in API while not being prevented from using
native handles as well.

One example is NSMutableString, which has a constructor that takes a single
'nint capacity' parameter. With this change, we'll also be able to have a
constructor that takes a native handle in .NET - otherwise we'd have two
constructors with the same signature, because a C# 'nint' is just an 'IntPtr'.

This change required numerous changes pretty much everywhere. The work is
split up in commits as well as I was able to, and each commit explains what it
does.

Fixes https://github.com/xamarin/xamarin-macios/issues/13126.
2021-12-02 08:38:39 +01:00
Rolf Bjarne Kvinge 6d5aeb1ab3 [dotnet] Fix detecting simulator builds for fat apps. 2021-12-01 22:13:31 +01:00
Rolf Bjarne Kvinge 4b17520a17 [dotnet] Run the AOT compiler for ARM64 bullds for the simulator 2021-11-30 18:20:43 +01:00
Rolf Bjarne Kvinge ac441c1106 [msbuild] Detect SdkIsSimulator better for .NET by using the RuntimeIdentifier instead of only the architecture.
This way we're able to detect that "iossimulator-arm64" is actually a RID for the simulator.
2021-11-30 18:20:43 +01:00
Rolf Bjarne Kvinge c7110dbd42 [dotnet] Add runtime packs. 2021-11-30 18:20:43 +01:00
Rolf Bjarne Kvinge 2aa21751a6
[dotnet] Show an error if an app developer tries to publish a simulator architecture. (#13462)
* [dotnet] Show an error if an app developer tries to publish a simulator architecture.

* We can't publish a simulator build, so show an error in that case.
* We can't change the default runtime identifier when publishing (to a
  publishable runtime identifier), because by the time we know we're
  publishing, it's too late to change the runtime identifier. This means that
  it'll be required for app developers to specify a runtime identifier when
  publishing to a mobile platform, since the current default runtime
  identifier is for a simulator build.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/12997.

* Fix typo and improve naming.

* [dotnet] Don't use '_UsingDefaultRuntimeIdentifier', it's already used elsewhere in .NET
2021-11-29 23:13:48 +01:00
Rolf Bjarne Kvinge c60e03baa1 [dotnet] Add documentation about this breaking change. 2021-11-29 08:54:17 +01:00
Rolf Bjarne Kvinge 4afc8f7e3f
[dotnet] Put packages (.ipa/.pkg) in the publish directory by default. (#13436)
Partial fix for #12997.
2021-11-24 16:00:16 +01:00
Rolf Bjarne Kvinge dbdebb4522
[dotnet] Import the aliased pack name, not the actual pack name. (#13426)
This fixes an issue where dotnet restore would fail trying to find the pack.

Also make the aliased name look more like the other names.
2021-11-23 15:53:08 +01:00
Rolf Bjarne Kvinge 639db2a2c8
[dotnet] Make sure that the relative publish dir has a trailing slash. (#13395)
Other code elsewhere assumes this is the case.
2021-11-19 17:14:30 +01:00
Matthew Leibowitz 5b61ea59a9
Use the MANIFEST_VERSION_BAND for the manifests (#13386)
It appears that the package IDs for the manifests retain the main .NET version band, such as 100 and 200, and the packs use the full version of 101 or 203.

This PR just uses the version band for the manifest packages.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-11-19 09:24:30 +01:00
dotnet-maestro[bot] b2d97ffd3f
[main] Update dependencies from dotnet/installer (#13353)
* Update dependencies from https://github.com/dotnet/installer build 20211111.4

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21552.8 -> To Version 6.0.101-servicing.21561.4

* Update dependencies from https://github.com/dotnet/installer build 20211112.12

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21552.8 -> To Version 6.0.101-servicing.21562.12

* [dotnet] Use X.Y.Z00 as the version band for the sdk-manifests path.

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-11-15 22:54:55 +01:00
Rolf Bjarne Kvinge ab5bf2faba
[msbuild/dotnet] Build the Xamarin.PreBuilt.iOS app bundle. Fixes #12945. (#13342)
Build the Xamarin.PreBuilt.iOS app bundle instead of using a prebuilt bundle.

This makes sure that we're always using the latest BCL.

Some accurate build massaging was needed, because:

* To build the prebuilt app we need the iOS workload installed (into our build-local
  .NET installation).
* The iOS workload contains the Microsoft.iOS.Windows.Sdk pack.
* The Microsoft.iOS.Windows.Sdk pack contains the prebuilt app.

Thus we had a circular reference. Fortunately, the Microsoft.iOS.Windows.Sdk pack
is only required on Windows, which means we can break this circular reference by:

* Mark Microsoft.iOS.Windows.Sdk pack as only to be installed on Windows (unfortunately
  it seems we have to list the exact runtime identifiers for the platforms where
  to install the pack, so we can't do something like "win-*", but new variations
  of the "win-*" runtime identifier shouldn't show up all that often).
* Build the prebuilt app on macOS.

This way we don't need the Microsoft.iOS.Windows.Sdk pack when installing the iOS
workload locally.

The .NET build order is now:

* Build general sdk, runtime and ref packs for .NET.
* Build the prebuilt app.
* Build the Microsoft.iOS.Windows.Sdk pack.

Fixes https://github.com/xamarin/xamarin-macios/issues/12945.
2021-11-12 07:38:07 +01:00
Jonathan Peppers 7fb9bc98f0
[dotnet] add %(Platform) to any global @(Using) (#13196)
Context: https://github.com/dotnet/maui/pull/3018#pullrequestreview-792369556

In order for the .NET MAUI workload to properly implement implicit
global usings:

1. The .NET MAUI workload will add many `@(Using)` entries that
   conflict with each platform's APIs.

2. We need *something* to identify `@(Using)` is for a specific
   platform, so we can use a new `%(Platform)` metadata for this.

3. Late in .NET MAUI's MSBuild targets, we can do:

    <ItemGroup Condition=" '$(UseMaui)' == 'true' and ('$(ImplicitUsings)' == 'true' or '$(ImplicitUsings)' == 'enable') ">
      <Using Remove="@(Using->HasMetadata('Platform'))" />
    </ItemGroup>

In .NET 7, we might have a nicer design around this, but for now this
is the plan for .NET 6.
2021-11-02 07:37:58 +01:00
dotnet-maestro[bot] 48ef9469af
[main] Update dependencies from dotnet/installer (#13093)
* Update dependencies from https://github.com/dotnet/installer build 20211022.1

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21521.3 -> To Version 6.0.100-rtm.21522.1

* Update dependencies from https://github.com/dotnet/installer build 20211022.16

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21521.3 -> To Version 6.0.100-rtm.21522.16

* Update dependencies from https://github.com/dotnet/installer build 20211023.8

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21521.3 -> To Version 6.0.100-rtm.21523.8

* Update dependencies from https://github.com/dotnet/installer build 20211024.1

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21521.3 -> To Version 6.0.100-rtm.21524.1

* Add a dependency to Microsoft.NETCore.App.Ref.

That way we match what XA did here: 16c1226dde

It also makes Maestro update our NuGet.config for us, which additional feeds we seem
to need to build.

* [dotnet] Use all the sources in the NuGet.config when installing workloads.

* Update dependencies from https://github.com/dotnet/installer build 20211025.3

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21521.3 -> To Version 6.0.100-rtm.21525.3

* Add dependency on Microsoft.AspNetCore.App.Ref.

* Update dependencies from https://github.com/dotnet/installer build 20211026.10

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21521.3 -> To Version 6.0.100-rtm.21526.10

* [tests] Disable the implicit FSharp.Core reference.

Fixes this:

    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103: Unable to find a stable package FSharp.Core with version (>= 6.0.1)
    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103:   - Found 792 version(s) in dotnet-tools [ Nearest version: 6.0.2-beta.21519.1 ]
    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103:   - Found 46 version(s) in dotnet-public [ Nearest version: 6.0.0 ]
    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103:   - Found 0 version(s) in xamarin-impl
    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103:   - Found 0 version(s) in darc-pub-dotnet-aspnetcore-ae1a6cb-1
    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103:   - Found 0 version(s) in darc-pub-dotnet-aspnetcore-ae1a6cb
    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103:   - Found 0 version(s) in darc-pub-dotnet-runtime-4822e3c-1
    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103:   - Found 0 version(s) in darc-pub-dotnet-runtime-4822e3c-2
    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103:   - Found 0 version(s) in darc-pub-dotnet-runtime-4822e3c-4
    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103:   - Found 0 version(s) in darc-pub-dotnet-runtime-4822e3c-5
    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103:   - Found 0 version(s) in Dotnet arcade
    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103:   - Found 0 version(s) in dotnet6
    xamarin-macios/tests/fsharp/dotnet/macOS/fsharp.fsproj : error NU1103:   - Found 0 version(s) in macios-dependencies

* [tests] Use a specific FSharp.Core version.

* Update dependencies from https://github.com/dotnet/installer build 20211027.11

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21521.3 -> To Version 6.0.100-rtm.21527.11

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-10-29 18:46:00 +02:00
Rolf Bjarne Kvinge 02431b9fc8
[.NET] Move the nfloat type to the ObjCRuntime namespace for .NET. (#13092)
Also move the NMath type from the System namespace to the ObjCRuntime namespace.

Ref: https://github.com/xamarin/xamarin-macios/issues/13087
2021-10-28 11:06:31 +02:00
Chris Hamons ab5c0c6b56
[net6] Fix ILStrip'ed apps to actually work again (#13098)
* [net6] Fix ILStrip'ed apps to actually work again

- In a late minute change to the ILStrip PR (https://github.com/xamarin/xamarin-macios/pull/12563) a change to support XVS support broke execution of Apps that were stripped
- Applications were broken because none of the stripped assemblies were actually copied into the bundle
- However, the tests still passed, because all assemblies that were there had no IL (zero assemblies total)

Now why did this happen?
- The stripped assemblies were changed to return via an msbuild Output Element
- Output Element can return an Property or ItemGroup, depending if you use the PropertyName or ItemName attributes
- Unfortunately I used PropertyName, when I expected an ItemGroup. So I silently had a property created instead.
- Thus zero items were added to the list of files to copy into the bundle
- Which was undetected as the test did not confirm files were copied in, and manual tests were not run so late into the PR (3 weeks after PR was opened)

How was it fixed?
- Correctly using ItemName on Output created a valid item group to reference
- However, that still failed with an absurdly confusing error:

 PATH/Microsoft.NET.Publish.targets(277,5): error MSB3024: Could not copy the file FILE to the destination file PATH, because the destination is a folder instead of a file. To copy the source file into a folder, consider using the DestinationFolder parameter instead of DestinationFiles.

- After a splunking through netcore targets, I found the metadata on these assemblies references really matters. Without it, they are not processed correctly at all.
- Thus, I updated ILStripBase to clone the existing metadata when changing the original assembly reference to the stripped path
- Finally, I corrected the test to assert that required files are copied in. I also manually ran our device test.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-10-25 11:31:42 -05:00
Alex Soto 9c90fa8842
[CI] Update SignList.xml to fix publishing 2021-10-20 21:46:13 -04:00
Peter Collins c930ef845c
[dotnet/Templates] Add preview language (#12965)
Fixes: https://github.com/xamarin/xamarin-macios/issues/12955

Update the .NET 6 project templates to include "(Preview)" in the title
and include the "Mobile" classification where applicable. The phrase
".NET 6" has also been added to the description to help them stand out
from the regular Xamarin templates.
2021-10-11 08:00:01 +02:00
Chris Hamons a300dfc56b
[msbuild] Add ILStrip'ing for net6 applications. Fixes #11445. (#12563)
- Controlled by EnableAssemblyILStripping which defaults to true
- Integration test included

Before - https://gist.github.com/chamons/c7886f7bacbc2e5ac5966e4251d13e71
After - https://gist.github.com/chamons/148e1bef22fa336f953f3d02dcf20667

859,136 -> 527,872 managed

Fixes https://github.com/xamarin/xamarin-macios/issues/11445.
2021-10-05 09:43:22 -05:00
Rolf Bjarne Kvinge 10f833b032
[dotnet] Implement support for the MtouchFloat32 MSBuild property. Fixes #12524. (#12882)
Implement support for the MtouchFloat32 MSBuild property, and do so in a way
that allows us to change the default in the future, if we so wish.

Fixes https://github.com/xamarin/xamarin-macios/issues/12524.
2021-10-01 08:31:11 +02:00
Rolf Bjarne Kvinge 9286bfb793
[msbuild/dotnet] Compile project-level assets in the outer build for multi-rid builds. Fixes #12410. (#12847)
We don't need to compile project-level assets for every RuntimeIdentifier in
multi-rid builds, we can instead compile them just once in the outer build.

There is also a correctness issue here: we can't compile assets more than once
and expect to get the exact same compiled result every time (in particular
actool seems to be adding random bytes in to the compiled output), and this
creates a problem when trying to merge the different runtime-specific compiled
output into a universal binary.

We accomplish this by:

* Processing these assets in the outer build, before we execute the
  rid-specific inner builds.
* Store the paths to the assets we've processed in a file.
* In the inner builds, we read that file, and remove any matches from the
  corresponding item group.
* Make sure to copy the compiled assets to the app bundle at the end of the
  outer build.

These are the assets we currently handle this way:

* BundleResource
* ImageAsset
* InterfaceDefinition
* SceneKitAsset
* Collada
* TextureAtlas
* CoreMLModel

Also:

* Add a new test case (AppWithResource) that contains all these different
  types of assets.
* Add support for the ScnTool task on Mac Catalyst (which the new test case
  revealed was missing).

Fixes https://github.com/xamarin/xamarin-macios/issues/12410.
2021-09-30 08:25:10 +02:00
Rolf Bjarne Kvinge e2d1777cc7
[dotnet] Show an error if we must link, but linking has been disabled. Fixes #12372. (#12832)
For executable projects, we must run the linker (otherwise we won't produce
something that can be executed).

We'll enable the linker by default in these cases, but if the developer has
manually disabled the linker (if the linker fails to execute for any reason,
it will suggest that the developer disables it), then we should show an error
explaining why.

Fixes https://github.com/xamarin/xamarin-macios/issues/12372.
2021-09-27 07:28:10 +02:00
Rolf Bjarne Kvinge 4d5616687a
[dotnet] Fix an issue where we wouldn't re-link if some files changed. (#12794) 2021-09-24 13:20:03 +02:00
Chris Hamons a6eb528197
[net6][msbuild] Set SelfContained for AppExtensions sooner to fix publishing (#12703)
This PR resolves a crash when running the linker on publishing iOS extensions.

The crash would occur here in failing to resolve corelib.

The reason this would fail was System.Private.CoreLib.dll was not in input_assemblies.

This was because we were passes the set of reference assemblies not the expected 'real' ones, and those do not include CoreLib.

After a bunch of digging, this was because _ComputeManagedRuntimePackAssembliesIfSelfContained target was not being set as a condition of _ComputeAssembliesToPostprocessOnPublish.

_ComputeManagedRuntimePackAssembliesIfSelfContained happened to be the place these were added, and wasn't being set since it has a condition of $(SelfContained) == 'true'

Now confusingly SelfContained WAS being set to true, but only in the targets file, which was too late, as it was checked in a 'global' property group outside of a target.

This means we'd fail to set SelfContained until after the condition, and not run.

This was verified by setting /p:SelfContained=true to true.

I also looked at removing the condition above, since https://github.com/dotnet/runtime/issues/54406 is fixed, however this caused project that didn't set RuntimeIdentifier to fail.
2021-09-20 09:40:41 -05:00
Rolf Bjarne Kvinge 499a69e772
[dotnet] Enable default compile items for binding projects. Fixes #12532. (#12758)
Enable default compile items for binding projects, and just exclude any api definition
and core source from any automatically included files.

Fixes https://github.com/xamarin/xamarin-macios/issues/12532.
2021-09-20 13:41:20 +02:00
Rolf Bjarne Kvinge 728347ad63
[dotnet] Remove watchOS code and from our .NET support. (#12764)
It's not tested, and thus has probably already bitrotted. If we add support
for watchOS to .NET in the future, it would likely be easier to start from
scratch (copying some of the other platforms), than having incomplete and
bitrotted code.
2021-09-20 07:40:03 +02:00
Rolf Bjarne Kvinge 04548c7da0
[msbuild/dotnet] Include font files by default in .NET apps, and implement a way to automatically register them. Fixes #12536. (#12752)
* Automatically include *.ttf, *.ttc and *.otf in .NET projects as BundleResource
  items (if these files are found within the Resources/ subdirectory).
* Add support for a 'RegisterFont' metadata on BundleResource items, where if set
  to 'true', we'll register the font file in the Info.plist as required by the target
  platform.
* Add tests.

Fixes https://github.com/xamarin/xamarin-macios/issues/12536.
2021-09-17 10:18:09 +02:00
Rolf Bjarne Kvinge 2534607148
[dotnet-linker] Mark protocol interfaces when using the dynamic registrar. Fixes #12644. (#12737)
Fixes this test failure when running monotouch-test with the dynamic registrar and
linking has been enabled:

    MonoTouchFixtures.ObjCRuntime.RegistrarTest
        [FAIL] TestProtocolRegistration :   UIApplicationDelegate/17669
            Expected: True
            But was:  False

This is a port of what we do during linking for legacy Xamarin apps.

Ref: 682f54da87

Fixes https://github.com/xamarin/xamarin-macios/issues/12644.
2021-09-16 08:16:39 +02:00
Rolf Bjarne Kvinge bfb27da6b6
[msbuild/dotnet] Make 'LinkSdk' the default linker mode for Mac Catalyst when building for Release, and 'None' the default when building for Debug. Fixes #12264. (#12701)
Fixes https://github.com/xamarin/xamarin-macios/issues/12264.
2021-09-13 16:12:58 +02:00
Filip Navara 219fb1a753
Remove IsXcode8 (#12671)
* Remove IsXcode8

* Remove other _ForgeMetal references
2021-09-09 09:23:32 +02:00
Rolf Bjarne Kvinge cb998a3589
[msbuild/dotnet] Don't use the built-in publishing logic in .NET to copy frameworks to the app bundle. Fixes #12369. (#12656)
.NET/MSBuild don't handle symlinks properly [1], which means that we can't ask
.NET to copy frameworks to the app bundle, since frameworks may contain
symlinks.

In our case, the symptom was that instead of copying symlinks, the file the
symlink pointed to was copied instead, and then codesign complained about
invalid bundle format when we tried to sign the framework.

We fix this by having our own target (_CopyFrameworksToBundle) to copy
frameworks to the app bundle (instead of adding all the files in the
frameworks to the ResolvedFileToPublish item group), and then using 'ditto' to
copy the frameworks.

In order to create a test case for this, I also made the macOS and Mac
Catalyst versions of the XTest framework use symlinks:

* Create a proper XTest framework bundle hierarchy for macOS and Mac Catalyst
  by using the typical symlink structure (actual files in the Versions/A
  subdirectory, and then symlinks pointing into that directory).
* Create a separate Info.plist for each platform for XTest.framework, since
  using an otherwise correct framework makes tooling (such as codesign)
  complain if the Info.plist isn't correct too.

This made our existing tests show the bug.

Finally I had to fix signing frameworks where the executable is a symlink.

We were first resolving symlinks for the input - say we had an
Example.framework/Example symlink to Example.framework/Versions/A/Example -
and then checking the parent directory if it's a framework. The parent
directory of 'Example.framework/Versions/A/Example' is 'A', which did not meet
our framewrok condition (if it ends with '.framework').

The fix is to adjust the logic to resolve symlinks after checking if the input
is a framework or not.

[1]: https://github.com/dotnet/msbuild/issues/6821

Fixes https://github.com/xamarin/xamarin-macios/issues/12369.
2021-09-09 09:11:25 +02:00
Rolf Bjarne Kvinge c2fda6ebf9
[dotnet] Enable LLVM by default for release builds. Fixes #12147. (#12660)
Fixes https://github.com/xamarin/xamarin-macios/issues/12147.
2021-09-08 18:04:39 +02:00
Jonathan Peppers 1de22290d7
[dotnet] rename $(AppleShortVersion) to $(ApplicationDisplayVersion) (#12647)
Context: https://github.com/dotnet/maui/issues/1662
Context: https://github.com/xamarin/xamarin-android/pull/6139

Previously:

* `$(ApplicationVersion)` mapped to `CFBundleVersion`
* `$(AppleShortVersion)` mapped to `CFBundleShortVersionString`

To be able to leverage identical property names on iOS/Android,
we're changing this to:

* `$(ApplicationVersion)` maps to `CFBundleVersion`
* `$(ApplicationDisplayVersion)` maps to `CFBundleShortVersionString`

Lastly, let's allow `$(ApplicationDisplayVersion)` to set `$(Version)`,
so the various C# assembly-level attributes are all set to the same value.
2021-09-08 10:13:29 -04:00
Rolf Bjarne Kvinge 24ea02759f
[dotnet] Support SupportedOSPlatformVersion. Fixes #12336. (#12638)
* Add support for the SupportedOSPlatformVersion MSBuild property, and write
  it to the Info.plist for the corresponding minimum OS version.
* If there are any minimum OS version in the Info.plist, we'll now show an
  error if it doesn't match SupportedOSPlatformVersion.

This unfortunately means that if there's any minimum OS version in any
Info.plist, then that will most likely have to be moved to the
SupportedOSPlatformVersion property (or removed entirely if that's the right
choice), since it's unlikely to match the default value for
SupportedOSPlatformVersion. However, this was deemed to be the best option for
the future (it's a one-time pain during migration).

Also add new tests, update existing tests, and update the templates.

Fixes https://github.com/xamarin/xamarin-macios/issues/12336.
2021-09-08 09:20:05 +02:00
Matthew Leibowitz 14b77dc8ea
Generate msi files and VS setup authoring for all .NET 6 platforms (#12581)
* Update vs-insertion-prep.yml

* Remove filters from symbol package download as well

* [temp] Changes for testing

* Shorten manifest name

* Shorten manifest name take 2

* Add ComponentResources and WorkloadPackages for tvOS and macOS

* Don't shorten MacCatalyst name, version string replacement should suffice

* Revert "Don't shorten MacCatalyst name, version string replacement should suffice"

This reverts commit d1c1d1d89d.

* Replace long macOS versions in .msi files

* Shorten tvossimulator msi names

* Test with real signing

* Revert testing changes

* Enable tests

Co-authored-by: Peter Collins <pecolli@microsoft.com>
2021-09-01 13:55:08 -04:00
Peter Collins 12d8b37f4f
[ci] Authenticode sign Mono.Options.dll (#12585)
Commit 91c6517f bumped to a new Mono.Options package version that
included symbol files, however it appears to be missing a Microsoft
digital signature.  We can fix this by signing the file ourselves rather
than skipping it.
2021-08-30 20:53:46 -04:00
James Parsons 8ff26838ec
Import .NET 6 property page targets path in iOS sdk targets (#12556)
* Import .NET 6 property page targets path in iOS sdk targets

* Fixes MSBuildExtensionsPath casing on Microsoft.iOS.Windows.Sdk.targets

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Emanuel Fernandez Dell'Oca <ema@xamarin.com>
2021-08-27 12:17:06 +02:00
Rolf Bjarne Kvinge 93b2b7f2b7
Merge branch 'main' into dotnet-compileappmanifest 2021-08-26 17:29:19 +02:00
Filip Navara e3c915b3cf
Remove duplicate mention of "SceneKit Assets" (#12543) 2021-08-25 14:49:19 +02:00
Rolf Bjarne Kvinge 197b564c21 Merge remote-tracking branch 'origin/main' into darc-main-971a17ce-2b67-4dbe-bb13-8308d33e5f58 2021-08-24 07:26:26 +02:00
Rolf Bjarne Kvinge b3dff34ea5 [msbuild] Rework how the app manifest is created.
How we create the app manifest (Info.plist) has to be modified so that we can add
support for getting all the values from MSBuild properties (i.e. no Info.plist in
the project), as well as having multiple partial app manifests as well, that gets
merged into the final app manifest.

Here's the new process:

1. The user can specify values in multiple ways:

    * An Info.plist in their project file (by using a `None` item with
      filename "Info.plist" or with a `Link` metadata with filename
      "Info.plist"). We figure this out in the DetectAppManifest target.
    * A partial plist in their project (using the `PartialAppManifest` item group)
    * Some MSBuild properties can also add values.

    The precedence is: MSBuild properties can be overridden by the Info.plist,
    which can be overridden by a partial plist.

2. In the `CompileAppManifest` target we get all the inputs from above, and compute
a temporary app manifest, which is written to a temporary output file.

3. In the `ReadAppManifest` target, we read the temporary output file and outputs
numerous MSBuild properties (most of then private)

4. We run other targets that may add more entries to the final app manifest (these
tasks might depend on the values from `ReadAppManifest`). These entries are written
to partial plists, and added to the _PostCompilePartialAppManifest item group.

   The targets in question are:

	* _CompileImageAssets * _CompileCoreMLModels

5. In the new `WriteAppManifest` target, we read the temporary output file from `ReadAppManifest`
+ any `_PartialAppManfiest` items and merge them all together to get the final Info.plist.

This also required moving the computation of CFBundleIdentifier from the DetectSigningIdentity
task to the CompileAppManifest task. This also meant reordering these two tasks,
so that the DetectSigningIdentity task is executed after the CompileAppManifest task
(technically after the ReadAppManifest task), because the DetectSigningIdentity task
needs to know the bundle identifier.

This way we can handle multiple scenarios easily (most of this is not covered by
these changes, and will be implemented separately):

* No Info.plist at all, all non-default values come from MSBuild properties.
* A single Info.plist, where everything is specified.
* An Info.plist with multiple partial app manifests as well.
2021-08-23 17:46:33 +02:00
Rolf Bjarne Kvinge fa8e792040 [dotnet/msbuild] Create *DependsOn properties for several targets. 2021-08-23 17:46:33 +02:00
Rolf Bjarne Kvinge 92c00452a6 [dotnet] Use lowercase in several places due to https://github.com/dotnet/sdk/issues/19994. 2021-08-23 15:13:24 +02:00
Rolf Bjarne Kvinge 81ab58d897 [dotnet] Stop using DOTNETSDK_WORKLOAD_MANIFEST_ROOTS. Fixes #12101.
I can't seem to make it work anyway.

Fixes https://github.com/xamarin/xamarin-macios/issues/12101.
2021-08-23 15:13:24 +02:00
Rolf Bjarne Kvinge 49e142243d [dotnet] Remove the workaround for a broken Microsoft.NET.Sdk.Maui workload.
It's not needed anymore, and it also breaks our build because .NET gets confused.
2021-08-23 15:13:24 +02:00
Rolf Bjarne Kvinge 91d663be3d [dotnet] Install the runtime packs too, now they can be resolved from the packs folder. 2021-08-23 15:13:24 +02:00
Peter Collins c272040bdb
[ci] Push .NET 6 packages to dnceng dotnet6 feed (#12492)
We should now have the ability to push to the `dotnet6` feed that
contains the rest of the .NET 6 SDK Workload packages.  This should help
simplify workload acquisition.  The .nupkg files containing .msi the
.msi installers used for VS insertions will also now be pushed to this
feed.
2021-08-20 11:33:47 +02:00
Rolf Bjarne Kvinge 6f9a8ebbbd
[msbuild] Rename the GetMinimumOSVersion task to ReadAppManifest and make it read more properties from the app manifest. (#12485)
* Read CFBundleDisplayName and CFBundleVersion and use them in the
  _CompileITunesMetadata task.

* Read numerous other app manifest values and pass them to the ACTool and
  IBTool tasks.

This makes it possible to not parse the Info.plist in these tasks, which will
become more complicated in the future, when we might either not have an
Info.plist, or have many partial ones.

Also enable nullability.
2021-08-20 09:54:59 +02:00
Rolf Bjarne Kvinge d3c9f4b1b6
[dotnet] Make CoreCLR the only option for macOS. Fixes #12477. (#12480)
* [dotnet] Make CoreCLR the default for macOS.

* [dotnet] Show an error if trying to use MonoVM on macOS.

Fixes https://github.com/xamarin/xamarin-macios/issues/12477.

* [xharness] Remove CoreCLR variations for macOS tests.

The default is using CoreCLR for macOS, so having a specific variation for it
doesn't make sense.

* [tests] Adjust linker tests to work on CoreCLR as well.
2021-08-20 09:53:40 +02:00
Rolf Bjarne Kvinge f00b288529
[msbuild] Add a task to compute the path to the AOT compiler. (#12474)
The MonoAotCrossCompiler item group is empty when executing remotely from
Windows, so in that case we evaluate a csproj on the Mac side to compute the
AOT compiler path instead of relying in the task input from Windows.

Ref: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1362367
2021-08-19 15:48:53 +02:00
Jonathan Peppers 8d0c1c9031
[dotnet] use **FromWorkload** for targeting/runtime pack versions (#12449)
Context: https://github.com/dotnet/sdk/pull/19596
Context: https://github.com/xamarin/xamarin-android/pull/6184

If we use the version number string of `**FromWorkload**`, then our
runtime packages don't need to be resolved from a NuGet feed. They can
be resolved from the `dotnet/packs` directory.

This completely eliminates the need for a `NuGet.config` file when
building a .NET 6 app with a local build of xamarin-macios.

You will no longer need a feed such as:

    <add key="local-dotnet-feed" value="~/src/xamarin-macios/_build/nuget-feed" />

To further clean things up, I removed the need for:

* Any NuGet feed named `local-dotnet-feed`
* `$(DOTNET_FEED_DIR)`
* Generation of `dotnet/Workloads/NuGet.config`
2021-08-19 09:03:11 +02:00
Rolf Bjarne Kvinge ab88892fd1
[dotnet] Update logic for default global namespaces and fix the templates. Fixes #12457. (#12471)
* Add 'ImplicitUsings=true' to all the templates.
* Make the implicit global namespaces C#-only.
* Add the implicit global namespaces to the 'Using' itemgroup instead of the
  'Import' itemgroup.
* Make sure the global namespaces are set from AutoImport.props, so that the
  user may remove any global namespace they don't want in their project file
  (by doing something like: `<Using Remove="Foundation" />`)

Ref: https://github.com/dotnet/sdk/issues/19521
Ref: https://github.com/dotnet/sdk/issues/19793

Fixes https://github.com/xamarin/xamarin-macios/issues/12457.
2021-08-19 07:47:03 +02:00
Rolf Bjarne Kvinge 9930ddc6dd
[dotnet] Implement a workaround for .NET's lack of extensibility for 'dotnet run'. (#12458)
.NET doesn't support executing other targets/tasks when doing "dotnet run".
However, we need to (like we do for our current "Run" target), so implement a
rather simplistic/hacky workaround by making "dotnet run" just do "dotnet
build /t:Run".

It doesn't support everything that "dotnet run" does (for instance it doesn't
support the /no-build flag), but it should work for most use cases.

Ref: https://github.com/dotnet/sdk/issues/18436
2021-08-17 16:50:37 +02:00
Rolf Bjarne Kvinge 16ff955913
[runtime] Set the RUNTIME_IDENTIFER and APP_CONTEXT_BASE_DIRECTORY app context values. Fixes #12444. (#12446)
Mono and CoreCLR need this.

Fixes https://github.com/xamarin/xamarin-macios/issues/12444.
2021-08-17 15:30:27 +02:00
Rolf Bjarne Kvinge 716a5a7bd1
[msbuild] Add a property that specifies the final path to the Info.plist in the app bundle (#12433)
* Add an '_AppBundleManifest' property that specifies the final path to the
  Info.plist in the app bundle.
* Remove the '_AppBundleManifestPath' property, it's not used anywhere.
* Adjust the CompileAppManifest task to take the final path to the Info.plist,
  instead of computing it and returning it. This way the CompileAppManifest
  task does not output anything back into MSBuild (which is important, because
  the CompileAppManifest task won't execute if the output file is up-to-date,
  and if it's not executed, any output properties won't be set either).
2021-08-17 15:29:42 +02:00
Peter Collins b4e828c426
[ci] Opt in to auto .NET 6 VS PR creation (#12414)
Context: https://github.com/xamarin/yaml-templates/pull/124

The VS Insertion stage will now automatically open a PR against VS main
once approved.  The primary limitation with the current workflow is that
there is no good way to automatically create a PR against a branch other
than VS main.  This can be addressed at a later date, as we can still do
manual insertions into release branches during QB mode as needed
2021-08-16 18:29:46 +02:00
Rolf Bjarne Kvinge 961d80aedb
[dotnet] Don't use system resource keys if we're debugging. Fixes #12438. (#12439)
Fixes https://github.com/xamarin/xamarin-macios/issues/12438.
2021-08-16 10:51:16 +02:00
Rolf Bjarne Kvinge 987d8dff85
[dotnet] Fix exclusion of mono components. (#12421)
'_MonoRuntimePackPath' already contains a trailing slash, so adding another
one made two, and that was too much for MSBuild to realize that it was really
the same file as the one with only one slash in the path, and those files
weren't removed from the build correctly.
2021-08-12 17:15:08 +02:00
Peter Collins ddb699426a
[ci] Sign .NET 6 VS Hot Restart content (#12400)
Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=5074495&view=logs&j=f8a716f9-5318-5935-19a4-149a64409b96&t=773a1aad-99f2-5f0b-eafa-0deb88171543
Context: https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1366309
Context: https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1366310

Commit 9dbf451d added files required to support Hot Restart in .NET 6
packages, however it did not update SignList.xml to also include these
new file additions.  This caused .nupkg signing issues:

    C:\a\_temp\artifact-signing\SignFiles.proj(66,5): error : Unknown assemblies:
    C:\a\_temp\artifact-signing\SignFiles.proj(66,5): error :     C:\a\_temp\artifact-signing\extracted\Microsoft.iOS.Windows.Sdk.15.0.100-ci.main.446\tools\msbuild\iOS\BouncyCastle.Crypto.dll;
    C:\a\_temp\artifact-signing\SignFiles.proj(66,5): error :     C:\a\_temp\artifact-signing\extracted\Microsoft.iOS.Windows.Sdk.15.0.100-ci.main.446\tools\msbuild\iOS\imobiledevice-x64\bz2.dll;
    C:\a\_temp\artifact-signing\SignFiles.proj(66,5): error :     C:\a\_temp\artifact-signing\extracted\Microsoft.iOS.Windows.Sdk.15.0.100-ci.main.446\tools\msbuild\iOS\imobiledevice-x64\getopt.dll;
    C:\a\_temp\artifact-signing\SignFiles.proj(66,5): error :     C:\a\_temp\artifact-signing\extracted\Microsoft.iOS.Windows.Sdk.15.0.100-ci.main.446\tools\msbuild\iOS\imobiledevice-x64\ideviceactivation.dll;
    ...

Fix signing by listing all new content that should be skipped or signed
with first/third party certs.

Additionally, content in nested .zip files also needs to be signed. I've
added a couple of targets to SignList.targets to unzip and rezip these
files before and after individual file signing runs.
2021-08-12 16:40:10 +02:00
Rolf Bjarne Kvinge 2972e1b715
Fix some whitespace issues in various files. (#12399)
* Remove BOM
* Add EOL at end of file.
2021-08-11 10:06:46 +02:00
Rolf Bjarne Kvinge 46afe81149
[dotnet] Add support for 'dotnet publish'. Fixes #11807. (#12397)
* Add support for 'dotnet publish'.
* Add support for a 'PkgPackagePath' for macOS and Mac Catalyst, an MSBuild
  property to specify the resulting .pkg path, to reflect the existing
  'IpaPackagePath' (for iOS and tvOS).
* Fix MSBuild logic that uses 'IpaPackagePath'. Looks like nobody has ever
  used this...
* Add tests.

Fixes https://github.com/xamarin/xamarin-macios/issues/11807.
2021-08-11 10:01:16 +02:00
Rolf Bjarne Kvinge 104ab12bdd
[dotnet/msbuild] Fix publishing user frameworks and dynamic libraries from binding projects. (#12396)
We extract frameworks from third-party libraries when running the linker, and
we need to store this information on disk and the reload it after the linker
has executed, and add it to the existing MSBuild variables that keep track of
the user frameworks and dynamic libraries that have to be copied to the app
bundle.

Fixes the framework-test tests.
2021-08-11 09:58:00 +02:00
Sebastien Pouliot a20d417bf7
[dotnet][linker] Enable the sealer optimization (#12009)
when (by default)
* the interpreter is not enabled (since new code might subclass or override the members analyzed at build time)
* building for release

Reverts c56b893b68
Fix https://github.com/xamarin/xamarin-macios/issues/9573

Notes

* Even if possible (in metadata) there is no point in setting `final` on
a method if we remove `virtual`. This match ILLink version of the sealer
and makes the same test pass on both.

* Don't apply optimization on non-AOT builds, e.g. simulators, since some
features (like XML serialization) checks for
`RuntimeFeature.IsDynamicCodeSupported` and that requires some types
to be subclassed thru SRE
2021-08-10 16:01:30 -04:00
Rolf Bjarne Kvinge 4371133cf7
[dotnet] Remove workaround for private symbols for AOT. (#12334)
* [dotnet] Remove workaround for private symbols for AOT.

* [tools] Make Application.AotArguments a list of string.

This is just a simple refactoring to make Application.AotArguments a list of
strings instead of a comma-separated list of values.

* [tools] Only use direct-icalls when linking mono statically.

Ref: https://github.com/dotnet/runtime/issues/55000

* [mtouch] Fix aot arguments comparison.

* [tests] Adjust mtouch test according to mtouch changes.

* [tests] Add minimum OS version to the Mac Catalyst variation of the MySimpleApp test case.
2021-08-09 09:45:58 +02:00
Rolf Bjarne Kvinge 576dbb9b35
[msbuild/dotnet] Don't overwrite the 'CreateAppBundleDependsOn' property, only add to it. Fixes #12325. (#12346)
Fixes https://github.com/xamarin/xamarin-macios/issues/12325.
2021-08-05 08:17:44 +02:00
Rolf Bjarne Kvinge 82af982bd0
[dotnet] Handle an absolute PublishDir. Fixes #12041 and #12224. (#12333)
Properly compute the path where to put the app bundle and its files, relative
to the publish directory. The _AppBundlePath variable contains the path to the
app bundle relative to the project directory, but we need it relative to the
publish directory for .NET.

Fixes https://github.com/xamarin/xamarin-macios/issues/12041.
Fixes https://github.com/xamarin/xamarin-macios/issues/12224.
2021-08-04 15:12:24 +02:00
Rolf Bjarne Kvinge eafe528591
[runtime/tools] Implement finding native support libraries when linking statically. Fixes #10950, #11145 and #12100. (#12323)
* Add support for Mono Components.

* Modify how we look up symbols from native libraries shipped with Mono: we keep
  track of which native libraries we linked with, and depending on how we linked
  to those assemblies, we look the symbols up at runtime in either the current executable
  (if linking statically), or the actual library (where the P/Invoke says they're
  supposed to be).

* This means that we have to propagate how libmono is linked from the MSBuild code
  to the Application class so that our existing logic is able to correctly determine
  which native mono lib to use.

* Modify how we list the P/Invokes we need to preserve by taking into account the
  list of native libraries from Mono we have to link with (for .NET). For legacy
  Xamarin, I've reverted the logic to how it was before we started adding .NET support.

Fixes https://github.com/xamarin/xamarin-macios/issues/10950.
Fixes https://github.com/xamarin/xamarin-macios/issues/11145.
Fixes https://github.com/xamarin/xamarin-macios/issues/12100.
2021-08-03 17:06:58 +02:00
Rolf Bjarne Kvinge 440ff7c706
[runtime] Implement computing and passing the NATIVE_DLL_SEARCH_DIRECTORIES runtime property. Fixes #10504. (#12309)
This adds support to compute the NATIVE_DLL_SEARCH_DIRECTORIES value and pass
it to the runtime. It's the last property listed in #10504, so this fixes that
issue.

Fixes https://github.com/xamarin/xamarin-macios/issues/10504
2021-08-02 09:25:54 +02:00
Rolf Bjarne Kvinge 9ae2e66a9c
[dotnet] Add support for using the concurrent SGen GC. (#12289) 2021-07-30 09:53:13 +02:00
Rolf Bjarne Kvinge 63f28c0c5c
[dotnet/msbuild] Fix packaging and archiving support in .NET. Partial fix for #10413. (#12244)
* Rearrange some MSBuild logic so that the packaging/archiving code for macOS
  can also be used for Mac Catalyst.
* Make the .NET build logic package/archive when requested to do so.
* Add tests.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/10413.
2021-07-29 15:33:08 +02:00
Emanuel Fernandez Dell'Oca 7c66aa3829
[net6] Fixes build issues from VS for Preview 7 (#12281)
* [net6] Adds missing custom linker steps when building from Windows

To share the definition of the custom steps we need to specify the right path to the `dotnet-linker.dll`.

When building from macOS `_XamarinSdkRootDirectoryOnMac` will have the same value as `_XamarinSdkRootDirectory` (which is the local Xamarin SDK dir), but from Windows the former will be the path to the Xamarin SDK on the connected Mac. Essentially this new property is agnostic from the platform from which the build is being executed, and will always return the path to the Xamarin SDK on macOS (either local or remote), so it can be used on scenarios like this one where we know the resource we need should always be referenced from macOS.

* [net6] Updates .NET SDK path for remote tasks execution

This path needs to be updated because VS (from Dev17 Preview 3+) will install through XMA the .NET SDK and the iOS SDK on macOS in a custom dir. This should be the preferred path when building from Windows if it does exist.

* Adds missing spaces to TaskRunner.cs
2021-07-29 15:20:20 +02:00
Rolf Bjarne Kvinge 3d822de007
[runtime] List all assemblies in TRUSTED_PLATFORM_ASSEMBLIES as pass it to MonoVM/CoreCLR. Fixes #12265. (#12272)
List all the assemblies in the app bundle and pass them to MonoVM/CoreCLR's in
the TRUSTED_PLATFORM_ASSEMBLIES initialization property.

This way CoreCLR knows where to find System.Private.CoreLib.dll for fat apps
(it's in the runtimeidentifier-specific subdirectory, and by default CoreCLR
will only look next to libcoreclr.dylib).

Fixes https://github.com/xamarin/xamarin-macios/issues/12265.
2021-07-29 07:45:24 +02:00
Rolf Bjarne Kvinge 0bd4d1b101
[dotnet] Make it clearer that the linker is off by default for Mac Catalyst (like it already is for macOS). (#12242)
There's no real change here, the code did exactly this in before, but it was a
side effect of '_SdkIsSimulator' being 'true' for Mac Catalyst, which isn't
obvious. Now the logic is explicit for all platforms.
2021-07-28 09:28:13 +02:00
Rolf Bjarne Kvinge 25f19ae78a Merge remote-tracking branch 'origin/main' into dotnet-archive 2021-07-28 09:18:19 +02:00
Rolf Bjarne Kvinge 7986b2f2af
[dotnet] Globalization works for Mac Catalyst now. Fixes #11392. (#12247)
Fixes https://github.com/xamarin/xamarin-macios/issues/11392.
2021-07-28 09:12:22 +02:00
Peter Collins d886ae6d7a
[CI] Use NuGet to MSI conversion v2 (#12205) 2021-07-27 13:04:42 -04:00
Rolf Bjarne Kvinge 12f49a327e [dotnet] Add the CreateIpa, _CreateInstaller and Archive targets to the things we need to do at build time
* CreateIpa: only executed if 'BuildIpa' is set.
* _CreateInstaller: only executed if 'CreatePackage' is set.
* Archive: only executed if 'ArchiveOnBuild' is set.

We don't do this for inner builds of multi-rid builds, only single-rid builds or
outer builds of multi-rid builds.
2021-07-27 13:52:46 +02:00
Rolf Bjarne Kvinge 0549af9736
[dotnet] Add support for the interpreter + AOT when needed. Fixes #11421 and #11724. (#12211)
* Add support for the interpreter everywhere.
* Add support for the AOT compiler everywhere we didn't support it before,
  because the interpreter needs it (at least System.Private.CoreLib.dll must
  be AOT-compiled when using the interpreter).
* Do FullAOT compilation on Mac Catalyst/ARM64 if we're not using the
  interpreter, since we can't use the JIT.
* Fix monotouch-test to be green on Mac Catalyst/ARM64.

Fixes https://github.com/xamarin/xamarin-macios/issues/11724.
Fixes https://github.com/xamarin/xamarin-macios/issues/11421.
2021-07-27 07:39:43 +02:00
Rolf Bjarne Kvinge c0651c92b1
[dotnet] Put the 'createdump' executable in the app bundle when using CoreCLR. Fixes #11432. (#12210)
So that CoreCLR can create crash dumps.

Fixes https://github.com/xamarin/xamarin-macios/issues/11432.
2021-07-26 16:16:10 +02:00
Rolf Bjarne Kvinge 6c06a9fa81
[dotnet/templates] Use file-scoped namespaces. Fixes #12085. (#12197)
Fixes https://github.com/xamarin/xamarin-macios/issues/12085.
2021-07-23 21:06:17 +02:00
Rolf Bjarne Kvinge a010778b30
[dotnet] Add support for implicit namespace imports. Fixes #12084. (#12173)
* [dotnet] Add support for implicit namespace imports. Fixes #12084.

Also update our templates to remove any using statements for implicitly imported
namespaces.

Fixes https://github.com/xamarin/xamarin-macios/issues/12084.

* [monotouch-test] Fix compilation error due to implicit namespace causing type conflict.

Fixes these errors:

    xamarin-macios/tests/monotouch-test/ImageIO/MutableImageMetadataTest.cs(54,54): error CS0104: 'CGImageProperties' is an ambiguous reference between 'CoreGraphics.CGImageProperties' and 'ImageIO.CGImageProperties'
    xamarin-macios/tests/monotouch-test/ImageIO/MutableImageMetadataTest.cs(54,88): error CS0104: 'CGImageProperties' is an ambiguous reference between 'CoreGraphics.CGImageProperties' and 'ImageIO.CGImageProperties'
    xamarin-macios/tests/monotouch-test/ImageIO/ImageMetadataTest.cs(40,54): error CS0104: 'CGImageProperties' is an ambiguous reference between 'CoreGraphics.CGImageProperties' and 'ImageIO.CGImageProperties'
    xamarin-macios/tests/monotouch-test/ImageIO/ImageMetadataTest.cs(40,88): error CS0104: 'CGImageProperties' is an ambiguous reference between 'CoreGraphics.CGImageProperties' and 'ImageIO.CGImageProperties'
2021-07-23 15:07:03 +02:00
dotnet-maestro[bot] 7dd7960f57
[main] Update dependencies from dotnet/installer (#12171)
* Update dependencies from https://github.com/dotnet/installer build 20210722.2

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rc.1.21370.12 -> To Version 6.0.100-rc.1.21372.2

* [dotnet] Work around problem where the local .NET install contains an invalid workload.

We work around it by deleting the invalid workload.

* [dotnet] Fix merge failure - don't reference workloads that don't exist anymore.

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-07-22 22:13:03 +02:00
Rolf Bjarne Kvinge 1b357204ee
[dotnet/msbuild] Add support for using LLVM to build .NET apps. Fixes #11379. (#12136)
Fixes https://github.com/xamarin/xamarin-macios/issues/11379.
2021-07-22 15:49:22 +02:00
Peter Collins a150c1dfcc
[dotnet] Add runtime packs to workload manifests (#12168)
Runtime pack entries should be included in all workload manifest files,
even though they will not yet be resolved from the packs folder due to
https://github.com/dotnet/sdk/issues/14044.  These changes will also
allow us to start producing .msi files for the runtime packs for an
eventual inclusion in the Visual Studio installer.
2021-07-22 10:41:40 +02:00
Rolf Bjarne Kvinge 09e6c0329f [dotnet] Only list linker flags for assemblies after we've computed them.
This means not listing per-assembly linker flags for only binding projects, but delay
it until we've computed the linker flags for all assemblies (and reflect this in
variable names as well).
2021-07-22 10:36:21 +02:00
Rolf Bjarne Kvinge d26bdf97bf [dotnet] Parse --dlsym and pass it to the dotnet-linker tasks. 2021-07-22 10:36:21 +02:00
Rolf Bjarne Kvinge 24351db16c [runtime/tools] Implement finding native mono lib for Mac Catalyst.
This also meant propagating how libmono is linked from the MSBuild code to the Application
class so that our existing logic is able to correctly determine which native mono
lib to use.
2021-07-22 10:36:21 +02:00
Rolf Bjarne Kvinge 1dacea4d8c [dotnet] Refactor and extend the logic to determine whether we should run the AOT compiler or not.
We also can't link dynamically with libmonosgen-2.0.dylib if we AOT compile anything,
so make sure we don't do that.
2021-07-22 10:36:20 +02:00
Rolf Bjarne Kvinge 76c8461764
[main] Update dependencies from dotnet/installer (#12064)
This pull request updates the following dependencies

## From https://github.com/dotnet/installer

- **Subscription**: df3e6147-3e41-4928-6775-08d8f479343c
- **Build**: 20210720.12
- **Date Produced**: 7/21/2021 6:57 AM
- **Commit**: d7279fc09fcfb108c5fb97fa290dbbb11c4c441b
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 6.0.100-preview.7.21330.1 to 6.0.100-rc.1.21370.12][1]
  - **Microsoft.NET.ILLink.Tasks**: [from 6.0.100-preview.6.21329.2 to 6.0.100-preview.6.21370.1][2]

[1]: 823ff33...d7279fc
[2]: f549b4e...6eae019

## 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.ILLink.Tasks**: from 6.0.100-preview.6.21329.2 to 6.0.100-preview.6.21370.1 (parent: Microsoft.Dotnet.Sdk.Internal)
2021-07-22 10:32:32 +02:00
Peter Collins 2af23dbdfc
[CI] Add Prepare Release and VS Insertion stages (again) (#12157)
Context: xamarin/yaml-templates#117

Updates the .NET 6 NuGet packaging steps to exclude package metadata,
as the .msi conversion tooling does not process .nupkg file names with
the +sha.commit metadata.

Two new stages have been added to facilitate the Visual Studio setup
authoring process.

The first stage named "Prepare Release" will sign the .NET 6 NuGet
package content (inside and out), convert relevant packages to .msi
installers, generate Visual Studio manifests for the .msi installers,
and push the signed packages to the xamarin-impl feed.

The new SignList.xml file is required for our NuGet signing templates.

The new xamarin-workload.props file contains version information
and other metadata required to generate a Visual Studio manifest.

The second stage starts with a manual validation task. This task
will pause and wait for someone to click a "Resume" or "Reject" button
that will appear on the pipeline UI. This task is configured to be
rejected after waiting for two days, but it can be manually re-ran at a
later date if we want to trigger VS insertion for an older build.

If the manual validation task is approved, a VS Drop will be created
containing all .NET 6 .msi files. This Drop URL can then be used to
update our component versions in Visual Studio. This last piece is
currently manual as we will initially be introducing new components,
however we should be able to automate VS PR creation in the future.

Commit 09f911b missed adding the
PR build check condition to a step in sign-and-notarized.yml, causing
PR builds from forks to fail. We can fix this by adding in the missing
condition.
2021-07-21 13:09:29 -04:00
Rolf Bjarne Kvinge de7f08d642
[tests/dotnet] Add .NET/Mac Catalyst test projects for dont link, link sdk and link all. (#12154)
* Add proper .NET project files for dont link, link sdk and link all. This
  includes a Mac Catalyst variant, and adding helpful Makefile targets for
  simple execution.

* Adjust various tests to work with Mac Catalyst.

* Add the new Mac Catalyst variants to xharness.

This is a partial fix for #10833.
2021-07-21 17:16:03 +02:00
Sebastien Pouliot fccd43f0c2
[dotnet][linker] Remove unused backing fields (#12001)
Problems:

* `Dispose` set the generated backing fields to `null` which means
  the linker will mark every backing fields, even if not used
  elsewhere (generally properties) inside the class

* Backing fields increase the memory footprint of the managed peer
  instance (for the type and all it's subclasses)

* Backing fields also increase the app size. Not a huge problem as
  they are all declared _weakly_ as `NSObject` but still...

Solution:

* When the linker process a `Dispose` method of an `NSObject`
  subclass with the _optimizable_ attribute then we remove the
  method body. This way the linker cannot mark the fields.

* Before saving back the assemblies we replace the cached method
  body and NOP every field that were not marked by something else
  than the `Dispose` method.

```diff
--- a.cs	2021-06-22 16:56:57.000000000 -0400
+++ b.cs	2021-06-22 16:57:00.000000000 -0400
@@ -3107,8 +3107,6 @@

 		private static readonly IntPtr class_ptr = Class.GetHandle("UIApplication");

-		private object __mt_WeakDelegate_var;
-
 		public override IntPtr ClassHandle => class_ptr;

 		[DllImport("__Internal")]
@@ -3141,9 +3139,8 @@
 		protected override void Dispose(bool P_0)
 		{
 			base.Dispose(P_0);
-			if (base.Handle == IntPtr.Zero)
+			if (!(base.Handle == IntPtr.Zero))
 			{
-				__mt_WeakDelegate_var = null;
 			}
 		}
 	}
@@ -3209,10 +3206,6 @@
 	{
 		private static readonly IntPtr class_ptr = Class.GetHandle("UIScreen");

-		private object __mt_FocusedItem_var;
-
-		private object __mt_FocusedView_var;
-
 		public override IntPtr ClassHandle => class_ptr;

 		public virtual CGRect Bounds
@@ -3242,10 +3235,8 @@
 		protected override void Dispose(bool P_0)
 		{
 			base.Dispose(P_0);
-			if (base.Handle == IntPtr.Zero)
+			if (!(base.Handle == IntPtr.Zero))
 			{
-				__mt_FocusedItem_var = null;
-				__mt_FocusedView_var = null;
 			}
 		}
 	}
@@ -3254,10 +3245,6 @@
 	{
 		private static readonly IntPtr class_ptr = Class.GetHandle("UIView");

-		private object __mt_ParentFocusEnvironment_var;
-
-		private object __mt_PreferredFocusedView_var;
-
 		public override IntPtr ClassHandle => class_ptr;

 		public virtual CGRect Bounds
@@ -3303,10 +3290,8 @@
 		protected override void Dispose(bool P_0)
 		{
 			base.Dispose(P_0);
-			if (base.Handle == IntPtr.Zero)
+			if (!(base.Handle == IntPtr.Zero))
 			{
-				__mt_ParentFocusEnvironment_var = null;
-				__mt_PreferredFocusedView_var = null;
 			}
 		}
 	}
@@ -3315,12 +3300,6 @@
 	{
 		private static readonly IntPtr class_ptr = Class.GetHandle("UIViewController");

-		private object __mt_ParentFocusEnvironment_var;
-
-		private object __mt_PreferredFocusedView_var;
-
-		private object __mt_WeakTransitioningDelegate_var;
-
 		public override IntPtr ClassHandle => class_ptr;

 		public virtual UIView View
@@ -3363,11 +3342,8 @@
 		protected override void Dispose(bool P_0)
 		{
 			base.Dispose(P_0);
-			if (base.Handle == IntPtr.Zero)
+			if (!(base.Handle == IntPtr.Zero))
 			{
-				__mt_ParentFocusEnvironment_var = null;
-				__mt_PreferredFocusedView_var = null;
-				__mt_WeakTransitioningDelegate_var = null;
 			}
 		}
 	}
@@ -3376,8 +3352,6 @@
 	{
 		private static readonly IntPtr class_ptr = Class.GetHandle("UIWindow");

-		private object __mt_WindowScene_var;
-
 		public override IntPtr ClassHandle => class_ptr;

 		public virtual UIViewController RootViewController
@@ -3411,9 +3385,8 @@
 		protected override void Dispose(bool P_0)
 		{
 			base.Dispose(P_0);
-			if (base.Handle == IntPtr.Zero)
+			if (!(base.Handle == IntPtr.Zero))
 			{
-				__mt_WindowScene_var = null;
 			}
 		}
 	}
```

* Do not consider bindings with `[Dispose (...)]` as optimizable

Injected code makes it impossible for `bgen` to decide if it's optimizable (or not)
Filed https://github.com/xamarin/xamarin-macios/issues/12150 with more details (and for other similar attributes)
2021-07-21 09:03:25 -04:00
Rolf Bjarne Kvinge c0e9ca9673 [dotnet] Remove workaround for missing bits in the Mono runtime workload. 2021-07-21 09:33:33 +02:00
Manuel de la Pena eea8142e6b
Revert "[CI] Add Prepare Release and VS Insertion stages (#12015)" (#12156)
This reverts commit 09f911b504. The comit
made changes in the logic that is used to build the PRs in public bots
meaning that all PRs fail.
2021-07-20 16:17:13 -04:00
Peter Collins 09f911b504
[CI] Add Prepare Release and VS Insertion stages (#12015)
Context: https://github.com/xamarin/yaml-templates/pull/117

Updates the .NET 6 NuGet packaging steps to exclude package metadata,
as the .msi conversion tooling does not process .nupkg file names with
the `+sha.commit` metadata.

Two new stages have been added to facilitate the Visual Studio setup
authoring process.

The first stage named "Prepare Release" will sign the .NET 6 NuGet
package content (inside and out), convert relevant packages to .msi
installers, generate Visual Studio manifests for the .msi installers,
and push the signed packages to the `xamarin-impl` feed.

The new `SignList.xml` file is required for our NuGet signing templates.

The new `xamarin-workload.props` file contains version information
and other metadata required to generate a Visual Studio manifest.

The second stage starts with a [manual validation task][0].  This task
will pause and wait for someone to click a "Resume" or "Reject" button
that will appear on the pipeline UI.  This task is configured to be
rejected after waiting for two days, but it can be manually re-ran at a
later date if we want to trigger VS insertion for an older build.

If the manual validation task is approved, a VS Drop will be created
containing all .NET 6 .msi files.  This Drop URL can then be used to
update our component versions in Visual Studio.  This last piece is
currently manual as we will initially be introducing new components,
however we should be able to automate VS PR creation in the future.

[0]: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/manual-validation?view=azure-devops&tabs=yaml
2021-07-20 17:32:43 +02:00
Rolf Bjarne Kvinge 3f3698253b [dotnet] Quote the path to the app when launching it. 2021-07-20 15:54:47 +02:00
Rolf Bjarne Kvinge a3f9519ed1 Merge remote-tracking branch 'origin/main' into HEAD 2021-07-20 14:53:57 +02:00
Rolf Bjarne Kvinge 3c38f8ccd6
[dotnet] Enable autorelease pools for threadpools. Fixes #11750. (#12060)
Fixes https://github.com/xamarin/xamarin-macios/issues/11750.
2021-07-20 14:34:37 +02:00
Rolf Bjarne Kvinge c0a7bf5a0d Merge remote-tracking branch 'origin/main' into dotnet-llvm 2021-07-19 17:07:57 +02:00
Rolf Bjarne Kvinge d59c218a71 [msbuild/dotnet] Make sure target Outputs show up in a task Output to make the build work correctly on windows. 2021-07-19 17:05:48 +02:00
Rolf Bjarne Kvinge 2014bf68c3 [tools] Compute the llvm output file and pass it to the AOT compiler / native linker 2021-07-16 17:11:14 +02:00
Rolf Bjarne Kvinge 476d35909a [msbuild/dotnet] Use properties on the _AssembliesToAOT item group to specify output paths.
This deduplicates a little bit code to compute the output path.
2021-07-16 17:11:14 +02:00
Rolf Bjarne Kvinge ce15ba272e [dotnet] Remove unused AOTCompileTaskBase.AOTData property. 2021-07-16 17:11:14 +02:00