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

917 Коммитов

Автор SHA1 Сообщение Дата
Sebastien Pouliot cb7ece6e6b
[msbuild] Fix error message MSBStrings.W0073 -> W0074 (#11585)
Due to incorrect update while adapting code for translations.

```
    <data name="W0073" xml:space="preserve">
        <value>The App Extension '{0}' has a CFBundleVersion ({1}) that does not match the main app bundle's CFBundleVersion ({2})
        </value>
    </data>

    <data name="W0074" xml:space="preserve">
        <value>The App Extension '{0}' has an unrecognized NSExtensionPointIdentifier value ('{1}').
        </value>
    </data>
```

Fixes https://github.com/xamarin/xamarin-macios/issues/11581
2021-05-17 23:09:07 -04:00
Rolf Bjarne Kvinge cf932d8f61
[msbuild] Add support for smelting metal for Mac Catalyst. (#11537)
This makes monotouch-test's Metal test file compile for Mac Catalyst.
2021-05-14 07:26:44 +02:00
TJ Lambert 4fb1707e11
initial changes to Change languageSet and Dependencies (#11512)
Co-authored-by: tj_devel709 <antlambe@microsoft.com>
2021-05-13 08:35:08 -05:00
Mauro Agnoletti 11465a7c79
Updated Xamarin.Messaging version (#11479) 2021-05-10 07:26:20 +02:00
tj_devel709 de63dd6891 changing the resx files TEMPORARILY 2021-05-07 10:49:38 -05:00
Rolf Bjarne Kvinge 87d018d57e
[msbuild] Remove dead code. (#11468) 2021-05-07 15:41:36 +02:00
TJ Lambert a154f30e03
[Localization] Localization changes for OneLocBuild (#11395)
Enabling MSBuild, Mtouch, and all their localization dependencies to use the new resx files provided from OneLocBuild.
2021-05-06 19:42:53 -05:00
Emanuel Fernandez Dell'Oca d5f1671184
[dotnet] Fix _DetectSdkLocations from Windows (#11451)
This task ends up setting as env variable the Xamarin Sdk root directory on the Mac, but when building from Windows it was setting the Windows path, so instead we need to override it with the proper value on macOS.

This should not change the original behavior when building from macOS.
2021-05-06 07:42:43 +02:00
Rolf Bjarne Kvinge 6225cac669
[msbuild/dotnet] Fix build logic when using .NET to not try to use nor require any version of installed Xamarin.iOS/Xamarin.Mac. Fixes #10827. (#11433)
* [dotnet] Ship the buildinfo file.

* [msbuild/dotnet] Fix build logic when using .NET to not try to use nor require any version of installed Xamarin.iOS/Xamarin.Mac. Fixes #10827.

We do this by setting the _XamarinSdkRoot variable in our .NET logic, which
our existing shared build logic reads, passes to the DetectSdkLocations task,
and then sets our override environment variable
(MD_MTOUCH_SDK_ROOT/XAMMAC_FRAMEWORK_PATH) to the install location, so that
existing code (which honors the override variable) continues to work as-is.

Fixes https://github.com/xamarin/xamarin-macios/issues/10827.
2021-05-04 21:36:48 -04:00
Emanuel Fernandez Dell'Oca 2aa6c5aa6b
[dotnet] Fixes _RunILLink from Windows for Preview 4 (#11390)
There were some changes on the original target.
2021-04-30 08:46:51 +02:00
Rolf Bjarne Kvinge 6f743fd292
[build] Skip building stuff that isn't enabled. (#11385) 2021-04-30 07:51:58 +02:00
Rolf Bjarne Kvinge cb32305434
[msbuild] Show tool output with high importance if the tool fails. (#11380)
Build failures will now include things like this for quiet builds:

    Tool xcrun execution finished (exit code = 1).

    Undefined symbols for architecture x86_64:
      "_GlobalizationNative_LoadICUData", referenced from:
         -u command line option
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
2021-04-30 07:44:27 +02:00
Mauro Agnoletti b4b8ee735c
Updated Xamarin.Messaging version (#11369)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-04-29 09:05:52 +02:00
Peter Collins b88c3bb031
[build] Create Microsoft.iOS.Windows.Sdk workload pack (#11251)
Converts the Microsoft.iOS.Windows.Sdk NuGet package into a proper
[workload SDK pack][0].  The entry point for this pack has been changed,
and it is now imported through the `WorkloadManifest.targets` file
included in `Microsoft.NET.Workload.iOS`, rather than being imported
directly from `Microsoft.iOS.Sdk`.

Import ordering has otherwise changed slightly.  The following files are
now imported before the majority of the `Microsoft.iOS.Sdk` (and the 
majority of the .NET SDK targets):

 * Xamarin.iOS.Common.Before.props
 * Xamarin.iOS.Common.Before.targets

After this the majority of the .NET SDK targets will load, followed by
the `Microsoft.iOS.Sdk` targets. Finally, everything declared in the
`<AfterMicrosoftNETSdkTargets/>` hook loads, which consists of:

 * Microsoft.iOS.Windows.Sdk.targets
 * tools/msbuild/*

[0]: https://github.com/dotnet/designs/blob/main/accepted/2020/workloads/workload-manifest.md#sdk-packs

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-04-27 07:44:51 +02:00
Emanuel Fernandez Dell'Oca 7415b898f8
[dotnet] Sets missing ILLink parameter from Windows (#11319)
This was making the linker to not behave correctly, and apps were crashing on the simulator.
2021-04-26 10:06:34 +02:00
Emanuel Fernandez Dell'Oca 9afd2aa300
[msbuild] Fixes DebugType for VS (#11297)
We stopped converting full pdbs to mdbs on Windows, so we need to override the `DebugType` property to `portable` if it's `full`, otherwise the debugger won't work from Visual Studio.
2021-04-23 15:55:05 +02:00
Emanuel Fernandez Dell'Oca b4afe27f75
[msbuild] Removes explicit Mqtt dependency (#11302)
There were 2 "problems":
1- Messaging depends on `System.Net.Mqtt` and not in `System.Net.Mqtt.Server`. It still worked because the latter depends on the former package, but we were restoring unnecessary dependencies.
2- We don't need an excplicit reference, since `Xamarin.Messaging.Build.Client` already depends on it, and by removing it we avoid having another dependency to keep up to date.
2021-04-23 15:53:36 +02:00
Emanuel Fernandez Dell'Oca 965ab98b84
[msbuild] Fixes archiving and copying files to Windows (#11277)
* [msbuild] Fixes Windows task namespace

* [msbuild] Fixes unzipping files from Windows

This is the same approach we're using on the Xamarin.iOS.Tasks project, we need to replace the System.Text.Encoding.CodePages reference assembly by it's runtime implementation before ilmerging it, otherwise when trying to unzip files from Windows we'll get a null ref exception because that's what the ref assembly implemented.

* [msbuild] Try to copy output to Windows before ending the XMA connection

When relying on BuildDependsOn we can end up running the targets after _SayGoodBye, which ends the XMA connection. `CopyDSYMFromMac` and `CopyAppBundleFromMac` need an active connection, since both copy files from the Mac to Windows.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-04-22 12:02:38 +02:00
Mauro Agnoletti 8f0dffebfc
Updated Xamarin.Messaging version (#11245) 2021-04-21 21:34:07 -04:00
Peter Collins 7a5c28f6cc
[msbuild] Rename $(_UsingXamarinSdk) to $(UsingAppleNETSdk) (#11270)
The `$(_UsingXamarinSdk)` property has been renamed to help improve
external usability.  This change increases parity with the Android SDK,
which currently defines `$(UsingAndroidNETSdk)` for internal and
external use.
2021-04-21 21:32:33 -04:00
Rolf Bjarne Kvinge 76666ccbef
[msbuild] Accept 'UseInterpreter' as an alternative for 'MtouchInterpreter'. Fixes #11138. (#11252)
Accept 'UseInterpreter' as an alternative for 'MtouchInterpreter', so that we
support the same variable name between iOS and Android.

Fixes https://github.com/xamarin/xamarin-macios/issues/11138.
2021-04-21 15:37:16 +02:00
Sebastien Pouliot 4560862966
[msbuild] Fix copy/paste error from #11196 (#11206)
Not sure how I could mess up a copy/paste between file - but I succeeded
to create a subtle bug (would have expected it more crash happy)

Fix issue #11151
2021-04-14 09:39:39 -04:00
Emanuel Fernandez Dell'Oca 6dfb470e74
Reenable HotRestart targets for the legacy Sdk (#11169)
There's no Hot Restart support for net6 yet, but we should still import those targets if the file exist, because are needed on the legacy iOS Sdk on Windows.
2021-04-09 11:20:05 -04:00
Peter Collins 5c12fdfac9
[build] Use arcade dependency management tooling (#10890)
* [build] Use arcade dependency management tooling

* Apply feedback

* Apply second round of feedback

* Always make dotnet.config before trying to read it

* Debugging

* Update dependencies, trim tabs and spaces

* [dotnet] Remove the existing workload shipped with .NET and install our locally built ones.

The new version of .NET ships with our workloads, but those aren't
the workloads we want to use, so replace them with our own.

* Update .gitignores.

* Bump to 6.0.100-preview.3.21181.5

That required renaming simulator runtime packs...

* More rename for simulator packages

* moar (hopefully all)

* Bump to 6.0.100-preview.3.21201.11

This fix the issue with `Wait` that failed several tests in monotouch-tests

However it does not include the fix for AppConext.GetData on device (AOT)

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Sebastien Pouliot <sebastien@xamarin.com>
2021-04-02 00:02:27 -04:00
Sebastien Pouliot 747cc9a2b8
[dotnet] Fix device builds (#11036)
With P3 addition on ICU we must now link the native executable as C++.

Remove an old workaround, in many tests, referencing old (5.0/previews)
packages that caused native link time failures.

ref: https://github.com/mono/linker/issues/1139
2021-03-31 12:59:07 -04:00
Alex Soto c77db16b76 Revert "Localized file check-in by OneLocBuild Task"
This reverts commit 92e847b68e.
2021-03-25 19:43:47 -04:00
VS MobileTools Engineering Service 2 92e847b68e Localized file check-in by OneLocBuild Task 2021-03-25 12:25:59 -07:00
Rolf Bjarne Kvinge 1d9c9baf25
[msbuild] Fix ItemName vs PropertyName confusion in task output. (#10936)
There doesn't seem to have been any ill effects from the confusion, but it's
better done the right way.
2021-03-25 15:51:37 +01:00
Filip Navara 85dd54db29
Link FrameworkList.xml to a place where MSBuild SDK actually expects it (#10928)
The [SDK conflict resolution code](3c1307d227/src/Tasks/Common/src/ConflictResolution/ResolvePackageFileConflicts.cs (L54-L57)) expects the FrameworkList.xml file to be located in `$(TargetFrameworkDirectory)/RedistList/FrameworkList.xml`.

Fixes https://github.com/dotnet/runtime/issues/49211
Fixes https://github.com/dotnet/runtime/issues/49940
Fixes https://github.com/dotnet/runtime/issues/49477
Fixes https://github.com/xamarin/xamarin-macios/issues/10912
Fixes https://github.com/xamarin/xamarin-macios/issues/10839
Fixes https://github.com/xamarin/xamarin-macios/issues/10548
Fixes https://github.com/xamarin/xamarin-macios/issues/10592
Fixes https://github.com/mono/mono/issues/20805
Fixes https://github.com/mono/mono/issues/20894
2021-03-24 09:31:15 +01:00
Mauro Agnoletti c9d1760cfc Fixing CoreiOSSdkDirectory definition for legacy project system
The way that CoreiOSSdkDirectory was definded ($(MSBuildThisFileDirectory.Replace('...', '...'))) was returning an encoded string value that caused issues in legacy project systems. The reason of the issues is that the CoreiOSSdkDirectory value for legacy project systems is `Program Files (x86)`, and the "Replace'" function was encoding the '(' and ')' causing the "UsingTask" for fail because the Assembly File path was wrong (because it contains those encoding values).

The fix consist of applying the "Replace" function only when the path of the targets belongs to a .net SDK path, in which case it won't fail because it's under "Program Files".

We need to discuss with the MSBuild team to show this issue and know if it's a bug or how we can avoid the failure
2021-03-18 18:20:24 -03:00
Mauro Agnoletti dcdfe8ebfa Fixed iOS Binding projects build in Windows
iOS Binding projects were not building remotely since 16.9. This commit fixes that and allows to start building remotely.

Xamarin.iOS.ObjCBinding.CSharp.After.props is imported too early and because it was also importing the Messaging targets, some things like RebuildDependsOn and BuildDependsOn were being overridden by other targets, resulting on not hooking up on the remote execution.
2021-03-18 18:20:24 -03:00
Rolf Bjarne Kvinge 1da2d452dd
[msbuild/dotnet] Add support for parsing --setenv from bundler arguments. (#10896)
Add support for parsing --setenv from bundler arguments and passing them to
dotnet-linker so that the environment variables can be baked into the app at
launch (like they would be for mtouch/mmp).
2021-03-18 15:15:02 +01:00
mathieubourgeois a921ee2fb1
Xamarin.Mac native Apple Silicon targetting support (#10115)
* Add support for Xamarin.Mac arm64

* Add compile product definition task

Xamarin.Mac can be provided with a ProductDefinition file for the generated pkg. Normally, providing a product definition was optional. However, with Apple Silicon, we have an extra issue : `productbuild` needs to know what architectures your package target. If not provided with them, it will guess to the best of its abilities. However, on Catalina and lower, the guess is x86_64, even if you have an arm64 slice. To fix this, we add a new task to compile the product definition and use this file to create the pkg. If you provide your own Product Definition, we can check and warn if the architectures don't match what we expect. If the file doesn't exist or there is no architecture, we set it ourselves based on our target architectures.

* Don't reference dynamic objC_send on arm64

When building in debug, we currently try to link dynamic objC_send symbols when targeting a 64-bit architecture. However, this is actually only defined on Intel architectures, not on arm64, so we end up failing because we're referring symbols that don't exist. Rework the `GetRequiredSymbols` to take an abi, and tag those symbols to only be valid on i386/x86_64, so they don't get referred at all when building on arm64, but still get referred in x86_64.

* Fix improper delete/move with already existing directories

* Fix stret requirement for Xamarin.Mac in arm64.

The generator supposes that we're running in x64 mode, refactor to take into account the possibility of running in arm64.

* Implement OS version generation in Product.plist, based on MinimumSystemVersion of the app

* Re-generalize some mmp registrar rules

`Microsoft.macOS.registrar` was missed by the current rule set

* Fix mmp tests

* Set E7072 as not translated

Tests were failing otherwise

* Rename Xamarin.Mac lib/x86_64 folder to 64bits (currently all targeted archs are the same)

* Fix style issues

* Fix `ToLower` usage for invariant usage

* Fix xtro-sharpie test
2021-03-17 21:48:02 -04:00
Rolf Bjarne Kvinge 13e458ebff
[msbuild] Fix logic to copy windows files (#10873)
By creating a directory before trying to copy files into it.
2021-03-16 18:48:44 +01:00
Rolf Bjarne Kvinge 61ef956d2b
[msbuild] Make actool work correctly for Mac Catalyst apps by passing '--ui-framework-family uikit'. Fixes #10804. (#10815)
Also

* Fix the Mac Catalyst sample to use the correct contents.json and images sizes
  for Mac Catalyst app icons.
* Fix the contents.json and image sizes for the Mac Catalyst test project as well.
* Add unit test for Mac Catalyst that ensures that Assets.car is in the final app.

Fixes https://github.com/xamarin/xamarin-macios/issues/10804.
2021-03-10 15:47:16 +01:00
Rolf Bjarne Kvinge 3a96cb02f5
[msbuild] Unify the iOS and macOS version of ACToolTaskBase. (#10810)
* [msbuild] Unify the iOS and macOS version of ACToolTaskBase.

* The ACTool task now needs the target framework moniker.
2021-03-09 17:45:49 +01:00
Rolf Bjarne Kvinge 7bf40f96c0
[msbuild] Unify the CompileImageAssets targets between Xamarin.iOS and Xamarin.Mac. (#10809) 2021-03-09 11:24:38 +01:00
Sebastien Pouliot cd7f7596ba
[msbuild] Fix localization when the error code is shared with mtouch/mmp (#10799)
Code shared between msbuild and mtouch/mmp needs to share the
localization strings, otherwise the exception being thrown is of no help
to solve the issue.

THis happened if a wrong path was given for an `.xcframework` and
`FileCopier` reported an `MT1022` error.

Reference (not a fix for) https://github.com/xamarin/xamarin-macios/issues/10774
2021-03-08 09:04:57 -05:00
Rolf Bjarne Kvinge 23bdf61230
[tests] Add unit tests for building Mac Catalyst for ARM64. (#10768)
* [dotnet] Use the expected case for ARM64.

We use case-sensitive comparisons somewhere else, so make sure to use the same casing
for the architecture as other platforms do.

* [tests] Add tests to verify that Mac Catalyst builds successfully for ARM64.

* [msbuild] Fix platform name in condition.

* [msbuild] Pass -isysroot when building Mac Catalyst apps as well.

Ohterwise clang will use the SDK from the command line tools, which may have
nothing to do with the SDK we want to build with.
2021-03-04 17:44:55 +01:00
Rolf Bjarne Kvinge 100e2ec832
[msbuild] Don't compute the platform for Mac Catalyst. (#10754)
This way we don't end up forcing Mac Catalyst apps to be signed (because if
the computed platform is 'iPhone', we enforce signing).
2021-03-03 07:44:26 +01:00
Emanuel Fernandez Dell'Oca 834b088885
[dotnet] Fixes -t:Run and illink.dll path for Windows (#10744)
* [dotnet] Adds support for dotnet build -t:Run from Windows

What was essentially needed was to execute the command remotely, using the right mlaunch path on the Mac

* [dotnet] Fixes illink.dll location when building from Windows

The property `_ILLinkTasksDirectoryRoot` does not exist anymore so we need to get the path in a different way. Essentially it is located in the same directory as the ILLink Task, so we can get it from `ILLinkTasksAssembly`.
2021-03-03 07:43:34 +01:00
Emanuel Fernandez Dell'Oca ecccb8954e
[dotnet] Revert changes that separate Messaging from Xamarin.iOS.Tasks to fix dotnet build (#10738)
This reverts commit 9a27951a99.

The purpose of the original commit was to take out 4 tasks that were only executed from Windows to the Windows specific pack (and enabling more tasks that need to be executed remotely on that pack).

To execute tasks remotely the build will initially run `SayHello` which connects to the Mac and shares the connection with all the tasks through IBuildEngine4[1]. When that connection object is retrieved on the tasks we need to cast it as a Messaging connection type, and this works from Visual Studio and msbuild because there's just one messaging assembly loaded.

But it doesn't work on dotnet/msbuild, because there's a feature called ALC (AssemblyLoadContext) which will load each assembly task into it's own context[2], loading all its dependencies in that context. In this scenario sharing custom objects between tasks won't work because the original object type could be from a different context than the one retrieving it. This is described here: https://github.com/dotnet/msbuild/issues/5084.

[1] https://docs.microsoft.com/en-us/dotnet/api/microsoft.build.framework.ibuildengine4?view=msbuild-16-netcore
[2] https://github.com/dotnet/msbuild/blob/master/documentation/specs/task-isolation-and-dependencies.md
2021-03-01 08:05:01 +01:00
Emanuel Fernandez Dell'Oca 26c969c406
[dotnet] Fixes builds for iOS physical devices from Windows (#10707)
* [dotnet] Fixes builds for iOS physical devices from Windows

- We need to create output files for the AOTCompile task on Windows and copy the AOT Compiler to the Mac since it is part of a NuGet package that will not exist on the Mac
- The EmbedProvisionProfile task needs to be run remotely so the embedded.mobileprovision file is included in the app bundle
- When copying input files to the Mac for LinkNativeCode we should skip files that already exist on the Mac because those on Windows are empty. If we copy those we are essentially replacing the real files by the empty ones from Windows.

* Bumps Xamarin.Messaging

* Fixes spacing on LinkNativeCode
2021-02-24 08:08:14 +01:00
Emanuel Fernandez Dell'Oca 130451f240
[dotnet] Fixes Xamarin.Messaging HintPath (#10710)
Changes the HintPath to the Messaging assembly to use OutputPath instead, otherwise the build fails when that property is different than `bin\$(Configuration)\netstandard2.0`
2021-02-24 07:33:00 +01:00
Emanuel Fernandez Dell'Oca 9a27951a99
[dotnet] Moves tasks to the Windows project (#10675)
* [dotnet] Stops merging Messaging into Xamarin.iOS.Tasks

- Creates a separate Xamarin.Messaging project that will produce a single assembly after merging all the Xamarin Messaging dependencies.
- Stops merging Messaging into Xamarin.iOS.Tasks to be able to reference it from the Windows specific pack.
- Refactors the ILMerge.targets to reuse common code from ILMerge.Messaging.targets.

* [dotnet] Moves Windows specific tasks to the Windows tasks project

* [dotnet] Adds Xamarin.Messaging.dll to the different packages

* [msbuild] Add logic to build & install Xamarin.Messaging.dll.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-02-23 18:55:10 +01:00
Rolf Bjarne Kvinge 85fe6340f6
Bump .NET to 6.0.100-preview.2.21114.3. (#10666)
* Bump .NET to 6.0.100-preview.2.21114.3.

* [dotnet-linker] Several steps are now gone, so load our custom step before the new first step (MarkStep).

* [dotnet-linker] Dump the current steps if we fail to call InsertBefore/InsertAfter.

* [dotnet-linker] Load the CollectAssembliesStep as the first step, and make it load every assembly.

* [dotnet] Set InvariantGlobalization=true because that's the only thing .NET supports for now.

* [dotnet-linker] Use recommended workaround for linker's inability to do load assemblies in custom step.

* [tests] Bump version of MSBuild.StructuredLogger to get support for new log version.

Otherwise this happens in tests that read binary logs:

    System.NotSupportedException : Unsupported log file format. Latest supported version is 9, the log file has version 10.

* [introspection] Ignore P/Invokes to QCall for LogThreadPool* P/Invokes.

* [dotnet-linker] Inject a dummy implementation of mono_config_parse_memory as a temporary solution for mono's removal of the same method.
2021-02-23 07:49:09 +01:00
Rolf Bjarne Kvinge 599e464b72
[msbuild] Add Mac Catalyst support to the CompileNativeCode and LinkNativeCode tasks. (#10662)
Mac Catalyst is a special case, and needs some special casing.
2021-02-18 17:32:17 +01:00
Rolf Bjarne Kvinge 7c6c8e02e3
[msbuild] Use the macOS SDK to build Mac Catalyst apps instead of the iOS SDK (#10644)
* Bump Xamarin.MacDev.

New commits in xamarin/Xamarin.MacDev:

* xamarin/Xamarin.MacDev@1e738e9 [Xamarin.MacDev] Extract the code to convert between Mac Catalyst versions to a separate file. (#89)
* xamarin/Xamarin.MacDev@a3bb12c [Xamarin.MacDev] Add methods to map between iOS and macOS versions for Mac Catalyst. (#88)

Diff: 02d6d05be3..1e738e9f7f

* [msbuild] Use the macOS SDK to build Mac Catalyst apps instead of the iOS SDK

From a native compilation perspective, compilating a Mac Catalyst is the macOS SDK
+ a dash of iOS, so use the native macOS SDK to compile, and then do the corresponding
adjustments elsewhere.

At the same time document which version we want for the sdk version and the deployment
target in mtouch, and adjust the code accordingly (sdk version: macOS version; deployment
target: iOS version).

* Update resource files

* Add new entry to canary test for string localization.
2021-02-17 17:25:36 +01:00
Rolf Bjarne Kvinge 9f18c53e28
[msbuild] Use '_PlatformName' == 'MacCatalyst' instead of '_IsMacCatalyst'. (#10636)
In .NET Mac Catalyst will be a platform on the same level as iOS or tvOS, so
reflect this in the build logic by setting _PlatformName to 'MacCatalyst'.
This makes the build logic a lot simpler for .NET.
2021-02-12 21:49:49 +01:00
Rolf Bjarne Kvinge f8f3bcd469
[msbuild] Add MSBuild files to the Mac Catalyst SDK pack (#10635) 2021-02-12 21:48:27 +01:00