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

683 Коммитов

Автор SHA1 Сообщение Дата
TJ Lambert a54fefd836
[Localization] Revert change to non-breaking space (#18216)
This change didn't really get rid of the non-breaking space and caused
extra changes after we built xamarin-macios.

Co-authored-by: tj-devel709 <tjlambert@microsoft.com>
2023-05-04 21:59:37 -05:00
VS MobileTools Engineering Service 2 9b7b3360da
Localized file check-in by OneLocBuild Task: Build definition ID 17751: Build ID 7704520 (#18191)
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/icxLocBug 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-05-03 12:32:16 -05:00
Filip Navara abd9883af6
Fix the name of the item function. (#18199)
The name is `HasMetadata`, not `HasMetadataValue`
(https://learn.microsoft.com/en-us/visualstudio/msbuild/item-functions?view=vs-2022).
2023-05-03 16:48:36 +02:00
Rolf Bjarne Kvinge 6e7128b619
[msbuild/tests/dotnet] Add support for xcframeworks for Hot Restart and add tests. Fixes #16571. (#18103)
Rework Hot Restart builds to use as much as possible of the normal build
logic, because this is the easiest way to make sure the Hot Restart build is
as close as possible to normal builds (and we don't end up missing features).

This is done by executing selected parts of a normal build, and at the end we
have a new task that computes where each file goes in the various output
directories Hot Restart uses (HotRestartAppBundlePath, HotRestartContentDir,
HotRestartAppContentDir, etc.)

This PR also:

* Adds a test that runs on Windows and verifies that everything consumed in a
  build is placed in the correct location for a Hot Restart build (this is a
  variation of the BundleStructure test we already have).
* Removes tasks that aren't used anymore.
* Misc fixes to make sure existing code works on Windows.

---

This PR is best reviewed commit-by-commit.

Ref: https://github.com/xamarin/xamarin-macios/issues/13924

* Fixes https://github.com/xamarin/xamarin-macios/issues/16571
* Fixes https://github.com/xamarin/xamarin-macios/issues/16001
* Fixes https://github.com/xamarin/xamarin-macios/issues/10784
* Fixes https://github.com/xamarin/xamarin-macios/issues/17579
* Contributes towards https://github.com/xamarin/xamarin-macios/issues/13924.
2023-05-03 14:09:31 +02:00
Rolf Bjarne Kvinge 4a05d47f2e
[dotnet] Add a missing IsMacEnabled check before executing a task in the _ComputeLinkerArguments target. (#18145)
This fixes an issue where the build would fail on Windows if the Windows
machine wasn't connected to a remote Mac.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1808448.
2023-04-26 15:23:29 +02:00
Rolf Bjarne Kvinge fcbbd2992e [msbuild] Set/fix the PublishFolderType and RelativePath metadata in several places.
Set/fix the PublishFolderType and RelativePath metata for returned items in the ComputeBundleLocation
and ResolveNativeReferences task, so that the new ComputeHotRestartBundleContents
task has enough (and the correct) information to do the right thing with items that
are to be copied to the app bundle.
2023-04-20 18:21:17 +02:00
Rolf Bjarne Kvinge f17bc64d1b [msbuild/dotnet] Rework Hot Restart builds.
Rework Hot Restart builds to use as much as possible of the normal build logic, because
this is the easiest way to make sure the Hot Restart build is as close as possible
to normal builds (and we don't end up missing features).

This is done by executing selected parts of a normal build, and a the end we have
a new task that computes where each file goes in the various output directories Hot
Restart uses (HotRestartAppBundlePath, HotRestartContentDir, HotRestartAppContentDir,
etc.)
2023-04-20 18:21:17 +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 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 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
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
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
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
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 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 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 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
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 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 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
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 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 e0d64e8f61 [msbuild] Add props and targets files for Visual Basic.
These are just the C# versions changed just enough to use Visual Basic instead of C#.
2023-01-31 13:20:19 +01:00
Rolf Bjarne Kvinge bd74a1c266 [dotnet] Copy localizations from C# templates to the Visual Basic templates. 2023-01-31 13:04:41 +01:00
Rolf Bjarne Kvinge 52850559fb [dotnet] Add templates for Visual Basic projects.
Add a Visual Basic templates for:

* All our platforms (iOS, tvOS, macOS and Mac Catalyst).
* A simple project (the ios, tvos, macos and maccatalyst templates).
* A class library property (the ioslib, tvoslib, macoslib and maccatalystlib templates).
2023-01-31 13:12:48 +01:00
TJ Lambert ef8bdf2470
[Localization] Change the Line Endings (#17403)
Created a ticket asking the Localization team if they can control the
line endings before checking-in the code so that we will not have to
continue doing this:
https://ceapex.visualstudio.com/CEINTL/_workitems/edit/773212

---------

Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2023-01-30 16:37:17 -05:00
VS MobileTools Engineering Service 2 9e4b699705
Localized file check-in by OneLocBuild Task: Build definition ID 17751: Build ID 7255787 (#17392)
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-01-30 10:34:09 -06:00
Rolf Bjarne Kvinge 1130e1c472 [dotnet] Move templates around a bit to make room for more language-specific project templates. 2023-01-30 17:21:22 +01:00
Rolf Bjarne Kvinge d27667f48a
[dotnet] Change the order of the linker steps. Fixes #17347. (#17360)
The bug manifests like this:

> Could not create an native instance of the type WindowsAzure.Messaging.SBNotificationHub: the native class hasn't been loaded.

which happens because the SBNotificationHub doesn't exist in the final
executable. We asked the linker to link with the static library containing
this type, but the linker didn't link with the library because it didn't need
any of the symbols in it.

We should have collected all the exported Objective-C types from this library
and asked the native linker to keep them, but that didn't happen because:

1. We collect bound Objective-C classes from binding libraries here (the
   ListExportedSymbolsStep): 608765e2c9/tools/linker/MonoTouch.Tuner/ListExportedSymbols.cs (L148-L157)

2. That only happens for attributes with a LinkWith attribute.
	* We compute if an assembly has a LinkWith attribute here:
	  608765e2c9/tools/common/Assembly.cs (L266)
	* Which is called from here:
	  608765e2c9/tools/common/Assembly.cs (L198)
	* Which is called from here (the ExtractBindingLibrariesStep):
	  608765e2c9/tools/dotnet-linker/Steps/ExtractBindingLibrariesStep.cs (L18)

Now, we must obviously compute if an assembly has a LinkWith attribute before
doing anything that depends on that value, but we weren't doing things in that
order.

Changing the custom linker steps to run the ListExportedSymbols step *after*
the ExtractBindingLibrariesStep fixes this logic problem.

Fixes https://github.com/xamarin/xamarin-macios/issues/17347.
2023-01-25 08:59:56 +01:00
Rolf Bjarne Kvinge 10accc2cd7
[dotnet/msbuild] Only compile entitlements once for universal builds. Fixes #15632. (#17096)
Fixes https://github.com/xamarin/xamarin-macios/issues/15632.
2023-01-19 16:01:34 +01:00
Rolf Bjarne Kvinge 7d02fa6f4f
[dotnet] Ensure any trimmer components are restored properly. (#17227)
.NET 8 will load the ILLink component based on the target framework of the
project file - so if .NET 8 is building a net7.0-ios app, the build will
restore and use the ILLink component from .NET 7.

There is a problem however:

* The inclusion of the ILLink component is dpendent on the PublishTrimmed
  property - if PublishTrimmed is true, then the ILLink component is restored
  (which makes sense, why restore it if it's not going to be used?).
* We always PublishTrimmed, because the linker must always be executed for our
  projects. So far so good - we can just always enable PublishTrimmed, right?
* Nope, when building on Windows, we only enable PublishTrimmed when connected
  to a Mac, because that's where the ILLink target must be executed (and if
  we're not connected to a Mac, we can't run the ILLink target, and things
  fall apart - so just disable PublishTrimmed in that, since it won't work
  anyway).
* Early on in the build we have no idea if we're connected to a Mac or not,
  which means we can only enable PublishTrimmed in a target, and not as an
  early-on default value. This is *way* to late for the ILLink component,
  which needs PublishTrimmed set quite early in the build process.
* Fortunately, the ILLink inclusion is actually gated on a different variable
  (_IsTrimmingEnabled) - which is initialized from PublishTrimmed if it's not
  set. So the way out here is to set _IsTrimmingEnabled early enough, and now
  the ILLink component is included and restored.
* The additional hurdle is that we need to set _IsTrimmingEnabled in our .NET
  6 and .NET 7 workloads as well, it's not enough to set it in our .NET 8
  workload (which isn't even loaded when building an earlier TFM).
2023-01-16 08:21:09 +01:00
Rolf Bjarne Kvinge 74d7337dcc
[dotnet] Create an MSBuild property for the current min OS version. (#17034)
Create an MSBuild property for the minimum OS version
(`SupportedOSPlatformVersion`) we support for a given platform (named
`[platform]MinSupportedOSPlatformVersion`), and use it in most tests instead
of hardcoding the min OS version (which would otherwise have to be updated
every time we bump the min OS version).
2023-01-10 21:18:39 +01:00
TJ Lambert eae0930fcb
[Localization] Change the line endings to use LF instead of CRLF (#17155)
Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2023-01-09 10:28:08 +01:00
VS MobileTools Engineering Service 2 a6c71fec74
Localized file check-in by OneLocBuild Task: Build definition ID 17751: Build ID 7141571 (#17131)
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-01-05 10:11:06 -06:00
Timothé Larivière 3b73bb658b
Add an additional F# template for Microsoft.iOS.iOSApp (#16823)
Closes #16822 

This PR adds an F# template to the basic Microsoft.iOS.iOSApp template.
This should allow being able to do either:

```
dotnet new ios -lang C# -n MyApp
dotnet new ios -lang F# -n MyApp
```

I had to move the C# template into a `csharp` folder.
Also added the `groupIdentity` `Microsoft.iOS.iOSApp` and set the identity for both C# and F# respectively to `Microsoft.iOS.iOSApp.CSharp` and `Microsoft.iOS.iOSApp.FSharp`

Co-authored-by: Timothé LARIVIERE <timothe.lariviere@fundourselves.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-12-22 12:04:36 +01:00
Andoni Morales Alastruey efad190de9
[msbuild] Validate OutputType property (#16871)
Fixes #16865

```
➜  test dotnet build  -bl:msbuild.binlog
MSBuild version 17.3.2+561848881 for .NET
/usr/local/share/dotnet/sdk/6.0.403/MSBuild.dll -bl:msbuild.binlog -consoleloggerparameters:Summary -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,/usr/local/share/dotnet/sdk/6.0.403/dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,/usr/local/share/dotnet/sdk/6.0.403/dotnet.dll -maxcpucount -restore -verbosity:m ./test.csproj
  Determining projects to restore...
  All projects are up-to-date for restore.
/usr/local/share/dotnet/packs/Microsoft.macOS.Sdk/12.3.471/targets/Xamarin.Shared.Sdk.targets(284,3): error : WinExe is not a valid output type for macOS [/Users/andoni/Downloads/test/test.csproj]

Build FAILED.

/usr/local/share/dotnet/packs/Microsoft.macOS.Sdk/12.3.471/targets/Xamarin.Shared.Sdk.targets(284,3): error : WinExe is not a valid output type for macOS [/Users/andoni/Downloads/test/test.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:01.14
```

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-12-22 07:36:04 +01:00
Rolf Bjarne Kvinge e06f49dd90
[dotnet] We no longer need to add the entry assembly as a root assembly for the linker. (#17026)
It's automatically done in the linker's MSBuild logic.

Not only is it no longer necessary (hasn't been for a while), it'll be wrong
in .NET 8 after https://github.com/dotnet/linker/pull/3124.
2022-12-19 18:36:54 +01:00
Andoni Morales Alastruey 4cfccff38e
Fix libs reidentification deployed in a subdirectory (#16706)
Dynamic libraries might be deployed in subdirectories such as libclrjit.dylib from the nuget package cefglue.common:
Contents/MonoBundle/CefGlueBrowserProcess/libclrjit.dylib

The library ID for that library should be: @executable_path/../MonoBundle/CefGlueBrowserProcess/libclrjit.dylib

Instead of: @executable_path/../MonoBundle/libclrjit.dylib

Beside the library ID being wrong, when it's combined with the nuget package microsoft.netcore.app.runtime.osx-x64 providing a library with the same name, both uses the same `ReidentifiedPath`, which can cause a failure in the InstallNameTool tasks that are run in parallel operating on the same temporary file.

The following patch uses the `RelativePath` for the tempory file used by `InstallNameTool` so that there are no clashes with other files with the same name deployed in other directories. It also uses the `RelativePath` to create the correct library id: @executable_path/../../Contents/MonoBundle/CefGlueBrowserProcess/libclrjit.dylib

Partially fixes https://github.com/xamarin/xamarin-macios/issues/15173 for this scenario
2022-12-16 09:17:01 +01:00
Rolf Bjarne Kvinge aee3f88ae8
[msbuild/dotnet] Use a more unique property name than _AOTCompiler. (#17049)
Use a more unique property name than _AOTCompiler (use _XamarinAOTCompiler
instead) to try to prevent any problems if somebody else tries to use
'_AOTCompiler' somewhere.

Ref: https://github.com/xamarin/xamarin-macios/pull/17033#discussion_r1047823981
2022-12-16 07:22:51 +01:00
Rolf Bjarne Kvinge 7fd33cce1b
[dotnet] Cache the AOT compiler path. Fixes #16774. (#17033)
Cache the AOT compiler path, to avoid an expensive recomputation on every
build. This is even more expensive when building remotely from Windows, so
store the cached value on Windows.

Fixes https://github.com/xamarin/xamarin-macios/issues/16774.
2022-12-14 18:23:43 +01:00
Rolf Bjarne Kvinge 85b4b791a2
[dotnet] Fix line endings in template localizations. (#16981)
The automatic translation apparently runs on windows, creates files with crlf,
and will check in the corresponding files as such. During the local build
these files will be read and written out again, but now with lf endings,
leaving all these files modified.

So set the 'text' git attribute for these files, so that they're stored as
'lf' and converted to 'crlf' on Windows.
2022-12-12 17:12:35 +01:00