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

1475 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 81ac597acd [msbuild] Fix support for decompressing everything in a zip file 2023-04-20 18:21:17 +02:00
Rolf Bjarne Kvinge a4af76fda6 [msbuild] Add a bit more logging to the decompression code 2023-04-20 18:21:17 +02:00
Rolf Bjarne Kvinge d9e9e2e50b [msbuild] Make sure the decompression code works on Windows 2023-04-20 18:21:17 +02:00
Rolf Bjarne Kvinge cb81e00b5b [msbuild] Remove the UnpackFrameworks task, it's no longer used. 2023-04-20 18:21:17 +02:00
Rolf Bjarne Kvinge 9b2e5e84c6 [msbuild] Remove the CollectDynamicFrameworks task, it's no longer used. 2023-04-20 18:21:17 +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 859ee515e7
[msbuild] Rename a few HotRestart tasks. (#18077)
* Codesign -> CodesignHotRestartApp
* CompileAppManifest -> CompileHotRestartAppManifest.
* DetectSigningIdentity -> DetectHotRestartSigningIdentity

This makes it less confusing with regards to the other tasks with the
same names.

It also makes searching and understanding binlogs easier.
2023-04-18 08:04:11 +02:00
Rolf Bjarne Kvinge 0f648fbd77
[msbuild] Merge the GetMlaunchArguments and GetMlaunchArgumentsTaskBase classes. (#18071)
We no longer need two have overridable logic for remote builds, so the
non-abstract task class and the abstract base class can be merged.

Also enable nullability and fix any issues.
2023-04-18 07:59:15 +02:00
Rolf Bjarne Kvinge ecea1a431c
[msbuild] Remove the SdkVersion property in the ReadAppManifest task. (#18053)
The ReadAppManifest task doesn't need the SdkVersion, because it's only used to compute
the path to the sdk on disk, and that path can be calculated without an sdk version
now:

    $ ls -la /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
    total 0
    drwxrwxr-x  4 rolf  staff  128 Dec 14 10:58 .
    drwxr-xr-x  5 rolf  staff  160 Nov 11 01:38 ..
    drwxrwxr-x  8 rolf  staff  256 Dec 14 10:48 iPhoneOS.sdk
    lrwxr-xr-x  1 rolf  staff   12 Dec 14 10:56 iPhoneOS16.2.sdk -> iPhoneOS.sdk

In fact, the path with the version just symlinks to the path without.
2023-04-17 07:57:42 +02:00
Rolf Bjarne Kvinge cc3005a05c
[msbuild] Remove unused input/output from HotRestart's DetectSigningIdentity task (#18055) 2023-04-17 07:51:10 +02:00
Rolf Bjarne Kvinge e93c75c2e5
[msbuild] Simplify the CompileAppManifest a bit by removing the SdkPlatform input property. (#18054)
We don't need the SdkPlatform input, because we can compute it from
other input properties.
2023-04-17 07:50:35 +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 d35a8f42ed
[msbuild] Merge the FindWatchOS2AppBundle and FindWatchOS2AppBundleTaskBase classes. (#18038)
We no longer need two have overridable logic for remote builds, so the
non-abstract task class and the abstract base class can be merged.

Also enable nullability and fix any issues.
2023-04-13 16:31:19 +02:00
Stefani Moore ddd51e88c8
Update MessagingVersion in Directory.Build.props 2023-04-11 15:49:33 -07:00
Rolf Bjarne Kvinge f853788a06
[msbuild] Allow setting EnableCodeSigning=false to disable code signing for Hot Restart. (#18013)
This makes writing tests easier, because we won't need a functioning code signing
setup in order to verify other parts of a build.
2023-04-11 20:22:09 +02:00
Rolf Bjarne Kvinge 5a3248d57e
[msbuild] Honor any existing values for HotRestartSignedAppOutputDir and HotRestartAppBundlePath. (#18014)
This makes it easier to write tests that verify the files written in this paths,
because the tests can specify these output directories instead of evaluating a project
file or duplicating the logic to compute them.

Additionally, the tests can also easily make sure the output is cleaned up once the test is done.
2023-04-11 20:21:38 +02:00
Rolf Bjarne Kvinge c3517609ac
[msbuild] Merge the CreateAssetPack and CreateAssetPackTaskBase classes. (#17948)
We no longer need two have overridable logic for remote builds, so the
non-abstract task class and the abstract base class can be merged.

Also enable nullability and fix any issues.
2023-04-10 17:26:24 +02:00
Rolf Bjarne Kvinge 8c9ee8289f
[msbuild/dotnet] Rework how we collect and process native references. (#17554)
Previously, we'd do this:

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

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

So rework the process to:

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

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

Additionally:

* Add support for unzipping on Windows by using System.IO.Compression.
* Show an error if attempting to extract a symlink in the last step in the
  reworked process on Windows.
* Some tests had to be updated (since they poked into internals of the
  ResolveNativeReferences task, and those internals have changed).
2023-04-10 11:27:41 +02:00
Emanuel Fernandez Dell'Oca e0274c918d
Update Messaging and Hot Restart versions (#17992) 2023-04-08 07:29:10 -04:00
Mauro Agnoletti 11986082cc
Fixed remote and local build issues (#17964)
- Updated Xamarin.Messaging to 1.9.99 to fix a connection problem in
remote builds because of an invalid reference to
System.Security.Cryptography.ProtectedData
- Generate Hot Restart specific build session id to fix an issue in
local builds that was conflicting with remote builds

---------

Co-authored-by: Emanuel Fernandez <emafern@microsoft.com>
2023-04-03 19:46:31 -04:00
Rolf Bjarne Kvinge 62ee7a4426
[msbuild] Move *.targets, *.props and FrameworkList.xml files to a common directory. (#17860)
This unifies the code/logic between iOS and macOS a bit more.
2023-03-30 18:25:14 +02:00
Rolf Bjarne Kvinge 335f8c9d90
[dotnet/msbuild] Don't bundle *.xml files that match any assemblies. Fixes #14939 and fixes #15897. (#17908)
This fixes a warning when documentation is enabled for a project:

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

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

Fixes https://github.com/xamarin/xamarin-macios/issues/14939.
Fixes https://github.com/xamarin/xamarin-macios/issues/15897.
2023-03-30 07:24:00 +02:00
Mauro Agnoletti 88987d154c
Updated Xamarin.Messaging to 1.9.94 (#17925)
Should fix an issue in remote builds where if the connection gets
disconnected unexpectedly, the build might end up failing because the
main session id is changed and also the reconnection fails.

More details: https://github.com/xamarin/Xamarin.Messaging/pull/587
2023-03-29 23:52:30 -04:00
Rolf Bjarne Kvinge cb9fc5021a
[msbuild] Merge the CollectITunesSourceFiles and CollectITunesSourceFilesTaskBase classes. (#17912)
We no longer need two have overridable logic for remote builds, so the
non-abstract task class and the abstract base class can be merged.

Also enable nullability and fix any issues.
2023-03-29 10:34:10 +02:00
Rolf Bjarne Kvinge e148c3e3d6
[msbuild] Merge the CompileITunesMetadata and CompileITunesMetadataTaskBase classes. (#17913)
We no longer need two have overridable logic for remote builds, so the
non-abstract task class and the abstract base class can be merged.

Also enable nullability and fix any issues.
2023-03-29 10:33:54 +02:00
Rolf Bjarne Kvinge c3292c32df
[msbuild] Merge the CollectITunesArtwork and CollectITunesArtworkTaskBase classes. (#17859)
We no longer need two have overridable logic for remote builds, so the
non-abstract task class and the abstract base class can be merged.
2023-03-23 08:34:40 +01:00
Rolf Bjarne Kvinge 7ef4153bd2
[msbuild] Always pass --wait-for-exit:<value> to mlaunch. (#17865)
Because depending on other options the default can be either 'true' or
'false', and this way we always ask mlaunch to do the right thing.

Also ensure any additional arguments are added last, so they can
override any other argument.
2023-03-23 08:34:13 +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
Rolf Bjarne Kvinge 74c4fe7e25
[msbuild] Enable nullability and unify base and derived class for the GetFiles task. (#17814) 2023-03-21 18:22:12 +01:00
Rolf Bjarne Kvinge bfd87e4bb2
[msbuild] Verify Mac Catalyst apps like we verify macOS apps. Fixes #17829. (#17835)
* For Mac Catalyst apps we must verify the code signature like we do it for macOS apps. Fixes #17829.
* Enable nullability and fix code accordingly.
* Merge the CodesignVerify and CodesignVerifyTaskBase classes to simplify the code.

Submission test is added as well:

* https://github.com/xamarin/maccore/pull/2656
* https://github.com/xamarin/SubmissionSamples/pull/51

Fixes https://github.com/xamarin/xamarin-macios/issues/17829.
2023-03-21 18:20:05 +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 e047abe88e
[msbuild] Don't use an item transform that doesn't use any items in the transform. (#17719) 2023-03-07 16:25:01 +01:00
Rolf Bjarne Kvinge d6c1121f8f
[msbuild] Extract the PublishFolderType enum into its own file. (#17715) 2023-03-07 16:24:40 +01:00
Rolf Bjarne Kvinge 746368d39a
[msbuild] Set the '_SdkIsSimulator' property for HotRestart builds. (#17714)
This makes it easier to consume other tasks in the future that already takes
'_SdkIsSimulator'. It also documents exactly why we hardcode
_SdkIsSimulator=false for Hot Restart.
2023-03-07 16:24:28 +01:00
Mauro Agnoletti 9f3b77eb71
[main] Added Merq and Merq.Core to ILMerge since they're now required and loaded by Messaging (#17683) 2023-03-03 14:57: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 b0c94b48a6
[msbuild] Merge the CollectAssetPack and CollectAssetPacksTaskBase classes. (#17552)
We no longer need two have overridable logic for remote builds, so the
non-abstract task class and the abstract base class can be merged.
2023-02-22 19:09:53 +01:00
Mauro Agnoletti d978d9c404
Updated Xamarin.Messaging to 1.9.40 (#17580)
Applies the following changes from Xamarin.Messaging:

xamarin/Xamarin.Messaging#543

xamarin/Xamarin.Messaging#541

It includes fixes for SSH keys handling, UX improvements when SSH is disabled on the Mac and also when the user is not logged in on the Mac
2023-02-22 10:37:48 +01:00
Rolf Bjarne Kvinge 8e4f22d20e
[msbuild] Add DT* entries to the Info.plist for all platforms. Fixes #13300. (#17499)
Modify the code to add Xcode (DT*) variables to the Info.plist:

* Do it for all platforms, not only mobile platforms. Apple uses these fields to
  determine if an app was built with a prerelease or old version of Xcode, and will
  reject any app submissions if this validation fails.

* Change the behavior to do not distinguish simulator builds, a bit of testing
  in Xcode shows that Xcode always adds these values to the Info.plist, even for
  simulator builds. This is probably something that changed in Xcode a *long* time
  ago, since this code is old (from the initial import of the build logic from MonoDevelop
  around 10 years ago).

* Also bump Xamarin.MacDev to get a related fix:

  New commits in xamarin/Xamarin.MacDev:

  * xamarin/Xamarin.MacDev@74c95ee [Xamarin.MacDev] Always fetch the DTSDKBuild variable.

  Diff: 14d53612d4..74c95ee1c3

Fixes https://github.com/xamarin/xamarin-macios/issues/13300.
2023-02-10 22:58:38 +01:00
Emanuel Fernandez Dell'Oca 33512be08d
Update Xamarin.Messaging to 1.9.17 (#17501)
Co-authored-by: Mauro Agnoletti <mauro.agnoletti@gmail.com>
2023-02-10 22:40:08 +01:00
Mauro Agnoletti 8b0763b568
[win] Add Hot Restart define constant in a target instead of an evaluation property (#17470)
This is needed in order to read the correct value of the
"IsHotRestartBuild" property set by the VS extension. Doing it in a
PropertyGroup at evaluation was not getting the correct value since it
was not being set as an MSBuild global property

This PR is related to this other one in the XVS extension:
https://github.com/xamarin/XamarinVS/pull/13612
2023-02-08 09:47:24 +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 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
Mauro Agnoletti 2a79c3dc1b
Updated Xamarin.Messaging to 1.9.5 (#17363)
This should bring the fix to correctly build iOS applications with references to class libraries

Ref: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1684986
2023-01-25 15:37:00 +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 05b92d5cf0
[msbuild] Fix typo in comment. (#17220) 2023-01-13 21:58:57 +01:00
Rolf Bjarne Kvinge 48f9d5c5ea
[msbuild] Add an SdkDevPath property to the DSymUtil task. (#17108)
Add an SdkDevPath property to the DSymUtil task, and use it to set DEVELOPER_DIR when calling dsymutil.

Should fix this:

> xcrun: error: unable to find utility "dsymutil", not a developer tool or in PATH

when `xcode-select -p` and VSMac are configured with two different Xcodes.
2023-01-12 07:09:57 +01:00
Rolf Bjarne Kvinge ed4d07a6c3
[msbuild] Merge the Mmp and MmpTaskBase classes. (#17098)
We no longer need two have overridable logic for remote builds, so the
non-abstract task class and the abstract base class can be merged.

First out is the Mmp task.
2023-01-12 07:09:42 +01:00
Rolf Bjarne Kvinge 10b1907b22
[msbuild] Fix a compile warning about file being added twice. (#17097)
Fixes:

> CSC : warning CS2002: Source file 'xamarin-macios/msbuild/Xamarin.MacDev.Tasks/Errors.designer.cs' specified multiple times
2023-01-12 07:09:17 +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
Mauro Agnoletti 009f62ea9f
Updated MessagingVersion to 1.9.0 (#17163) 2023-01-10 08:36:36 +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 9bf322525e
Bump Xamarin.MacDev. (#17056)
This requires a few nullability updates in our code as well.

New commits in xamarin/Xamarin.MacDev:

* xamarin/Xamarin.MacDev@14d5361 Enable nullability in PListObject.cs

Diff: ac2647b643..14d53612d4
2022-12-16 07:22:37 +01:00
VS MobileTools Engineering Service 2 811cc469f3
[main] Fix WatchKit stub copy error when using native watchOS app (#17048)
Modified the FindWatchOS2AppBundleTaskBase and Xamarin.iOS.Common.targets so that it only tries to copy the WatchKit stub into the IPA file if the watch app bundle includes the folder.

This should fix the error that was found in #10070 by @ivanicin 

Backport of #17004

Co-authored-by: Jack Butler <jbutler@glneurotech.com>
Co-authored-by: Jack Aardal <jaardal@glneurotech.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-12-15 11:08:49 +01:00
Rolf Bjarne Kvinge 294314a518
[autoformat] Add the rest of the repository. (#16974) 2022-12-07 09:13:36 +01:00
Dean Ellis 669070c6ad
[perf] Update Delete Task to use DeleteFilesAsync. (#16929) 2022-12-07 07:57:39 +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
Rolf Bjarne Kvinge 59910e6147
[msbuild] Fix nullability issue. (#16897)
Return early after a failure, in order to fix a nullability problem where the
out variable from a method call can be null if the function returns false - in
which case we can't keep doing things, we need to return, because the
subsequent code doesn't handle the potential null value from the out
parameter.
2022-12-01 16:47:47 +01:00
Rolf Bjarne Kvinge cbfcabacf6
[msbuild] Fix parsing -gcc_flags when the value is the next argument. Fixes #16861. (#16862)
The -gcc_flags in the extra mtouch/mmp arguments can either be of the format
'-gcc_flags=<value>' or '-gcc_flags <value>'. Previously we only parsed the
former correctly, and now fix the parsing logic to handle the latter version
correctly as well.

Fixes https://github.com/xamarin/xamarin-macios/issues/16861.
2022-11-29 09:29:27 +01:00
Mauro Agnoletti fddd44b4f7
Updated Xamarin.Messaging to 1.8.49 (#16899)
We need this for 17.5 Preview 2 so feel free to backport it to the needed branches
2022-11-29 07:51:32 +01:00
Tim Miller 97ec7c12c8
Add Accent Color to ACTool task (#16844)
This PR addresses https://github.com/xamarin/xamarin-macios/issues/10275

`actool` can set an application's "Global" color set, overwriting the system defaults. XCode sets this as "AccentColor," but when we call it directly, we don't pass in anything. This means a user cannot overwrite this setting themselves unless they rewrite the ACTool task.

This PR adds support for the "AccentColor" property to set the accent color.

To use this:

- Create a new Asset Catalog or use the default.
- Add a new ColorSet.
- Set the "AccentColor" property in the project file:

    <PropertyGroup>
        <AccentColor>AccentColor</AccentColor>
    </PropertyGroup>

You should now see the colors reflected in the application.
2022-11-23 17:15:04 +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
Dean Ellis 3e4aa12a54
Do not copy files to build server for a Delete. (#16752)
The `Delete` task should not need to copy any files to the remote server.
Lets try to set this up by implementing the `ShouldCopyToBuildServer` method.

This should help reduce build times if it works.
2022-11-17 17:31:11 +01:00
Dean Ellis 30405fd9b5
[msbuild] Don't process assemblies over and over again in the UnpackLibraryResources target. Fixes #16377. (#16416)
Fixes #16377 

MSbuild has the ability to run `Target` partially. However in order to make sure we can use this, both the `Inputs` and `Outputs` need to have a 1-1 mapping. MSBuild will then use this mapping to figure out which files have actually changed.
Then it will call the Target with only those files. 

In Xamarin.Android we make use of stamp files to provide this 1-1 mapping. We have a `pre` Target which will calculate an ItemGroup which will include a StampFile piece of metadata. We then use this new ItemGroup for both the `Inputs` and `Outputs`, thus meeting the 1-1 requirement. 

This PR updates the `_UnpackLibraryResources` to run partially. This will hopefully reduce the build time on incremental builds.
2022-11-17 17:30:46 +01:00
VS MobileTools Engineering Service 2 d6f9aa7c08
[main] Fix native watchOS app bundling when using newer Xcode 14 watchOS project. Fixes #16142. (#16773)
I've made some small edits to the ValidateWatchApp method to allow for a native watchOS app that was created in Xcode 14 that uses a single project instead of an extension to be bundled into a Xamarin app. 

Should fix #16142 and progress on #10070

Backport of #16690

Co-authored-by: Jack Butler <jbutler@glneurotech.com>
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2022-11-17 08:00:27 +01:00
Rolf Bjarne Kvinge a02e840007
[msbuild] Show an error when trying to build a binding project from Windows without a Mac connection. (#16612)
Building a binding project from Windows without a Mac connection doesn't work,
because we need to execute bgen. Currently we just skip every task and target
that doesn't work from Windows, but that means nothing at all happens, which
is confusing (in particular if the binding project is referenced by other
projects, which will also fail to build).

So make it more explicit that a connection to a Mac is required to build a
binding project by showing a warning when there's no connection (and not an
error because that could break existing workflows for customers).

Ref: https://github.com/xamarin/xamarin-macios/issues/16611
2022-11-09 07:52:58 +01:00
Rolf Bjarne Kvinge 60bd7393b3 Revert "[net7.0-xcode14.1] [release/7.0.1xx-xcode14][msbuild] Partial revert of ad8cdb3 (#16428)"
The original change that caused a problem is not a problem anymore (it was
fixed in 18e2bef479), so re-introduce the
original change.

This reverts commit fb75cf80d2.
2022-11-03 21:27:27 +01:00
Rolf Bjarne Kvinge cdc62aeae9 Merge remote-tracking branch 'origin/net7.0-xcode14.1' into main-net7.0-xcode14.1 2022-11-03 08:21:55 +01:00
Rolf Bjarne Kvinge 940e1d09e9 Merge xcode14.1 into net7.0-xcode14.1. 2022-11-02 19:03:30 +01:00
Rolf Bjarne Kvinge 0304f2bca1
[msbuild] Fix watchOS submissions with Xcode 14. Fixes #16499. (#16526)
We have to remove any arm64e slices from the WK binary we copy from Apple's
SDK into the Watch app, as explained in Apple's forums.

Ref: https://developer.apple.com/forums/thread/714224
Fixes https://github.com/xamarin/xamarin-macios/issues/16120.
Fixes https://github.com/xamarin/xamarin-macios/issues/16499.
2022-11-02 18:59:04 +01:00
VS MobileTools Engineering Service 2 aa7faff2ac
[net7.0-xcode14.1] [7.0.1xx-xcode14] [msbuild] Remove generated file from source control. (#16477)
This fixes an issue where this file would show up as modified after the
build, which breaks our API comparison.


Backport of #16476

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-10-26 21:39:56 +02:00
VS MobileTools Engineering Service 2 8d3571b23e
[xcode14.1] Updated Xamarin.Messaging to 1.8.26 (#16472)
Brings an important fix for the Build Session Id generation


Backport of #16464

Co-authored-by: Mauro Agnoletti <mauro.agnoletti@gmail.com>
2022-10-26 12:35:55 +02:00
VS MobileTools Engineering Service 2 236c8a3eb5
[net7.0-xcode14.1] Updated Xamarin.Messaging to 1.8.26 (#16473)
Brings an important fix for the Build Session Id generation


Backport of #16464

Co-authored-by: Mauro Agnoletti <mauro.agnoletti@gmail.com>
2022-10-26 12:33:48 +02:00
Mauro Agnoletti 4dd0eef23f
Updated Xamarin.Messaging to 1.8.26 (#16464)
Brings an important fix for the Build Session Id generation
2022-10-26 08:08:43 +02:00
Rolf Bjarne Kvinge 18e2bef479
[msbuild] Fix creating Build.zip. (#16445)
We recently switched from building the msbuild tasks with 'msbuild' to use
'dotnet build' instead.

One difference between the two methods is that 'dotnet build' doesn't copy
referenced assemblies to the output path.

This turns out to be a problem because we zip up the output from the
Xamarin.Messaging.Build project, and expect it to contain everything required
to load the Xamarin.Messaging.Build assembly (this zip file is shipped with
our VS (Windows) support, and during remote execution copied to the connected
mac and then the build from Windows will load the assembly on the Mac in order
to do stuff on the Mac).

Another problem is that we include MSBuild assemblies from the
'$(MSBuildBinPath)' location, which is now different (we used to pick up
Mono's MSBuild assemblies, and that changed when we started building with
.NET).

In other words: because the Build.zip file stopped containing all the required
files to load Xamarin.Messaging.Build.dll, remote builds from VS stopped
working.

Ref: https://github.com/xamarin/xamarin-macios/pull/16418

Here we attempt to fix this by:

* Setting 'CopyLocalLockFileAssemblies=true'. This will copy referenced
  assemblies to the output directory.
* Explicitly referencing Mono's MSBuild assemblies instead of relying upon
  finding them in '$(MSBuildBinPath)'. At this point I believe it's fine to
  hardcode Mono's path, since it's unlikely we'll get any new Mono updates.
2022-10-25 22:29:08 +02:00
Rolf Bjarne Kvinge 83c8278d76
[xcode14.1] Updated Xamarin.Messaging to 1.8.25 (#16427)
Also adapted Build Agent and MSBuild Tasks to the new Messaging changes

This brings important changes in Xamarin.Messaging to fix an SSH incompatibility with macOS Ventura and also to fix some issues with the iOS remote build with multi targeting dotnet scenarios and also scenarios mixing dotnet and traditional Xamarin projects in the same VS session


Backport of #16419

Co-authored-by: Mauro Agnoletti <mauro.agnoletti@gmail.com>
2022-10-25 08:59:59 +02:00
VS MobileTools Engineering Service 2 36394065a3
[net7.0-xcode14.1] Updated Xamarin.Messaging to 1.8.25 (#16426)
Also adapted Build Agent and MSBuild Tasks to the new Messaging changes

This brings important changes in Xamarin.Messaging to fix an SSH incompatibility with macOS Ventura and also to fix some issues with the iOS remote build with multi targeting dotnet scenarios and also scenarios mixing dotnet and traditional Xamarin projects in the same VS session


Backport of #16419

Co-authored-by: Mauro Agnoletti <mauro.agnoletti@gmail.com>
2022-10-25 08:17:35 +02:00
VS MobileTools Engineering Service 2 fb75cf80d2
[net7.0-xcode14.1] [release/7.0.1xx-xcode14][msbuild] Partial revert of ad8cdb3 (#16428)
Ema pinpointed this commit to bee the root causing reflection issues on the windows side

https://gist.github.com/Redth/e60fcf1b790eb9efe3e476788bff5693#file-remotesimoutput-log-L13-L26


Backport of #16418

Co-authored-by: Alex Soto <alex@alexsoto.me>
2022-10-25 08:16:43 +02:00
Mauro Agnoletti f317b7421e
Updated Xamarin.Messaging to 1.8.25 (#16419)
Also adapted Build Agent and MSBuild Tasks to the new Messaging changes

This brings important changes in Xamarin.Messaging to fix an SSH incompatibility with macOS Ventura and also to fix some issues with the iOS remote build with multi targeting dotnet scenarios and also scenarios mixing dotnet and traditional Xamarin projects in the same VS session
2022-10-25 07:50:11 +02:00
Rolf Bjarne Kvinge 73101f2689
[msbuild] Fix dirty working copy with Errors.designer.cs. (#16404)
The Xamarin.MacDev.Tasks.sln solution is built with dotnet, while other projects
are still built with msbuild. This becomes a problem when generating Errors.designer.cs,
because depending on the runtime the output is different.

This means that the Errors.designer.cs will sometimes randomly change (depending
on which project re-generated the file), leaving the file modified in git. This is
quite annoying, but it also breaks the api comparison, which depends on the build
not leaving modified files behind. So for now, we generate Errors.designer.cs separately
for Xamarin.MacDev.Tasks.sln to not conflict with the mtouch version.

Also fix capitalization in numerous places to be consistent (it's Errors.designer.cs,
not Errors.Designer.cs).
2022-10-24 18:56:06 +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 ad8cdb3f91
[msbuild] Build the solution with .NET. (#16304)
Hopefully this fixes some of the recurrent build problems where we'd fail to
restore nuget packages.

Ref: https://github.com/xamarin/maccore/issues/2620

I wasn't able to execute ilrepack.exe with .NET, so that continues to be
executed with mono.
2022-10-17 07:22:24 +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 7336100b9a
[msbuild] Only sign the app bundle if codesigning is enabled. Fixes #16197. (#16266)
Only sign the app bundle if codesigning is enabled.

This fixes a bug where we'd still try to sign an app bundle, even if the user
disabled code signing by setting EnableCodeSigning=false, if the default logic
was to sign the app bundle.

Fixes https://github.com/xamarin/xamarin-macios/issues/16197.
2022-10-10 15:33:20 +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
Mauro Agnoletti cc8c336a2e
[illink] Ensure we replace the dotnet SDK path in the _ExtraTrimmerArgs for remote builds (#16294)
From net7, the original ILLInk targets are adding a new link attribute pointing to a supressions file inside the ILLink tasks folder, e.g: '--link-attributes "C:\Program Files\dotnet\sdk\7.0.100-rc.2.22477.23\Sdks\Microsoft.NET.ILLink.Tasks\build\6.0_suppressions.xml"'.

For remote builds, we need to replace the original dotnet folder with the XMA dotnet folder in the Mac, so in our override targets we replace this value before passing it to the ILLink task
2022-10-08 22:40:21 +02:00
Mauro Agnoletti 448ffa9754
Updated Xamarin.Messaging to 1.8.6 (#16281) 2022-10-07 17:15:26 +02:00
Mauro Agnoletti 6bc66bf2ee
Ensure we restore the temp csproj to compute AOT compiler path (#16280)
The build command doesn't support a parameter to specify a NuGet.config, so we need to restore the temp project first, so we pass the NuGet.config file to use the sources from, in case it exists (e.g: the NuGet.config from the XMA dotnet path).

This is useful to support auhtorized NuGet feeds

Fixes Bug #1611102 - [XVS][MAUI] Failed to build .NET MAUI (net6.0) with iOS Simulator: https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1611102

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2022-10-07 08:16:01 +02:00
Rolf Bjarne Kvinge fb97063227 Merge main into net7.0. 2022-10-06 14:01:27 +02:00
Rolf Bjarne Kvinge 45b97d838e Merge main into xcode14.1. 2022-10-06 13:59:29 +02:00
Rolf Bjarne Kvinge 96d7b958b6
[msbuild] Fix processing static libraries in binding sidecars. (#16227)
Fixes an issue where we'd end up trying to link with the managed assembly instead:

> ld: warning: ignoring file .../bin/Debug/net6.0-ios/MyBinding.dll, building for iOS Simulator-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x4D 0x5A 0x90 0x00 0x03 0x00 0x00 0x00 0x04 0x00 0x00 0x00 0xFF 0xFF 0x00 0x00 )

Also add a warning if we run into other types of libraries in the future to
make it easier to diagnose.
2022-10-05 08:40:20 +02:00
Rolf Bjarne Kvinge c7badeacf1 Merge main into xcode14.1. 2022-10-04 16:21:54 +02:00
Rolf Bjarne Kvinge 8b247307ab Merge main into net7.0. 2022-09-30 14:02:34 +02:00