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

717 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge ce19b092c2 [net8.0] Merge main into net8.0. 2023-04-21 12:31:53 +02:00
Rolf Bjarne Kvinge 9615de3334
[dotnet] Include the parsed runtimeconfig.bin into ResolvedFileToPublish. Contributes towards #17579. (#18087)
This makes it unnecessary to special-case this file for it to copied
correctly when building on Windows (once we've fixed the Windows build to use
ResolvedFileToPublish as the source of truth, like we do on macOS).

This is the first part of a fix for
https://github.com/xamarin/xamarin-macios/issues/17579.
2023-04-19 07:32:13 +02:00
Rolf Bjarne Kvinge 4dbd98b78f
[linker/trimmer] Add opt-in support for not marking NSObjects in user assemblies. Fixes #15723. (#17949)
We mark all types that derive from NSObject when we find them in user
assemblies, so that these types may be used in storyboards (where the linker
can't see them), without having to go through hoops to make sure the linker
doesn't remove these types (which would make the storyboard fail to load,
because it would reference types that were linked away).

However, not everybody uses storyboards, so in some cases it may make sense to
link away as much as possible, so make it opt-in to skip this custom marking.

This is an experimental feature, and will break at least some apps. It may
break most apps, but if someone wants to try it out, they're welcome!

It can be turned on by passing `--skip-marking-nsobjects-in-user-assemblies=true` to mtouch/mmp:

```xml
<PropertyGroup>
    <MtouchExtraArgs>--skip-marking-nsobjects-in-user-assemblies=true</MtouchExtraArgs>
</PropertyGroup>
```

