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

710 Коммитов

Автор SHA1 Сообщение Дата
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
Rolf Bjarne Kvinge 294314a518
[autoformat] Add the rest of the repository. (#16974) 2022-12-07 09:13:36 +01:00
Jeffrey Stedfast 1075c66d95
Fix typo in iOS Storyboard template (#16966)
Partial fix for https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1694105

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-12-06 13:00:28 +01:00
VS MobileTools Engineering Service 2 a201c4b3af
Localized file check-in by OneLocBuild Task: Build definition ID 17751: Build ID 7046351 (#16955)
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.
2022-12-05 09:10:55 -06:00
Jonathan Peppers b7170fb735
[build] Add support for Visual Studio on win-arm64 (#16935)
Context: https://github.com/xamarin/yaml-templates/pull/204
Context: https://github.com/xamarin/xamarin-android/pull/7471

Updates the VSMAN files generated for our .NET workload to support Visual Studio on windows-arm64.
2022-12-02 09:08:56 +01:00
VS MobileTools Engineering Service 2 96c39dcaf9
Localized file check-in by OneLocBuild Task: Build definition ID 17751: Build ID 6990346 (#16843)
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.
2022-11-22 10:35:04 -06:00
Rolf Bjarne Kvinge 5583f5c6b2
[dotnet] Ensure all templates are targetting .NET 7. (#16819) 2022-11-21 09:35:40 +01:00
Rolf Bjarne Kvinge 1fe87884f4
[dotnet] Make sure to create a directory before we try to put files into it. (#16778)
Fixes this random build error:

    cp: Workloads/Microsoft.NET.Sdk.tvOS/LICENSE: clonefile failed: No such file or directory
    make[1]: *** [Makefile:193: Workloads/Microsoft.NET.Sdk.tvOS/LICENSE] Error 1
    make[1]: *** Waiting for unfinished jobs....
    make[1]: Leaving directory '/Users/rolf/work/maccore/dotnet/xamarin-macios/dotnet'

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2022-11-18 08:03:01 +01:00
Rolf Bjarne Kvinge 0a53f3cd60
Add automatic support for not building iOS 32-bit stuff when min iOS version is >= 11.0 (#16746)
There are no changes for 32-bit watchOS, because watchOS support is likely to
go away completely anyways.
2022-11-18 07:59:46 +01:00
Rolf Bjarne Kvinge fc12f4db2b
[dotnet] Make sure to create a directory before we try to put files into it. (#16757)
Fixes this random build error:

    /bin/sh: Workloads/Microsoft.NET.Sdk.macOS/WorkloadManifest.targets.tmp: No such file or directory
    make[1]: *** [Workloads/Microsoft.NET.Sdk.macOS/WorkloadManifest.targets] Error 1
    make[1]: *** Waiting for unfinished jobs....
2022-11-16 07:54:13 +01:00
Rolf Bjarne Kvinge b8c5f46d84
[dotnet/tools] Don't disable compact unwind info. Fixes #16546. (#16623)
Don't disable compact unwind info in the native linker, it may break C++
exception handling.

We originally disabled compact unwind info to fix a warning from the native
linker, this will have to be solved another way (in any case extra build
warnings is preferrable compared to an app crashing at runtime due to broken
C++ exception handling).

This partially reverts c05e774612.

Fixes https://github.com/xamarin/xamarin-macios/issues/16546.
2022-11-08 12:16:11 +01:00
Peter Collins c6dfc40eae
[dotnet] Always use a four part VS component version (#16633)
The `%(Version)` metadata declared in `vs-workload.props` should always
be a four part version, this was missed when reviewing commit 9f1dc519ea.
Fix this by adding a trailing `.0` to stable branded packages.

For "Preview" branded manifest packs, the fourth part of the version
should be the commit distance (e.g. 16.1.0.5).

For "Stable" branded manifest packs, the third part of the version
should be the commit distance (e.g. 16.1.5.0).

See the following for more info on `vs-workload.props` versioning:
https://github.com/xamarin/sdk-insertions/wiki/How-to-create-a-new-insertion#msi-generation-and-vs-versioning-requirements
2022-11-08 09:15:32 +01:00
Rolf Bjarne Kvinge 1d16b66542
[dotnet] Show a better error when trying to launch an app using 'dotnet run' on Windows. (#16610)
Ref: https://github.com/xamarin/xamarin-macios/issues/16609
2022-11-08 07:32:03 +01:00
Rolf Bjarne Kvinge 9f1dc519ea
[dotnet] Adjust stable MSI versioning. (#16501)
Stable MSIs are versioned like non-stable MSIs, except that:

* We define the commit distance as the number of commits since the branch
  bacame a release branch (and started using stable branding). Technically
  this is the number of commits since the `NUGET_RELEASE_BRANCH` variable
  changed (which will be incorrect for non-stable branches, but in that case
  we shouldn't use this number in those scenarios).
* We use the above-mentioned commit distance as the third number in the MSI
  version (as opposed to the fourth number in non-stable branches.)

Note: we detect if we're building a stable release by checking if the
`NUGET_PRERELEASE_IDENTIFIER` is empty (we can't use `NUGET_RELEASE_BRANCH`,
because this variable will be set for PRs to the release branch, while
`NUGET_PRERELEASE_IDENTIFIER` will only be empty for CI builds from a stable
branch).
2022-10-31 15:30:58 +01:00
dotnet-maestro[bot] 12f8af16c6
[net7.0-xcode14.1] Update dependencies from dotnet/installer (#16455)
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.AspNetCore.App.Ref**: from 7.0.0-rtm.22479.3 to 7.0.0-rtm.22512.1 (parent: Microsoft.Dotnet.Sdk.Internal)

## From https://github.com/dotnet/installer
- **Subscription**: df408977-ead8-4cfb-e40b-08dab20af502
- **Build**: 20221019.39
- **Date Produced**: October 20, 2022 12:51:36 AM UTC
- **Commit**: e6dd91c290b808f971a1ac69c2fb29395bbf1051
- **Branch**: refs/heads/release/7.0.1xx

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 7.0.100-rtm.22479.5 to 7.0.100-rtm.22519.39][3]
  - **Microsoft.AspNetCore.App.Ref**: [from 7.0.0-rtm.22479.3 to 7.0.0-rtm.22512.1][4]

[3]: eb23d8c...e6dd91c
[4]: 02d62cf...c686535

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <github-actions@xamarin.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-10-27 12:08:56 +02:00
Rolf Bjarne Kvinge 24f1fc18ed Merge remote-tracking branch 'origin/xcode14.1' into net7.0-xcode14.1 2022-10-20 19:30:22 +02:00
Rolf Bjarne Kvinge cb6f555665 Merge main into xcode14.1. 2022-10-17 11:35:33 +02:00
Rolf Bjarne Kvinge 5975ffd6f1 Merge main into net7.0. 2022-10-17 10:21:24 +02:00
Rolf Bjarne Kvinge e4fb94b3d1
[dotnet] Tweak a template name slightly. (#16323) 2022-10-13 23:26:01 +02:00
Rolf Bjarne Kvinge 18962171b9 Merge main into net7.0. 2022-10-13 13:36:40 +02:00
Rolf Bjarne Kvinge eec5f62054 Merge main into xcode14.1. 2022-10-13 13:36:23 +02:00
Rolf Bjarne Kvinge 74641f120a
[devops] Make each platform its own maestro build. (#16301)
This will hopefully make it easier to correctly subscribe to our maestro feeds
and only pick certain platforms.

It also fixes a problem where publishing wouldn't work unless we were building
for iOS, because the code was assuming that iOS was always enabled.
2022-10-11 23:55:30 +02:00
Rolf Bjarne Kvinge 9e3dbf2c09
[dotnet] Hardcode 'true' as the default value for GenerateSatelliteAssembliesForCore. Fixes #16193. (#16306)
Hardcode 'true' as the default value for GenerateSatelliteAssembliesForCore,
because .NET gets it wrong when building from inside VS (Windows).

When building using either VSMac or the command line (either from Windows or
Mac), the `MSBuildRuntimeType` property is set to `Core`, and as a result, the
default value for `GenerateSatelliteAssembliesForCore` is `true`:

```xml
<GenerateSatelliteAssembliesForCore Condition=" '$(GenerateSatelliteAssembliesForCore)' == '' and '$(MSBuildRuntimeType)' == 'Core' ">true</GenerateSatelliteAssembliesForCore>
```

See: 00100960bf/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets (L41)

This is the correct behavior.

However, when building from inside Visual Studio (for Windows), the
`MSBuildRuntimeType` property is set to `Full`, and thus
`GenerateSatelliteAssembliesForCore` is not set to `true`, and we end up
executing al.exe to generate satellite assemblies, which is wrong (al.exe
complains that 'arm64' is an invalid platform).

Fix this by always defaulting `GenerateSatelliteAssembliesForCore` to `true`,
independent on where we're executing.

Ref: https://github.com/dotnet/sdk/issues/28419.

Fixes https://github.com/xamarin/xamarin-macios/issues/16193.
2022-10-10 21:41:36 +02:00
Rolf Bjarne Kvinge 6b0d192131 Merge main into xcode14.1. 2022-10-10 13:02:13 +02:00
Rolf Bjarne Kvinge 9d306f3862 Merge main into net7.0. 2022-10-10 13:01:32 +02:00
Rolf Bjarne Kvinge acf4edbfed
[dotnet] Add numerous item templates. Fixes #15836. (#16287)
Add the following item templates for all platforms:

* Controller (View Controller with UI written in code)
* View
* View Controller (View Controller with UI written in XIB)
* Storyboard

Item templates won't show up in VSMac until this is released:
https://github.com/xamarin/vsmac/pull/9133.

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

Also update the template tests accordingly.

This PR might be easier to review commit-by-commit due to the large number of generated localization files.
2022-10-10 08:09:34 +02:00
Rolf Bjarne Kvinge 67f95e64f8
[dotnet] Fix whitespace in templates. (#16275)
Make indentation consistent, and add eol at the end of files.
2022-10-07 13:15:31 +02:00
Rolf Bjarne Kvinge 85292582ec
[dotnet] Add helpful make targets to implement and test templates (#16261) 2022-10-07 08:04:26 +02:00
Rolf Bjarne Kvinge 6d6c3b8570
[dotnet] Add class library project templates for tvOS, macOS and Mac Catalyst. (#16263)
These new project templates won't show up in VSMac until the new templates are
added to VSMac.

Ref: 61afbd1cd1/Xamarin.Addins.Core/Xamarin.Ide.Templating/TemplateDescriptionProvider.cs (L207-L216)

Also update the corresponding template tests.

This PR might be easier to review commit-by-commit due to the large number of generated localization files.
2022-10-06 16:47:06 +02:00
Rolf Bjarne Kvinge 6afa8eaeae
[dotnet] macOS is not a mobile platform, so don't claim it is in the templates. (#16262) 2022-10-06 16:46:27 +02:00
Rolf Bjarne Kvinge ec2390ad6c
[dotnet] Improve name and descripting in a few existing templates a little bit. (#16260)
This increases the consistency with how other templates are named.
2022-10-06 15:50:33 +02:00
Rolf Bjarne Kvinge ed612dcd6e Merge main into net7.0. 2022-09-28 17:17:10 +02:00
Rolf Bjarne Kvinge 7cc91e0c53 Merge main into xcode14.1. 2022-09-28 17:14:31 +02:00
VS MobileTools Engineering Service 2 f9bd979f7a
[main] [ci] Only try to sign nested zips if they exist (#16143)
Recent signing attempts on branches that are building a limited set of
Apple platforms are failing:

Target "_UnzipNestedZips: (TargetId:3)" in file
"D:\a\_work\_temp\artifact-signing\extracted\SignList.targets" from
project "D:\a\_work\_temp\artifact-signing\SignFiles.proj" (target
"_CalculateItemsToSign" depends on it):
Set Property:
_NestedZipExtractionDir=D:\a\_work\_temp\artifact-signing\extracted\nested\
Using "RemoveDir" task from assembly "Microsoft.Build.Tasks.Core,
Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
    Task "RemoveDir" (TaskId:2)
Task
Parameter:Directories=D:\a\_work\_temp\artifact-signing\extracted\nested\
(TaskId:2)
Directory "D:\a\_work\_temp\artifact-signing\extracted\nested\" doesn't
exist. Skipping. (TaskId:2)
    Done executing task "RemoveDir". (TaskId:2)
Using "Unzip" task from assembly "Microsoft.Build.Tasks.Core,
Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
    Task "Unzip" (TaskId:3)
D:\a\_work\_temp\artifact-signing\extracted\SignList.targets(16,5):
Error MSB4044: The "Unzip" task was not given a value for the required
parameter "DestinationFolder".

We should only attempt to extract and sign content in `Broker.zip`,
`Build.zip`, and `Xamarin.PreBuilt.iOS.app.zip` if the zip exists.


Backport of #16141

Co-authored-by: Peter Collins <pecolli@microsoft.com>
2022-09-28 07:53:27 +02:00
Rolf Bjarne Kvinge 00578621d4
[dotnet] Don't try to ILStrip assemblies unless we're connected to a Mac. (#16160)
Fixes this error:

	targets/Xamarin.Shared.Sdk.targets(754,3): error MSB4018: The "Xamarin.MacDev.Tasks.ILStrip" task failed unexpectedly.
	targets/Xamarin.Shared.Sdk.targets(754,3): error MSB4018: System.ArgumentException: 'Assemblies' is required. (Parameter 'Assemblies')
	targets/Xamarin.Shared.Sdk.targets(754,3): error MSB4018:    at ILStrip.Execute()
	targets/Xamarin.Shared.Sdk.targets(754,3): error MSB4018:    at ILStripTasks.ILStripBase.Execute() in /Users/rolf/work/maccore/main/xamarin-macios/msbuild/Xamarin.iOS.Tasks/Tasks/ILStripBase.cs:line 18
	targets/Xamarin.Shared.Sdk.targets(754,3): error MSB4018:    at Xamarin.MacDev.Tasks.ILStrip.Execute() in /Users/rolf/work/maccore/main/xamarin-macios/msbuild/Xamarin.iOS.Tasks/Tasks/ILStrip.cs:line 16
	targets/Xamarin.Shared.Sdk.targets(754,3): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
	targets/Xamarin.Shared.Sdk.targets(754,3): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
     0 Warning(s)
     1 Error(s)
2022-09-28 07:29:52 +02:00
Rolf Bjarne Kvinge e9e097c794
[dotnet] Don't try to collect RID-specific items to codesign unless we're connected to (or building on) a Mac. (#16153)
Fixes this problem when building universal Mac Catalyst apps on Windows:

    Target Name=_CollectRidSpecificCodesignItems Project=D:\a\_work\1\s\src\Graphics\samples\GraphicsTester.Skia.Mac\GraphicsTester.Skia.Mac.csproj
        ReadItemsFromFile
            Assembly = D:\a\_work\1\s\bin\dotnet\packs\Microsoft.MacCatalyst.Sdk\15.4.1173-rc.2\tools\msbuild\iOS\..\iOS\Xamarin.iOS.Tasks.dll
            Parameters
                File = obj\Release\net7.0-macos\codesignitems-osx-x64.items
            Errors
                D:\a\_work\1\s\bin\dotnet\packs\Microsoft.macOS.Sdk\12.3.1173-rc.2\targets\Xamarin.Shared.Sdk.targets(1303,3): error MSB4018: The "ReadItemsFromFile" task failed unexpectedly.
    System.IO.FileNotFoundException: Could not find file 'D:\a\_work\1\s\src\Graphics\samples\GraphicsTester.Skia.Mac\obj\Release\net7.0-macos\codesignitems-osx-x64.items'.
    File name: 'D:\a\_work\1\s\src\Graphics\samples\GraphicsTester.Skia.Mac\obj\Release\net7.0-macos\codesignitems-osx-x64.items'
       at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
       at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
       at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
       at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy)
       at System.Xml.XmlTextReaderImpl.FinishInitUriString()
       at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
       at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
       at Xamarin.MacDev.Tasks.ReadItemsFromFileBase.Execute() in /Users/builder/azdo/_work/1/s/xamarin-macios/msbuild/Xamarin.MacDev.Tasks/Tasks/ReadItemsFromFileBase.cs:line 39
       at Xamarin.MacDev.Tasks.ReadItemsFromFile.Execute() in /Users/builder/azdo/_work/1/s/xamarin-macios/msbuild/Xamarin.MacDev.Tasks/Tasks/ReadItemsFromFile.cs:line 15
       at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
       at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [D:\a\_work\1\s\src\Graphics\samples\GraphicsTester.Skia.Mac\GraphicsTester.Skia.Mac.csproj]
2022-09-27 17:29:58 +02:00
Rolf Bjarne Kvinge 1683c18cec
Merge main into net7.0. (#16133) 2022-09-27 11:31:52 +02:00
VS MobileTools Engineering Service 2 8cbc5c3510
[net7.0] [workload] Update net6.0 KnownFrameworkReference (#15882)
A `Xamarin.Shared.Sdk.MultiTarget.targets` file has been added to update
the ref/runtime pack versions associated with the .NET 6 SDK.  This file
will ship as part of the .NET 7 SDK but only be imported when using the
.NET 6 SDK.  This should work around the need to add new and net7
versioned aliases of the `Ref` and `Runtime` packs.  Adding this file to
`AfterMicrosoftNETSdkTargets` will ensure that it is imported last,
after all `KnownFrameworkReferences` that need updating are declared.

Backport of #15834

Co-authored-by: Peter Collins <pecolli@microsoft.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-09-26 22:55:24 +02:00
Rolf Bjarne Kvinge 9c3458dc33 Merge main into xcode14.1. 2022-09-26 22:46:59 +02:00
Rolf Bjarne Kvinge 56165a77ec Merge main into net7.0. 2022-09-26 22:44:48 +02:00
Peter Collins 85799ee55b
[build] Improve generated manifest MSI versions (#16092)
Attempt to improve consistency in generated workload manifest MSI versions by more closely following the four digit versioning schema used by Android and MAUI.  This change should only affect preview versioned workload manifests, as stable manifest MSIs will now use the three digit NuGet package version as the MSI version.

The previous version passed to the MSI version generation task in arcade contained the commit distance twice, and now the commit distance is only used in the fourth version part.

Before:
Version="15.4.1167.1167"

After:
Version="15.4.0.1167"

Compared to Android/MAUI:
Version="33.0.0.151"
Version="7.0.0.6683"

With these changes the arcade task should weigh the time delta between builds more heavily, which should produce MSI versions that increment more consistently and by smaller amounts.
2022-09-23 07:26:59 +02:00
Rolf Bjarne Kvinge 15e9683a53 Bump main in net7.0. 2022-09-22 07:55:18 +02:00
Rolf Bjarne Kvinge f4d5e6eeab Merge main into xcode14.1. 2022-09-22 07:50:58 +02:00
VS MobileTools Engineering Service 2 d8fb2672b0
[dotnet] Fix vs-workload.props generation when only some platforms are included in the build. (#16067)
Backport of #16030 with some additional changes.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-09-22 07:15:43 +02:00
Rolf Bjarne Kvinge 702510c028 Fix new template projects. 2022-09-20 07:57:33 +02:00
Rolf Bjarne Kvinge 4215eae4a3 Merge main into xcode14.1. 2022-09-16 18:35:48 +02:00
Rolf Bjarne Kvinge 40b3831bc7 Merge remote-tracking branch 'origin/main' into bump-main-in-net7.0-2022-09-16 2022-09-16 18:32:01 +02:00
Rolf Bjarne Kvinge fbb39bc2cf
[dotnet] Fix markdown syntax in BundleContents.md (#15962) 2022-09-15 15:41:25 +02:00
Rolf Bjarne Kvinge 17821f0585 Merge remote-tracking branch 'origin/main' into bump-main-in-net7.0-2022-09-12 2022-09-12 11:28:02 +02:00
Rolf Bjarne Kvinge 68eb7d401f Merge remote-tracking branch 'origin/main' into bump-main-in-xcode14-2022-09-12 2022-09-12 11:27:02 +02:00
Rolf Bjarne Kvinge e84cca8cb6
[dotnet] Add binding templates for tvOS and macOS. Fixes #15839. (#15921)
Fixes https://github.com/xamarin/xamarin-macios/issues/15839.
2022-09-12 10:21:47 +02:00
Rolf Bjarne Kvinge b6cdde4280
[msbuild] Add support for keeping temporary output when looking for AOT compilers. (#15884) 2022-09-09 17:10:50 +02:00
Rolf Bjarne Kvinge 681fce6036 Merge remote-tracking branch 'origin/net7.0' into bump-main-in-net7.0-2022-09-07 2022-09-07 11:38:51 +02:00
Rolf Bjarne Kvinge ea4b193303 Merge remote-tracking branch 'origin/main' into bump-main-in-net7.0-2022-09-07 2022-09-07 10:57:58 +02:00
Rolf Bjarne Kvinge 433c48a35e Merge remote-tracking branch 'origin/main' into bump-main-in-xcode14-2022-09-07 2022-09-07 10:56:00 +02:00
Rolf Bjarne Kvinge 2415050767
[dotnet] Fix issue with frameworks with dots. Fixes #15727. (#15872)
Since executables in frameworks usually don't have dots, `%(Filename)` will be
the entire filename, because `%(Extension)` is empty. However, if the
executable happens to have a dot, then we need to include the extension:
`%(Filename)%(Extension)`.

Fixes https://github.com/xamarin/xamarin-macios/issues/15727.
2022-09-07 10:43:33 +02:00
Rolf Bjarne Kvinge 200a5e6eef
[dotnet] Fix a few typos in variable names. (#15871) 2022-09-06 09:12:03 +02:00
Rolf Bjarne Kvinge 692c71bd8c Merge remote-tracking branch 'origin/net7.0' into backport-pr-15761-to-net7.0 2022-09-05 21:50:14 +02:00
Rolf Bjarne Kvinge d1ef85446d
Misc fixes to make the build more silent. (#15852) 2022-09-05 10:55:41 +02:00
Rolf Bjarne Kvinge a0ebd954c3 Bump to dotnet/runtime/release/7.0@608da95f.
Stop relying on dotnet/installer to provide dotnet/runtime bumps.

Ref: https://github.com/xamarin/xamarin-android/pull/7319
2022-09-01 18:39:22 +02:00
Rolf Bjarne Kvinge 91a568784c
Merge main into net7.0. (#15826) 2022-09-01 15:29:44 +02:00
Rolf Bjarne Kvinge 2ddb7a6d68
[dotnet] Make relase builds for desktop universal by default. Fixes #15620. (#15769) 2022-08-31 16:45:10 +02:00
Rolf Bjarne Kvinge 4922bf4570 Merge remote-tracking branch 'origin/main' into bump-main-in-net7.0-2022-08-31 2022-08-31 13:45:17 +02:00
Peter Collins ed9aae49da
[workloads] Fix iOS.Windows.Sdk.Aliased.net6 pack name (#15820)
Commit 246aa834 missed a manifest pack entry when renaming packs to
include a `.net6` suffix, producing an invalid manifest and causing MSI
conversion to fail.  Fix this by making sure to use  the `.net6` suffix
everywhere.

Failing build context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=6627063&view=logs&j=b4ea4e02-2fcb-5a4a-1d1d-96cc58456a90&t=1ef5c69d-aeda-5369-a23d-e57771ac0882&l=119
2022-08-31 11:18:30 +02:00
Peter Collins e9e037f70c [workloads] Fix manifest.json platform replacement (#15822)
Fixes a string replacement related typo in the generated pack name for
`Microsoft.@PLATFORM@.Windows.Sdk.Aliased.net7`.
2022-08-31 10:21:59 +02:00
Rolf Bjarne Kvinge ff3aeb5073 Merge remote-tracking branch 'origin/main' into bump-main-in-xcode14-2022-08-30 2022-08-30 11:14:47 +02:00
Mauro Agnoletti 6a40697836
Add 'None' build action to ObjC binding items (#15797)
Besides excluding the API definition and core source files from the compilation list, we also need to re-add them as 'None' items so they're still shown in the IDE

Fix related to: https://github.com/xamarin/xamarin-macios/issues/15690
2022-08-30 10:01:23 +02:00
VS MobileTools Engineering Service 2 246aa83443
[main] [ci] Add support to main for multi-targeting in VS (#15786)
Context: https://github.com/xamarin/yaml-templates/pull/180
Context: https://github.com/xamarin/yaml-templates/pull/195
Context: https://github.com/xamarin/yaml-templates/pull/199
Context: https://github.com/xamarin/xamarin-macios/pull/15761

Updates the build to use the latest MSI generation template. The v3
template uses the latest changes from arcade which include a large
refactoring, support for multi-targeting, and support for workload pack
group MSIs.

The build will now produce two different VS Drop artifacts.  The MSI and
VSMAN files generated for SDK packs have been split out into a new
`vsdrop-multitarget-signed` artifact, allowing us to include multiple
versions of the SDK packs in VS.

All of the SDK packs have been renamed to include a `.net6` suffix to
match the pack aliases that will be referenced in the .NET 7 manifests.


Backport of #15776

Co-authored-by: Peter Collins <pecolli@microsoft.com>
2022-08-29 12:08:39 +02:00
Rolf Bjarne Kvinge 38bd8191eb Merge remote-tracking branch 'origin/net7.0' into backport-pr-15761-to-net7.0 2022-08-29 11:55:45 +02:00
Peter Collins 934f677c47 Add MSI and VS Drop changes needed for multitargeting 2022-08-26 11:28:56 -04:00
Rolf Bjarne Kvinge be73bfadae [dotnet] Remove any global usings added by the .NET 6 SDK pack. 2022-08-26 13:36:35 +00:00
Rolf Bjarne Kvinge 61823e4182 [dotnet] Generate the WorkloadManifest.json files and add .net6/.net7 variants in there.
This way a workload restore will get the .NET 7 runtime packs.
2022-08-26 13:36:35 +00:00
Rolf Bjarne Kvinge ba64775ba7 [dotnet] Rework KnownFrameworkReference so that 'net6.0-*' TargetFrameworks work when building with .NET 7. Fixes #15375.
The KnownFrameworkReference now references the exact versions of the ref and runtime
packs we're shipping with the sdk pack, instead of telling the build to use whatever
version is defined in the workload.

Then in the workload we specify the latest released version of the .NET 6 for the
ref and runtime packs.

Finally we add an aliased sdk pack, which points to the .NET 6 sdk pack, and
when we're building a .NET 6 TargetFramework we load this aliased sdk pack
instead of the one we're shipping with this workload.

Putting this together means that:

* When we're building a .NET 7 TargetFramework, we load the sdk pack shipped
  with the workload, which adds a KnownFrameworkReference which references the
  ref and runtime packs with the same version as the sdk pack.
* When we're building a .NET 6 TargetFramework, we load the (aliased) sdk pack
  which points to the latest stable .NET 6 sdk pack. That sdk pack will add a
  KnownFrameworkReference that tells the build to use the ref and runtime pack
  versions specified in the workload - which are now pointing to the .NET 6
  ref and runtime pack versions.

Thus we use the .NET 6 sdk, ref and runtime packs when building a .NET 6
TargetFramework, and we use the .NET 7 sdk, ref and runtime packs when
building a .NET 7 TargetFramework.

According to the workload design spec [1], this is supposed to be implemented
by using aliased ref and runtime packs, but that doesn't work due to
https://github.com/dotnet/sdk/issues/26384.

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

[1]: https://github.com/dotnet/designs/blob/main/accepted/2020/workloads/workload-manifest.md?rgh-link-date=2022-06-30T08%3A25%3A10Z#side-by-side-workload-pattern
2022-08-26 13:36:35 +00:00
Rolf Bjarne Kvinge 4289148b28 Merge remote-tracking branch 'origin/main' into bump-main-in-xcode14-2022-08-26 2022-08-26 13:24:27 +02:00