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

13557 Коммитов

Автор SHA1 Сообщение Дата
Manuel de la Pena 04ca9aa067
[CI] Perform a git rest to make sure that the API diff does not fail.
In case the build changes files (it should not, but we make mistakes) we call a git reset before we try to calculate the api diff.
2022-04-26 20:40:35 -04:00
TJ Lambert 7f1c1a3432
[FabricBot] Fix 'Write' & 'Admin' permission issue (#14829)
* Update FabricBot with more useful commands

* Remove the 'awaiting-customer-response' label and corresponding tasks

* Ignore people with admin permissions

Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2022-04-26 11:35:03 -05:00
Rolf Bjarne Kvinge 9e3938784f
Stop branding main as a release branch for .NET. (#14822)
Also bump our version band to try to avoid confusion.
2022-04-26 17:12:38 +02:00
TJ Lambert 7a0fc9f6f1
[fabricbot] Update FabricBot with more useful commands (#14749)
* Update FabricBot with more useful commands

* Remove the 'awaiting-customer-response' label and corresponding tasks

Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2022-04-26 09:52:45 -05:00
TJ Lambert bd4501ac88
[naturallanguage] Add nullability to (generated and manual) bindings (#14741)
* adding nullability changes

* throwing better exceptions

* using is null

* address Rolf and Manuel nullability changes

Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2022-04-26 09:50:51 -05:00
TJ Lambert 46a8971fa4
[Localization] Update the Lcl paths (#14811)
* Get the lcl paths

* Test the string split for null and use Join-Path

Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2022-04-26 09:46:30 -05:00
Rolf Bjarne Kvinge d800a463b1
[devops] Fix build. (#14824) 2022-04-26 16:33:32 +02:00
Rolf Bjarne Kvinge 50283a8b97
[static registrar] Fix lookup of block proxy attributes. (#14820)
Fix lookup of block proxy attributes to look in protocols declared on base classes.

Broken pseudo code:

    class BaseApplicationDelegate : NSObject, IUIApplicationDelegate {}
    class MyApplicationDelegate : BaseApplicationDelegate {
        [Export("application:didReceiveRemoteNotification:fetchCompletionHandler:")]
        public void DidReceiveRemoteNotification (UIApplication application, NSDictionary userInfo, Action<UIBackgroundFetchResult> completionHandler) { }
    }

the static registrar wouldn't figure out that the DidReceiveRemoteNotification method
comes from the UIApplicationDelegate, because it would only look in protocols defined
on MyApplicationDelegate, not any base classes.

The fix is to look in base classes too.

Also:

* Fix a boolean logic error when matching parameters between methods in another
  (rarely used) code path when looking for matching binding methods in the extension
  class for protocols with optional members.
* Add tests.

Fixes https://github.com/dotnet/maui/issues/6259.
2022-04-26 13:47:18 +02:00
Rolf Bjarne Kvinge 323c3472b8
[devops] Set the BUILD_REVISION variable when running the tests. (#14817)
We have a significant amount of logic using BUILD_REVISION to determine
whether we're in CI or not, so just set this variable to the current commit
hash.
2022-04-26 08:39:44 +02:00
Rolf Bjarne Kvinge 042c97735c
[tests] Fix registrar tests to not return unretained INativeObjects to Objective-C. Fixes #xamarin/maccore@2572. (#14807)
We can't return unretained INativeObjects to Objective-C, because they might
be freed at any point when the GC collects the managed object. Instead return
retained objects, that way they're not freed even if the GC collects the
managed object.

This fixes a random crash in the TestRegistrar.TestINativeObject when the GC
would run just after we've returned an INativeObject to native code, and later
used that native handle thinking it would still be valid.

Fixes https://github.com/xamarin/maccore/issues/2572.
2022-04-26 07:28:50 +02:00
Eric Sink b84b80902c
Build fixes (-dotnet) for app extensions (#14685)
Resolves #14285 

1.  Make sure `libextension-dotnet.a` gets built, and with the `-DEXTENSION` flag.
2.  Make sure `libextension-dotnet.a` gets included in the package alongside `libxamarin-dotnet.a`
3. At build time, make sure to link with the correct lib[tv]extension-dotnet.a library depending when we need to.
4. Add some tests.

Co-authored-by: Eric Sink <eric@Erics-MacBook-Pro.local>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-04-25 16:56:52 +02:00
Rolf Bjarne Kvinge 6a43d470d9
[msbuild] Fix typo in warning message. (#14808) 2022-04-25 08:32:28 +02:00
dotnet-maestro[bot] f77a785a28
[main] Update dependencies from dotnet/installer (#14797)
Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.300-rtm.22219.35 -> To Version 6.0.300-rtm.22220.25

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-04-25 08:27:08 +02:00
Alexander Köplinger 5c456d6dbb
Workaround FirstChanceExceptionEventArgs being trimmed (#14803)
* Workaround FirstChanceExceptionEventArgs being trimmed

See https://github.com/xamarin/xamarin-android/issues/6626

* Don't use ILLink descriptor on Microsoft.macOS.dll

It is using CoreCLR which doesn't run into the issue.
2022-04-25 08:07:24 +02:00
TJ Lambert 850db7a1a2
[pdfkit] Add nullability to (generated and manual) bindings (#14789)
Co-authored-by: tj_devel709 <antlambe@microsoft.com>
2022-04-22 15:55:23 -05:00
TJ Lambert 5522bc47f7
[gamecontroller] Add nullability to (generated and manual) bindings (#14612)
* Adding nullability

* use GetHandle ();

* Add nullable to TryGetX

Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-04-22 15:27:23 -05:00
TJ Lambert 6ccf756588
[avfoundation] Add nullability to (generated and manual) bindings - Fixed Branch (#14346)
* Nullability Changes

* Using is nulls

* This one shouldnt use is null

* Leave in the parameters that should not be null in the ignores

* Addressing Rolfs nullability fixes

* forgot this AVKit change

* More Concise nulls

* Silence the string nullability for AVAudioSession

* add if not null

* Use default value from apple docs for KeyToEnum method and correct earlier rolf suggestion

* Nullable element missing

* change default to null

* removing casting and passing the errors

* throw and exception in the setter

Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-04-22 15:26:19 -05:00
Rolf Bjarne Kvinge a9a638553f
[msbuild/dotnet] Fix building binding projects on Windows in .NET (#14704)
When building a binding project, we need to execute bgen (and csc) on the mac. Figuring
out where these files are on the Mac is rather complicated from a remotely executed
task, so instead we execute a sub-build that computes these properties.

In legacy Xamarin this was accomplished by building the 'Xamarin.iOS.ObjCBinding.Common.props'
file using msbuild, and invoking a custom target that prints the property we're looking
for (the 'targetGetPropertyValue_*' targets).

For multiple reasons this approach doesn't work in .NET anymore (in particular it
seems that the 'Xamarin.iOS.ObjCBinding.Common.After.targets' file with the custom
'targetGetPropertyValue_*' targets is nowhere to be found, but logic has also moved
around in the .targets/.props files which makes just building the 'Xamarin.iOS.ObjCBinding.Common.props'
not work correctly since the properties we need wouldn't be set).

So I'm adding a new task that does a sub-build, using either msbuild or dotnet as
appropriate, to compute the properties we need. Instead of building the 'Xamarin.iOS.ObjCBinding.Common.props'
file, the task creates an actual binding project (an empty one), and executes the
new '_WriteRemoteGeneratorProperties' target in this binding project.

An additional advantage in this new task is that it will only execute one sub-build
where all the properties are computed (the previous approach executed one sub-msbuild
per property).

In order to keep code as similar as possible between legacy Xamarin and .NET, the
new task is being used for legacy Xamarin as well (and the old approach deleted).

This fixes building binding projects on Windows in .NET.
2022-04-22 16:17:03 +02:00
Rolf Bjarne Kvinge eb89a34318
Bump mono to get fix for #mono/mono@21450. (#14772)
New commits in mono/mono:

* mono/mono@86118d5810 [2020-02] [AOT] Don't set the 'CorrectedSynthesize' flag in the objc_imageinfo section.
* mono/mono@5a3fe49fc5 [2020-02][cominterop] Fix CCW memory leak

Diff: adf1bc4335..86118d5810
2022-04-22 09:02:40 +02:00
Rolf Bjarne Kvinge 4fba6701e1
[runtime] Don't try process managed exceptions in xamarin_initialize. (#14792)
If we try to process any exceptions, we'll throw an Objective-C exception,
which will likely be unhandled because we're pretty much at the top of the
stack, and when we handle this Objective-C exception we'll try to convert it
into a managed exception and throw that, and since there are no managed frames
on the stack we'll end up converting it to an Objective-C exception, which
we'll try to throw, and so on, eventually running into a stack overflow.

This is unnecessary, so just abort directly.
2022-04-22 09:01:49 +02:00
Rolf Bjarne Kvinge 2cffa7c74e
[msbuild] Just use the 'AppBundleDir' variable to find the app bundle in the CreateInstallerPackage task. Fixes #14751. (#14800)
The output directory might or might not be where the app bundle is: by default
it is, but if someone sets the PkgPackageDir variable to provide an alternate
directory for the pkg, then that won't be where we'll find the app bundle.

The good news is that we already have a property that tells us where the app
bundle is (the 'AppBundleDir' property), so just use that instead.

Also:

* Make sure that the output directory exists before we try to write to it.
* Only pass full paths to productbuild, which for some reason doesn't seem to
  like relative paths.

Fixes https://github.com/xamarin/xamarin-macios/issues/14751.
2022-04-22 07:59:27 +02:00
Rolf Bjarne Kvinge 7c754bd755
Add fabricbot readme. (#14801)
Copied from https://github.com/dotnet/maui/blob/main/.github/fabricbot_readme.md.
2022-04-22 07:59:07 +02:00
Rolf Bjarne Kvinge 054fb36507
[tests] Set the test name for the MySimpleApp test project. (#14798)
This way the 'make run' target in this project knows what to run.
2022-04-22 07:55:29 +02:00
TJ Lambert 28fc8d262a
[networkextension] Add nullability to (generated and manual) bindings (#14788)
* enable nullability

* throw better exceptions

* use is null

Co-authored-by: tj_devel709 <antlambe@microsoft.com>
2022-04-21 11:35:09 -05:00
TJ Lambert 7fc37a4247
[network] Add nullability to (generated and manual) bindings (#14738)
* Throw better exceptions

* use is null and is not null

Co-authored-by: tj_devel709 <antlambe@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-04-21 11:32:41 -05:00
TJ Lambert 4da970c41f
[nearbyinteraction] Add nullability to (generated and manual) bindings (#14735)
* nullable enable

* use is null

Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2022-04-21 11:31:44 -05:00
Manuel de la Pena 8b80c5dd07
[CI] Add vsts apis implementations. (#14790) 2022-04-21 10:05:16 -04:00
Manuel de la Pena af86f843ac
[CI] Fix the template that publishes the html results. (#14791) 2022-04-21 10:04:29 -04:00
Rolf Bjarne Kvinge 3afb12f692
[CoreCLR] Rework how we track the lifetime of managed NSObjects. (#14785)
* We now create a tracking GCHandle for all NSObjects, not only the toggled ones.
  CoreCLR will notify us when a tracked GCHandle's target enters finalization, and
  we need to be notified for all NSObjects, not just the toggled ones.
* Augment the tracking callback to know about non-toggled objects, and in that
  case report that the tracking GCHandle is a weak GCHandle.
* There's no need to store the tracking GCHandle in a field in the NSObject instance,
  since we store it in our runtime object_map.
* Remove one place where we set the InFinalizerQueue flag, since it's no longer
  required there (this reverts a previous attempt at fixing this problem - 0622ae4af2)
  - we only set the InFinalizerQueue flag in the xamarin_coreclr_reference_tracking_tracked_object_entered_finalization
  callback now.
* Update a few comments accordingly.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/13531.

Fixes https://github.com/xamarin/xamarin-macios/issues/13921 (again).
2022-04-21 08:22:24 +02:00
Rolf Bjarne Kvinge 043a663ed2
[ObjCRuntime] Fix GCHandle leak in our NSObject map. (#14784)
* We can remove entries in the object_map when the target is null (and we
  don't need the corresponding GCHandle anymore, so it can be freed).
* When replacing an existing entry, we have to free the GCHandle.
2022-04-21 08:21:51 +02:00
Rolf Bjarne Kvinge 13b37cc090
[ObjCRuntime] Augment Runtime.GetNSObject to optionally create a new instance even if an existing instance was found. (#14783)
Augment Runtime.GetNSObject to optionally create a new instance even if an
existing instance was found, if the existing instance isn't compatible with
the requested instance type.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/13531.
2022-04-21 08:21:32 +02:00
dotnet-maestro[bot] b529735e22
[main] Update dependencies from dotnet/installer (#14782)
Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.300-rtm.22214.7 -> To Version 6.0.300-rtm.22219.35

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2022-04-21 08:20:56 +02:00
Rolf Bjarne Kvinge 7d229665c8
[runtime] Don't call 'retain' and 'autorelease' selectors on returned NativeObjects. (#14690)
We were trying to call the 'retain' and 'autorelease' selectors on objects
that weren't NSObjects when returning them from function calls. For some
unfathomable reason that has worked until now, but I started running into this
problem with other (unrelated) changes, so it needs to be fixed.

The fix is to not call the 'retain' and 'autorelease' selectors on
NativeObjects, instead call into managed code to either call the Retain method
on the managed NativeObject (if we're supposed to retain the return value), or
if we have to autorelease the return value, then check first if the input is
an NSObject, and only then call retain+autorelease.
2022-04-20 14:09:09 +02:00
Manuel de la Pena 406f3098e3
[CI] Use template extension to simplify the separation between api diff and building the pkgs. (#14764)
Rather than having a single yaml template with several branches using ifs, we move to a single template that does the build and then this same template allows to perform a number of steps post build and before the clean up of the bot.

This allows to separate completely the steps used by the api diff and building the pkgs. The plan is to use this as the base to move the sining of the pkgs to a diff stage allowing the signing to run in parallel allowing to reduce the build time.
2022-04-20 07:55:34 -04:00
Manuel de la Pena 45650ee23a
[Dotnet] Fix the template on iOS and Catalyst to use the system background color. (#14766) 2022-04-20 07:54:49 -04:00
dotnet-maestro[bot] d53c374d21
[main] Update dependencies from dotnet/installer (#14691)
* Update dependencies from https://github.com/dotnet/installer build 20220406.8

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.300-preview.22205.8 -> To Version 6.0.300-preview.22206.8

* Update dependencies from https://github.com/dotnet/installer build 20220407.16

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.300-preview.22205.8 -> To Version 6.0.300-preview.22207.16

* Update dependencies from https://github.com/dotnet/installer build 20220408.1

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.300-preview.22205.8 -> To Version 6.0.300-preview.22208.1

* Update dependencies from https://github.com/dotnet/installer build 20220409.1

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.300-preview.22205.8 -> To Version 6.0.300-preview.22209.1

* Update dependencies from https://github.com/dotnet/installer build 20220411.2

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.300-preview.22205.8 -> To Version 6.0.300-preview.22211.2

* Update dependencies from https://github.com/dotnet/installer build 20220412.2

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.300-preview.22205.8 -> To Version 6.0.300-preview.22212.2

* Update dependencies from https://github.com/dotnet/installer build 20220412.25

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.300-preview.22205.8 -> To Version 6.0.300-preview.22212.25

* Update dependencies from https://github.com/dotnet/installer build 20220413.48

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.300-preview.22205.8 -> To Version 6.0.300-rtm.22213.48

Dependency coherency updates

Microsoft.AspNetCore.App.Ref
 From Version 6.0.3 -> To Version 6.0.4 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220414.7

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.300-preview.22205.8 -> To Version 6.0.300-rtm.22214.7

Dependency coherency updates

Microsoft.AspNetCore.App.Ref
 From Version 6.0.3 -> To Version 6.0.4 (parent: Microsoft.Dotnet.Sdk.Internal

* Find .NET's csc compiler.

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-04-20 10:32:54 +02:00
dotnet-maestro[bot] fd3112e7f7
[main] Update dependencies from dotnet/runtime (#14692)
* Update dependencies from https://github.com/dotnet/runtime build 20220406.5

Microsoft.NETCore.App.Ref
 From Version 6.0.5 -> To Version 6.0.5

* Update dependencies from https://github.com/dotnet/runtime build 20220411.4

Microsoft.NETCore.App.Ref
 From Version 6.0.5 -> To Version 6.0.5

* Update dependencies from https://github.com/dotnet/runtime build 20220412.7

Microsoft.NETCore.App.Ref
 From Version 6.0.5 -> To Version 6.0.5

* Update dependencies from https://github.com/dotnet/runtime build 20220413.11

Microsoft.NETCore.App.Ref
 From Version 6.0.5 -> To Version 6.0.5

* Update dependencies from https://github.com/dotnet/runtime build 20220413.11

Microsoft.NETCore.App.Ref
 From Version 6.0.5 -> To Version 6.0.5

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-04-20 10:32:17 +02:00
Rolf Bjarne Kvinge beec791bda
[tests] Add some code to try to diagnose why certain test failures aren't ignored in CI. (#14769) 2022-04-20 08:19:50 +02:00
Mauro Agnoletti 4a61385d60
Updated Xamarin.Messaging to 1.6.3 (#14771)
Contains a fix to control build verbose logging of underlying Xamarin libraries
2022-04-20 08:18:48 +02:00
Manuel de la Pena 929d0fd6ec
[CI] Do not use relative paths in the updated json. (#14778) 2022-04-19 14:40:50 -04:00
Manuel de la Pena 74b291b3f5
[CI] Fix the push to the localization branch. (#14777) 2022-04-19 14:40:38 -04:00
Manuel de la Pena ae6c72200d
[CI] Fix the dir in the loc command. (#14776) 2022-04-19 13:47:23 -04:00
Manuel de la Pena 741b6dc942
[CI] Move the loc translations to its own job. (#14775)
The configuration job used to be ran only onces, because now it runs
several times we need to move the loc code out to make sure that we do
not generate more than one branch.
2022-04-19 13:31:33 -04:00
Manuel de la Pena 0e7b3d00be
[CI] Set a prefix in the status so that if we have both builds we are not confused. (#14773) 2022-04-19 13:18:32 -04:00
Rolf Bjarne Kvinge e886e954af
[dotnet] Update localized json files. (#14770)
These files are updated during the build, and the working copy is left dirty,
so commit these files.
2022-04-19 16:26:24 +02:00
Manuel de la Pena 8d9ae244ce
[CI] Only upload the config files once. (#14768) 2022-04-19 09:28:18 -04:00
Manuel de la Pena 99a0ab2c25
[CI] Do not crash when we cannot remove an empty dir. (#14767) 2022-04-19 07:45:25 -04:00
Manuel de la Pena 14d399520e
[CI] Perform the same checkout operations in all the jobs. (#14765) 2022-04-19 07:44:37 -04:00
Rolf Bjarne Kvinge da7b79b796
[devops] Add more validation to the compare.sh script. (#14699)
So that it doesn't do the wrong thing when the WORKSPACE variable isn't set
(such as trying to write stuff to the root directory).

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-04-19 10:33:47 +02:00
VS MobileTools Engineering Service 2 a22d55cd2f
Localized file check-in by OneLocBuild Task: Build definition ID 14411: Build ID 6035860 (#14761) 2022-04-18 18:11:22 -04:00