Fixes #15723.
2023-04-13 16:38:04 +02:00
Rolf Bjarne Kvinge a09d0dc38a
[msbuild] Use our own Unzip task instead of Ditto when extracting compressed plugins. (#18015)
This way we can make the extraction work on Windows for Hot Restart, since ditto
doesn't exist on Windows.

This requires a few other changes:

* Move the Unzip task from the HotRestart tasks to be available everywhere.
* Change the Unzip task to use our existing decompression logic, which calls 'unzip'
  on non-Windows platforms in order to correctly support symlinks.
2023-04-13 16:36:24 +02:00
Rolf Bjarne Kvinge efc7551e3f
[runtime] Add support for passing on a connect timeout to sdb. (#18037)
The timeout can be given:

* By setting the __XAMARIN_DEBUG_CONNECT_TIMEOUT__ environment variable for the app when launching it.
* By passing the XamarinDebugConnectTimeout MSBuild property to 'dotnet run' or 'dotnet build /t:Run'.
* By setting the IOSDebugConnectTimeout MSBuild property at build time.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1778177.
2023-04-13 16:34:52 +02:00
Rolf Bjarne Kvinge f2dc429f3c [net8.0] Merge main into net8.0. 2023-04-13 08:27:25 +02:00
Rolf Bjarne Kvinge 7973dcef1b
[localization] Fix BOMs. (#18027) 2023-04-12 14:01:18 +02:00
VS MobileTools Engineering Service 2 ada4d2cb31
Localized file check-in by OneLocBuild Task: Build definition ID 17751: Build ID 7603393 (#18005)
This is the pull request automatically created by the OneLocBuild task
in the build process to check-in localized files generated based upon
translation source files (.lcl files) handed-back from the downstream
localization pipeline. If there are issues in translations, visit
https://aka.ms/ceLocBug and log bugs for fixes. The OneLocBuild wiki is
https://aka.ms/onelocbuild and the localization process in general is
documented at https://aka.ms/AllAboutLoc.
2023-04-10 08:23:00 -05:00
Rolf Bjarne Kvinge 059aa7ad8f [net8.0] Merge main into net8.0. 2023-04-10 12:44:17 +02:00
Rolf Bjarne Kvinge 8c9ee8289f
[msbuild/dotnet] Rework how we collect and process native references. (#17554)
Previously, we'd do this:

* Collect all possible native references.
* Extract any compressed native references (*.framework.zip, *.xcframework.zip,
  *.resources.zip) to disk.
* Resolve the resulting native references.

This doesn't work very well on Windows (in non-connected/Hot Restart mode),
because some compressed files may contain symlinks (in particular compressed
xcframeworks). If those symlinks are for any other platform than the one we're
building for, they shouldn't matter, but if we extract the entire compressed
xcframework before figuring out what we need from it, we'd run into symlinks
and not knowing whether they should be ignored or not.

So rework the process to:

* Collect all possible native references.
* Resolve the resulting native references, peeking into zip files if need be.
* Extract any compressed native references, but only the parts of the zip we need.

This way we won't run into any symlinks unless we really need them, and it
should also improve build performance slightly, even on macOS, since we're not
extracting files we won't need (which can be significant for xcframeworks).

Additionally:

* Add support for unzipping on Windows by using System.IO.Compression.
* Show an error if attempting to extract a symlink in the last step in the
  reworked process on Windows.
* Some tests had to be updated (since they poked into internals of the
  ResolveNativeReferences task, and those internals have changed).
2023-04-10 11:27:41 +02:00
Alex Soto df5c2e2862 Merge remote-tracking branch 'xamarin/main' into net8.0-main-merge 2023-04-06 20:12:48 -04:00
Emanuel Fernandez Dell'Oca b7a486a887
[msbuild] Get RecursiveDir directory name only if it isn't empty (#17988)
If the `RecursiveDir` metadata is empty, the GetDirectoryName method
throws an error because it isn't a valid path. This can happen on VS
design time builds.
2023-04-06 17:21:26 -04:00
Alex Soto db0b1ff52f Merge remote-tracking branch 'xamarin/main' into net8.0-main-merge 2023-04-05 15:25:09 -04:00
Milos Kotlar 6d6cee815e
Enable deduplication of generics in Xamarin.iOS build (#17766)
This PR contributes to https://github.com/dotnet/runtime/issues/83193. It
creates a new target `_CreateAOTDedupAssembly`, and makes the `_AOTCompile`
depend on it. Also, it changes the `AOTCompile` task to pass `dedup-skip` and
`dedup-include` to the Mono AOT compiler.

The change was tested on `MySingleView` app and `Monotouch` tests. Both apps
are working, but some monotouch tests are failing due to
`Arg_NotlmplementedException`. Assumption is that calls between Obj-C and C#
could be problematic, as with the dedup improvement enabled, extra methods got
moved from origin assemblies to the dedup assembly, so native to managed
mapping could be corrupted.

Here are preliminary results comparing size on disk and build time between the
baseline (`net8.0` branch) and the target (this branch). Binlog details are
[attached](https://github.com/xamarin/xamarin-macios/files/10942772/binlog.zip).

| App                                      | Baseline size on disk .ipa (MB) | Target size on disk .ipa (MB) | Baseline size on disk .app (MB) | Target size on disk .app (MB) | Baseline build time (s) | Target build time (s) | .app diff (%) |
| ---------------------------------------- | ------------------------------- | ----------------------------- | ------------------------------- | ----------------------------- | ----------------------- | --------------------- | ------------- |
| MySingleView Release iOS                 | 5,40                            | 5,40                          | 29,2                            | 15,20                         | 29,18                   | 16,77                 | 47,94         |
| MySingleView Release  iOSSimulator-arm64 | N/A                             | N/A                           | 469,5                           | 341,80                        | 468,00                  | 330,00                | 27,20         |
| Monotouch Release llvm iOS               | 49,00                           | 38,80                         | 209,60                          | 157,40                        | 115,00                  | 130,00                | 24,90         |

Draft PR should get a full test run on the changes. The following tasks should
be resolved before making this PR ready for review.
2023-03-30 17:27:56 +02:00
Rolf Bjarne Kvinge 335f8c9d90
[dotnet/msbuild] Don't bundle *.xml files that match any assemblies. Fixes #14939 and fixes #15897. (#17908)
This fixes a warning when documentation is enabled for a project:

> The file '~/.nuget/packages/fsharp.core/6.0.0/contentFiles/any/netstandard2.1/FSharp.Core.xml' does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle.

This doesn't change any behavior (as the warning says, the file wasn't copied
to the app bundle before either), but it makes the behavior explicitly
documented and silences the warning.

Fixes https://github.com/xamarin/xamarin-macios/issues/14939.
Fixes https://github.com/xamarin/xamarin-macios/issues/15897.
2023-03-30 07:24:00 +02:00
Rolf Bjarne Kvinge 8deec35a20
[net8.0] Remove support for .NET 6. (#17901)
Context: https://dotnet.microsoft.com/platform/support/policy/maui

> A major version of .NET MAUI receives support for a minimum of 6
> months after a successor (the next major release) ships. For
> example, .NET MAUI 6.0 will be supported for 6 months after .NET
> MAUI 7.0 ships. Similarly, .NET MAUI 7.0 will receive support for 6
> months after .NET MAUI 8.0 ships.

By the time .NET 8 GA ships, .NET 6 MAUI projects will not be supported.

Remove .NET 6 support from our .NET 8 workloads.
2023-03-29 10:25:25 +02:00
Rolf Bjarne Kvinge 226a5f198f Merge remote-tracking branch 'origin/main' into bump-main-in-net8.0-2023-03-14 2023-03-27 19:53:33 +02:00
dustin-wojciechowski 60b0724b4d
[Templates] Add comments to help developers publish MacCatalyst apps on App Store (#17830)
Added some information to the MacCatalyst templates based on comments from the community
on how to publish MacCatalyst apps on the App Store.

Fixes #17591
2023-03-23 20:21:08 -07:00
Haritha Mohan 3dff232920
[dotnet] Enable generation of runtime configuration file (#17840)
Set the GenerateRuntimeConfigurationFiles (GRCF) property to true 
to avoid warnings at build time + add test for change.

Diving deeper into the fix...
- This warning only occurs with .NET apps which is why GRCF
is only updated in the dotnet directory and not msbuild (legacy)
- After examining the binlog (see issue), it was found that the GRCF 
was contingent upon the HasRuntimeOutput property, which is only 
defined for executable projects. And in this case, the user's project
output type is library thus both the RuntimeOutput and consequently 
GRCF properties were not enabled.
- By setting the GRCF to true we can address the original warning of 
concern while ensuring the rest of the projects's behavior is not
altered
in mysterious ways (i.e. by touching the RuntimeOutput property or the 
project output type instead, these changes could have extraneous
effects).

Fixes #17543

---------

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2023-03-23 08:10:04 -07:00
Rolf Bjarne Kvinge cfa2734a3a Merge remote-tracking branch 'origin/main' into bump-main-in-net8.0-2023-03-14 2023-03-23 15:33:43 +01:00
Rolf Bjarne Kvinge 4131267879 Merge remote-tracking branch 'origin/main' into bump-main-in-net8.0-2023-03-14 2023-03-23 08:36:21 +01:00
Peter Collins 432d27b171
[vs-workload] Update VS Component versions (#17883)
Context: https://github.com/xamarin/sdk-insertions/issues/56

Updates the VS component version for all workloads to use the NuGet
versions commit distance as the third version part.
2023-03-23 08:22:42 +01:00
Rolf Bjarne Kvinge 8ac36f126e
[dotnet] Add support for setting an MSBuild property to pass additional mlaunch arguments. (#17866)
This is helpful when doing a command-line -t:Run build, because it's not
possible to set an item group from the command line.
2023-03-22 16:19:49 +01:00
Rolf Bjarne Kvinge 7ea0044224
[dotnet/msbuild] Copy binding resource packages to output directories together with CopyLocal assemblies. Fixes #13910. (#17806)
With a project structure like this:

* Executable project references a library project.
* The library project references a binding project (or assembly).

The binding project's assembly will be copied to the library project's
output directory during the build. Unless we also make sure any binding
resource packages are copied as well, the executable project won't find those,
and the final app won't contain any native bits from the binding project.

The solution is to add any binding resource packages to the list of
files to be copied to the library's output directory.

Fixes https://github.com/xamarin/xamarin-macios/issues/13910.
2023-03-22 10:49:26 +01:00
Peter Collins 289ded90fe
[vs-workload] Remove @(MultiTargetPackNames) (#17838)
Context: https://github.com/xamarin/yaml-templates/pull/251

The VS manifest files generated during MSI conversion will now be split
up using the workload pack type rather than a substring match.
2023-03-20 15:36:44 -04:00
Rolf Bjarne Kvinge 69f5c42db4 [net8.0] Merge main into net8.0. 2023-03-08 23:48:50 +01:00
Rolf Bjarne Kvinge 256ef1ccd9
[dotnet] Change _IntermediateDecompressionDir to always have a trailing directory separator. (#17728)
Also don't hardcode the trailing directory separator as a forward slash,
because we might be executing on Windows (which is the real purpose behind
this change).
2023-03-07 18:58:25 +01:00
Rolf Bjarne Kvinge 07afcf9e97 [net8.0] Merge main into net8.0. 2023-03-07 18:12:02 +01:00
Rolf Bjarne Kvinge 765139e720
[dotnet] Add support for passing environment variables and custom arguments when launching apps with mlaunch. (#17730)
Environment variables can be specified using the MlaunchEnvironmentVariables
item group, and any other mlaunch argument can be specified using the
MlaunchAdditionalArguments item group.

Also add support for the XamarinDebugPort and XamarinDebugHosts properties to
make it easy to set the corresponding environment variable using the command
line (since setting item groups using the command line isn't trivial).

Fixes https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1755574.
2023-03-07 18:11:45 +01:00
Rolf Bjarne Kvinge be031736be
[net8.0] [tests] Add a .NET 7 test app. (#17385) 2023-03-07 07:58:54 +01:00
Rolf Bjarne Kvinge 0c4be6ec9c Merge remote-tracking branch 'origin/main' into bump-main-in-net8.0-2023-03-03 2023-03-03 13:20:17 +01:00
Rolf Bjarne Kvinge e170ba56d8
[dotnet] Rework how we handle manifest version bands. (#17670)
* Use a separate variable for Mono's and Emscripten's manifest version band,
  so that they can diverge (this is a decision from the corresponding teams,
  we don't control it).
* Have a separate variable for our own manifest version band, so that it's
  easier to hard code it if we want to.
* Rename a few variables to make them clearer.
* Remove hardcoded rc.2 logic, we're not using any rc.2 versions right now, so
  that's dead code.
* A few other minor changes.
2023-03-03 13:17:55 +01:00
Rolf Bjarne Kvinge 7a866a5cc6 [net8.0] Merge main into net8.0. 2023-03-02 15:49:52 +01:00
Mauro Agnoletti 2178951527
[main] Updated Xamarin.Messaging to 1.9.59 (#17646)
Includes latest fixes like support for retry and reconnect, new telemetry, bug fixing, etc.

Also added Merq.Core.dll to dotnet/Workloads/SignList.xml because now it comes as part of Xamarin.Messaging
2023-03-01 08:20:59 +01:00
Rolf Bjarne Kvinge e0c92a03ce
[dotnet] Include the marshal-ilgen component. Fixes #16836. (#17606)
Fixes https://github.com/xamarin/xamarin-macios/issues/16836.
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1751368.
2023-02-24 20:01:43 +01:00
Rolf Bjarne Kvinge fec1e8a946 [net8.0] Merge main into net8.0. 2023-02-22 07:05:49 +01:00
Rolf Bjarne Kvinge ad4af52393
[dotnet] Improve error message when someone tries to disable trimming by setting PublishTrimmed=false. (#17568)
Make it more actionable, by telling users what they can do instead.
2023-02-21 14:54:44 +01:00
Rolf Bjarne Kvinge 7e05ea54bb Merge main into net8.0. 2023-02-17 14:58:12 +01:00
dotnet-maestro[bot] 6eb501be2b
[net8.0] Update dependencies from dotnet/installer (#17444)
This pull request updates the following dependencies

## 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 8.0.100-1.23067.1 to 8.0.0-preview.2.23101.2 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.AspNetCore.App.Ref**: from 8.0.0-alpha.1.23076.8 to 8.0.0-preview.2.23101.7 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100**: from 8.0.0-alpha.1.23073.2 to 8.0.0-alpha.1.23066.1 (parent: Microsoft.NETCore.App.Ref)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0-alpha.1.23076.9 to 8.0.0-preview.2.23101.2 (parent: Microsoft.Dotnet.Sdk.Internal)

## From https://github.com/dotnet/installer
- **Subscription**: 9a2944cb-7dee-4bf2-a65c-08dabd10ae64
- **Build**: 20230202.11
- **Date Produced**: February 2, 2023 10:28:14 PM UTC
- **Commit**: 5c7737d740c861fe7cda4822a7137c22368000dc
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.100-alpha.1.23077.6 to 8.0.100-preview.2.23102.11][1]
  - **Microsoft.NET.ILLink.Tasks**: [from 8.0.100-1.23067.1 to 8.0.0-preview.2.23101.2][2]
  - **Microsoft.AspNetCore.App.Ref**: [from 8.0.0-alpha.1.23076.8 to 8.0.0-preview.2.23101.7][3]
  - **Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100**: [from 8.0.0-alpha.1.23073.2 to 8.0.0-alpha.1.23066.1][4]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0-alpha.1.23076.9 to 8.0.0-preview.2.23101.2][5]

[1]: 1d88a6b...5c7737d
[2]: c790896...842ec4a
[3]: 4d75ee9...56cb24c
[4]: ff23620...5b46122
[5]: 007df05...842ec4a
2023-02-13 07:34:42 +01:00
Rolf Bjarne Kvinge bef4867281
[dotnet] Only include the Xamarin.Shared.Sdk.MultiTarget.targets file if it exists. Fixes #16400. (#17498)
Hopefully fixes https://github.com/xamarin/xamarin-macios/issues/16400.
2023-02-13 07:20:05 +01:00
Mauro Agnoletti 7f7942eae0
Imports the .user.env file if exists and the build is from VS (#17466)
This will allow the latest runtime identifier values to be evaluated in time during the MSBuild property evaluation phase.

Related and dependent of this PR: https://github.com/xamarin/XamarinVS/pull/13606
2023-02-08 09:37:39 +01:00
Rolf Bjarne Kvinge 735454f901 Bump min OS platform in template. 2023-02-07 11:47:48 +01:00
Rolf Bjarne Kvinge 9f55faeee0 Merge remote-tracking branch 'origin/net8.0' into bump-main-in-net8.0-2023-02-06 2023-02-07 07:18:23 +01:00
Rolf Bjarne Kvinge 003c656fea Bump new templates to .NET 8. 2023-02-06 14:59:58 +01:00
Rolf Bjarne Kvinge 61dd7b188b Merge main into net8.0. 2023-02-06 08:49:13 +01:00
Andoni Morales Alastruey 97ab14801f
[dotnet] Add support for .so files (#16887)
Autotools-based project using libtool's -module flag generate plugins
with the .so extension that needs to be treated like DynamicLibraries in
terms of deployment location and relocation, except they are not linked
to the app.

This PR adds support for such .so files: they're treated as .dylib files, except
that they're not linked to the app.
2023-02-03 09:16:40 +01:00
Rolf Bjarne Kvinge e6ef460f77 [dotnet] Bump min macOS version in XIB to 10.15. 2023-02-02 16:30:30 +01:00
Rolf Bjarne Kvinge d43c76363f [dotnet] Bump the default SupportedOSPlatformVersion in templates to a version we actually support. 2023-02-02 16:30:29 +01:00
Rolf Bjarne Kvinge 47a387f670
Add support for Visual Basic projects. (#17409)
* Add props and targets files for Visual Basic.
* Add templates for Visual Basic projects.
* Misc other related changes.

This contributes towards https://github.com/xamarin/xamarin-macios/issues/17321.
2023-02-01 21:20:14 +01:00
Rolf Bjarne Kvinge 7b352f5f26 [net8.0] Merge main into net8.0. 2023-01-31 14:52:18 +01:00