From 2e57729fc29d8ce51e22022fd067233bacbcaaee Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Mon, 19 Jul 2021 18:10:44 -0400 Subject: [PATCH 1/8] [corefoundation] Update `CFArray` and make it public (#12003) * Make `CFArray` public so it can be used for bindings, including 3rd party bindings * Subclass `NativeObject` to remove some boilerplate code * Most members are `internal` until needed * Add nullability annotations The next step is to make the same kind of optimization done on `NSString` vs `CFString` by preferring faster p/invokes over calling selectors while keeping generated code identical. Also * Make more methods internal so we can potentially rename them (when the NSArray variants becomes obsolete) * Add CFArray to the attachment tests --- src/CoreFoundation/CFArray.cs | 64 ++++++---------------- src/Foundation/DictionaryContainer.cs | 2 +- tests/introspection/ApiCMAttachmentTest.cs | 2 + 3 files changed, 21 insertions(+), 47 deletions(-) diff --git a/src/CoreFoundation/CFArray.cs b/src/CoreFoundation/CFArray.cs index d3b9dd5f08c3..8fa805cc547e 100644 --- a/src/CoreFoundation/CFArray.cs +++ b/src/CoreFoundation/CFArray.cs @@ -38,53 +38,25 @@ using CFArrayRef = System.IntPtr; using CFAllocatorRef = System.IntPtr; +#nullable enable + namespace CoreFoundation { - partial class CFArray : INativeObject, IDisposable { - - internal IntPtr handle; + public partial class CFArray : NativeObject { internal CFArray (IntPtr handle) - : this (handle, false) + : base (handle, false) { } [Preserve (Conditional = true)] internal CFArray (IntPtr handle, bool owns) + : base (handle, owns) { - if (handle == IntPtr.Zero) - throw new ArgumentNullException ("handle"); - - this.handle = handle; - if (!owns) - CFObject.CFRetain (handle); } - public IntPtr Handle { - get {return handle;} - } - [DllImport (Constants.CoreFoundationLibrary, EntryPoint="CFArrayGetTypeID")] - public extern static /* CFTypeID */ nint GetTypeID (); - - ~CFArray () - { - Dispose (false); - } - - public void Dispose () - { - Dispose (true); - GC.SuppressFinalize (this); - } - - protected virtual void Dispose (bool disposing) - { - if (handle != IntPtr.Zero){ - CFObject.CFRelease (handle); - handle = IntPtr.Zero; - } - } + internal extern static /* CFTypeID */ nint GetTypeID (); // pointer to a const struct (REALLY APPLE?) static IntPtr kCFTypeArrayCallbacks_ptr_value; @@ -97,18 +69,18 @@ protected virtual void Dispose (bool disposing) } } - public static CFArray FromIntPtrs (params IntPtr[] values) + internal static CFArray FromIntPtrs (params IntPtr[] values) { return new CFArray (Create (values), true); } - public static CFArray FromNativeObjects (params INativeObject[] values) + internal static CFArray FromNativeObjects (params INativeObject[] values) { return new CFArray (Create (values), true); } public nint Count { - get {return CFArrayGetCount (handle);} + get { return CFArrayGetCount (GetCheckedHandle ()); } } [DllImport (Constants.CoreFoundationLibrary)] @@ -119,13 +91,13 @@ public static CFArray FromNativeObjects (params INativeObject[] values) public IntPtr GetValue (nint index) { - return CFArrayGetValueAtIndex (handle, index); + return CFArrayGetValueAtIndex (GetCheckedHandle (), index); } - public static unsafe IntPtr Create (params IntPtr[] values) + internal static unsafe IntPtr Create (params IntPtr[] values) { - if (values == null) - throw new ArgumentNullException ("values"); + if (values is null) + ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (values)); fixed (IntPtr* pv = values) { return CFArrayCreate (IntPtr.Zero, (IntPtr) pv, @@ -134,10 +106,10 @@ public static unsafe IntPtr Create (params IntPtr[] values) } } - public static IntPtr Create (params INativeObject[] values) + internal static IntPtr Create (params INativeObject[] values) { - if (values == null) - throw new ArgumentNullException ("values"); + if (values is null) + ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (values)); IntPtr[] _values = new IntPtr [values.Length]; for (int i = 0; i < _values.Length; ++i) _values [i] = values [i].Handle; @@ -147,7 +119,7 @@ public static IntPtr Create (params INativeObject[] values) [DllImport (Constants.CoreFoundationLibrary)] extern static /* CFIndex */ nint CFArrayGetCount (/* CFArrayRef */ IntPtr theArray); - public static nint GetCount (IntPtr array) + internal static nint GetCount (IntPtr array) { return CFArrayGetCount (array); } @@ -155,7 +127,7 @@ public static nint GetCount (IntPtr array) [DllImport (Constants.CoreFoundationLibrary)] extern static CFArrayRef CFArrayCreateCopy (CFAllocatorRef allocator, CFArrayRef theArray); - public CFArray Clone () => new CFArray (CFArrayCreateCopy (IntPtr.Zero, this.Handle), true); + internal CFArray Clone () => new CFArray (CFArrayCreateCopy (IntPtr.Zero, GetCheckedHandle ()), true); } } diff --git a/src/Foundation/DictionaryContainer.cs b/src/Foundation/DictionaryContainer.cs index 9529d7b4dd0a..f77a15dae516 100644 --- a/src/Foundation/DictionaryContainer.cs +++ b/src/Foundation/DictionaryContainer.cs @@ -342,7 +342,7 @@ protected void SetArrayValue (NSString key, string[]? values) protected void SetArrayValue (NSString key, INativeObject[]? values) { if (NullCheckAndRemoveKey (key, values == null)) - CFMutableDictionary.SetValue (Dictionary.Handle, key!.Handle, CFArray.FromNativeObjects (values).Handle); + CFMutableDictionary.SetValue (Dictionary.Handle, key!.Handle, CFArray.FromNativeObjects (values!).Handle); } #region Sets CFBoolean value diff --git a/tests/introspection/ApiCMAttachmentTest.cs b/tests/introspection/ApiCMAttachmentTest.cs index e5acc37281a5..63191aede12d 100644 --- a/tests/introspection/ApiCMAttachmentTest.cs +++ b/tests/introspection/ApiCMAttachmentTest.cs @@ -246,6 +246,8 @@ protected INativeObject GetINativeInstance (Type t) switch (t.Name) { case "CFAllocator": return CFAllocator.SystemDefault; + case "CFArray": + return Runtime.GetINativeObject (new NSArray ().Handle, false); case "CFBundle": var bundles = CFBundle.GetAll (); if (bundles.Length > 0) From 80d2bfa252158655d47460366d85c1fbf4cdd38e Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 20 Jul 2021 08:00:35 +0200 Subject: [PATCH 2/8] [src] Share the NSTextAttachment[Container] implementations between AppKit and UIKit. (#12135) * [src] Share the NSTextAttachment[Container] implementations between AppKit and UIKit. * Use shared definition of UIImage/NSImage. --- src/appkit.cs | 49 --------------- src/uikit.cs | 50 --------------- src/xkit.cs | 77 +++++++++++++++++++++++ tests/xtro-sharpie/MacCatalyst-UIKit.todo | 2 - tests/xtro-sharpie/iOS-UIKit.ignore | 2 - tests/xtro-sharpie/macOS-AppKit.ignore | 2 - tests/xtro-sharpie/tvOS-UIKit.ignore | 2 - 7 files changed, 77 insertions(+), 107 deletions(-) diff --git a/src/appkit.cs b/src/appkit.cs index d168e24339b6..df49adb14922 100644 --- a/src/appkit.cs +++ b/src/appkit.cs @@ -17672,55 +17672,6 @@ interface NSTextAttachmentCell { NSTextAttachment Attachment { get; set; } } - [BaseType (typeof (NSObject))] - interface NSTextAttachment : NSCoding, NSSecureCoding { - [Export ("initWithFileWrapper:")] - IntPtr Constructor (NSFileWrapper fileWrapper); - - [Mac (10,11)] - [Export ("initWithData:ofType:")] - [DesignatedInitializer] - IntPtr Constructor ([NullAllowed] NSData contentData, [NullAllowed] string uti); - - //Detected properties - [Export ("fileWrapper", ArgumentSemantic.Retain)] - NSFileWrapper FileWrapper { get; set; } - - [Export ("attachmentCell", ArgumentSemantic.Retain)] - NSTextAttachmentCell AttachmentCell { get; set; } - - [Mac (10,11)] // 32-bit gives: [FAIL] Selector not found for AppKit.NSTextAttachment : contents - [NullAllowed, Export ("contents", ArgumentSemantic.Copy)] - NSData Contents { get; set; } - - [Mac (10,11)] - [NullAllowed, Export ("fileType")] - string FileType { get; set; } - - [Mac (10,11)] // 32-bit gives: [FAIL] Selector not found for AppKit.NSTextAttachment : image - [NullAllowed, Export ("image", ArgumentSemantic.Strong)] - NSImage Image { get; set; } - - [Mac (10,11)] // 32-bit gives: [FAIL] Selector not found for AppKit.NSTextAttachment : bounds - [Export ("bounds", ArgumentSemantic.Assign)] - CGRect Bounds { get; set; } - } - - [Mac (10,11)] - [Protocol, Model] - [BaseType (typeof(NSObject))] - interface NSTextAttachmentContainer - { - [Abstract] - [Export ("imageForBounds:textContainer:characterIndex:")] - [return: NullAllowed] - NSImage GetImage (CGRect imageBounds, [NullAllowed] NSTextContainer textContainer, nuint charIndex); - - [Abstract] - [Export ("attachmentBoundsForTextContainer:proposedLineFragment:glyphPosition:characterIndex:")] - CGRect GetAttachmentBounds ([NullAllowed] NSTextContainer textContainer, CGRect lineFrag, CGPoint position, nuint charIndex); - } - [DesignatedDefaultCtor] [BaseType (typeof (NSObject))] interface NSTextBlock : NSCoding, NSCopying, NSSecureCoding { diff --git a/src/uikit.cs b/src/uikit.cs index 6b54f4fa6168..903ca55a48a3 100644 --- a/src/uikit.cs +++ b/src/uikit.cs @@ -412,56 +412,6 @@ interface NSShadow : NSSecureCoding, NSCopying { } #if !WATCH - [Model] - [Protocol] - [BaseType (typeof (NSObject))] - partial interface NSTextAttachmentContainer { - [Abstract] - [Export ("imageForBounds:textContainer:characterIndex:")] - UIImage GetImageForBounds (CGRect bounds, [NullAllowed] NSTextContainer textContainer, nuint characterIndex); - - [Abstract] - [Export ("attachmentBoundsForTextContainer:proposedLineFragment:glyphPosition:characterIndex:")] - CGRect GetAttachmentBounds (NSTextContainer textContainer, CGRect proposedLineFragment, CGPoint glyphPosition, nuint characterIndex); - } - - [iOS (7,0)] - [BaseType (typeof (NSObject))] - partial interface NSTextAttachment : NSTextAttachmentContainer, NSSecureCoding -#if !WATCH - , UIAccessibilityContentSizeCategoryImageAdjusting -#endif // !WATCH - { - [DesignatedInitializer] - [Export ("initWithData:ofType:")] - [PostGet ("Contents")] - IntPtr Constructor ([NullAllowed] NSData contentData, [NullAllowed] string uti); - - [NullAllowed] // by default this property is null - [Export ("contents", ArgumentSemantic.Retain)] - NSData Contents { get; set; } - - [NullAllowed] // by default this property is null - [Export ("fileType", ArgumentSemantic.Retain)] - string FileType { get; set; } - - [NullAllowed] // by default this property is null - [Export ("image", ArgumentSemantic.Retain)] - UIImage Image { get; set; } - - [Export ("bounds")] - CGRect Bounds { get; set; } - - [NullAllowed] // by default this property is null - [Export ("fileWrapper", ArgumentSemantic.Retain)] - NSFileWrapper FileWrapper { get; set; } - - [Watch (6,0), TV (13,0), iOS (13,0)] - [Static] - [Export ("textAttachmentWithImage:")] - NSTextAttachment Create (UIImage image); - } - [Protocol] // no [Model] since it's not exposed in any API // only NSTextContainer conforms to it but it's only queried by iOS itself diff --git a/src/xkit.cs b/src/xkit.cs index d0bdc580ac19..9c8f0cb1f5dc 100644 --- a/src/xkit.cs +++ b/src/xkit.cs @@ -26,6 +26,7 @@ using NSImageScaling=System.Object; using NSRulerMarker=System.Object; using NSRulerView=System.Object; +using NSTextAttachmentCell=System.Object; using NSTextBlock=System.Object; using NSTextList=System.Object; using NSTextTableBlock=System.Object; @@ -49,11 +50,13 @@ #endif // !MONOMAC #if MONOMAC +using Image=AppKit.NSImage; using TextAlignment=AppKit.NSTextAlignment; using LineBreakMode=AppKit.NSLineBreakMode; using CollectionLayoutSectionOrthogonalScrollingBehavior=AppKit.NSCollectionLayoutSectionOrthogonalScrollingBehavior; using CollectionElementCategory=AppKit.NSCollectionElementCategory; #else +using Image=UIKit.UIImage; using TextAlignment=UIKit.UITextAlignment; using LineBreakMode=UIKit.UILineBreakMode; using CollectionLayoutSectionOrthogonalScrollingBehavior=UIKit.UICollectionLayoutSectionOrthogonalScrollingBehavior; @@ -2090,4 +2093,78 @@ interface NSLayoutConstraint [NullAllowed, Export ("identifier")] string Identifier { get; set; } } + + [NoWatch] + [Mac (10,11)] + [MacCatalyst (13,0)] + [Model] + [Protocol] + [BaseType (typeof (NSObject))] + partial interface NSTextAttachmentContainer { + [Abstract] + [Export ("imageForBounds:textContainer:characterIndex:")] + [return: NullAllowed] +#if MONOMAC && !XAMCORE_4_0 + Image GetImage (CGRect imageBounds, [NullAllowed] NSTextContainer textContainer, nuint charIndex); +#else + Image GetImageForBounds (CGRect bounds, [NullAllowed] NSTextContainer textContainer, nuint characterIndex); +#endif + + [Abstract] + [Export ("attachmentBoundsForTextContainer:proposedLineFragment:glyphPosition:characterIndex:")] + CGRect GetAttachmentBounds ([NullAllowed] NSTextContainer textContainer, CGRect proposedLineFragment, CGPoint glyphPosition, nuint characterIndex); + } + + [iOS (7,0)] + [NoWatch] + [MacCatalyst (13,0)] + [BaseType (typeof (NSObject))] + partial interface NSTextAttachment : NSTextAttachmentContainer, NSSecureCoding +#if !WATCH && !MONOMAC + , UIAccessibilityContentSizeCategoryImageAdjusting +#endif // !WATCH + { + [NoiOS][NoTV][NoMacCatalyst] + [Export ("initWithFileWrapper:")] + IntPtr Constructor (NSFileWrapper fileWrapper); + + [Mac (10,11)] + [DesignatedInitializer] + [Export ("initWithData:ofType:")] + [PostGet ("Contents")] + IntPtr Constructor ([NullAllowed] NSData contentData, [NullAllowed] string uti); + + [Mac (10,11)] + [NullAllowed] + [Export ("contents", ArgumentSemantic.Retain)] + NSData Contents { get; set; } + + [Mac (10,11)] + [NullAllowed] + [Export ("fileType", ArgumentSemantic.Retain)] + string FileType { get; set; } + + [Mac (10,11)] + [NullAllowed] + [Export ("image", ArgumentSemantic.Retain)] + Image Image { get; set; } + + [Mac (10,11)] + [Export ("bounds")] + CGRect Bounds { get; set; } + + [NullAllowed] + [Export ("fileWrapper", ArgumentSemantic.Retain)] + NSFileWrapper FileWrapper { get; set; } + + [NoiOS][NoTV][NoMacCatalyst] + [Export ("attachmentCell", ArgumentSemantic.Retain)] + NSTextAttachmentCell AttachmentCell { get; set; } + + [NoMac] + [Watch (6,0), TV (13,0), iOS (13,0)] + [Static] + [Export ("textAttachmentWithImage:")] + NSTextAttachment Create (Image image); + } } diff --git a/tests/xtro-sharpie/MacCatalyst-UIKit.todo b/tests/xtro-sharpie/MacCatalyst-UIKit.todo index 9467e409e9d0..99c647e3bb59 100644 --- a/tests/xtro-sharpie/MacCatalyst-UIKit.todo +++ b/tests/xtro-sharpie/MacCatalyst-UIKit.todo @@ -114,7 +114,6 @@ !missing-field! UITextContentTypeFlightNumber not bound !missing-field! UITextContentTypeShipmentTrackingNumber not bound !missing-null-allowed! 'CoreAnimation.CADisplayLink UIKit.UIScreen::CreateDisplayLink(Foundation.NSObject,ObjCRuntime.Selector)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'CoreGraphics.CGRect UIKit.NSTextAttachmentContainer::GetAttachmentBounds(UIKit.NSTextContainer,CoreGraphics.CGRect,CoreGraphics.CGPoint,System.nuint)' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'Foundation.NSArray Foundation.NSBundle::LoadNib(System.String,Foundation.NSObject,Foundation.NSDictionary)' is missing an [NullAllowed] on return type !missing-null-allowed! 'Foundation.NSArray[] UIKit.UIPasteboard::PasteBoardTypesForSet(Foundation.NSIndexSet)' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'Foundation.NSArray[] UIKit.UIPasteboard::PasteBoardTypesForSet(Foundation.NSIndexSet)' is missing an [NullAllowed] on return type @@ -351,7 +350,6 @@ !missing-null-allowed! 'UIKit.UIFontDescriptor UIKit.UIFontDescriptor::CreateWithTraits(UIKit.UIFontDescriptorSymbolicTraits)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIGestureRecognizer UIKit.UINavigationController::get_InteractivePopGestureRecognizer()' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIGestureRecognizer[] UIKit.UITouch::get_GestureRecognizers()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'UIKit.UIImage UIKit.NSTextAttachmentContainer::GetImageForBounds(CoreGraphics.CGRect,UIKit.NSTextContainer,System.nuint)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIImage UIKit.UIActivity::get_Image()' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIImage UIKit.UIActivityItemSource::GetThumbnailImageForActivity(UIKit.UIActivityViewController,Foundation.NSString,CoreGraphics.CGSize)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIImage UIKit.UIBarButtonItem::GetBackButtonBackgroundImage(UIKit.UIControlState,UIKit.UIBarMetrics)' is missing an [NullAllowed] on return type diff --git a/tests/xtro-sharpie/iOS-UIKit.ignore b/tests/xtro-sharpie/iOS-UIKit.ignore index a95e848997bc..7b43d0159fc5 100644 --- a/tests/xtro-sharpie/iOS-UIKit.ignore +++ b/tests/xtro-sharpie/iOS-UIKit.ignore @@ -128,7 +128,6 @@ # Initial result from new rule missing-null-allowed !missing-null-allowed! 'CoreAnimation.CADisplayLink UIKit.UIScreen::CreateDisplayLink(Foundation.NSObject,ObjCRuntime.Selector)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'CoreGraphics.CGRect UIKit.NSTextAttachmentContainer::GetAttachmentBounds(UIKit.NSTextContainer,CoreGraphics.CGRect,CoreGraphics.CGPoint,System.nuint)' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'Foundation.NSArray Foundation.NSBundle::LoadNib(System.String,Foundation.NSObject,Foundation.NSDictionary)' is missing an [NullAllowed] on return type !missing-null-allowed! 'Foundation.NSArray[] UIKit.UIPasteboard::PasteBoardTypesForSet(Foundation.NSIndexSet)' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'Foundation.NSArray[] UIKit.UIPasteboard::PasteBoardTypesForSet(Foundation.NSIndexSet)' is missing an [NullAllowed] on return type @@ -367,7 +366,6 @@ !missing-null-allowed! 'UIKit.UIFontDescriptor UIKit.UIFontDescriptor::CreateWithTraits(UIKit.UIFontDescriptorSymbolicTraits)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIGestureRecognizer UIKit.UINavigationController::get_InteractivePopGestureRecognizer()' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIGestureRecognizer[] UIKit.UITouch::get_GestureRecognizers()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'UIKit.UIImage UIKit.NSTextAttachmentContainer::GetImageForBounds(CoreGraphics.CGRect,UIKit.NSTextContainer,System.nuint)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIImage UIKit.UIActivity::get_Image()' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIImage UIKit.UIActivityItemSource::GetThumbnailImageForActivity(UIKit.UIActivityViewController,Foundation.NSString,CoreGraphics.CGSize)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIImage UIKit.UIBarButtonItem::GetBackButtonBackgroundImage(UIKit.UIControlState,UIKit.UIBarMetrics)' is missing an [NullAllowed] on return type diff --git a/tests/xtro-sharpie/macOS-AppKit.ignore b/tests/xtro-sharpie/macOS-AppKit.ignore index 9c2bb2758dd2..220adfad4040 100644 --- a/tests/xtro-sharpie/macOS-AppKit.ignore +++ b/tests/xtro-sharpie/macOS-AppKit.ignore @@ -637,7 +637,6 @@ !missing-protocol-conformance! NSTableView should conform to NSTextViewDelegate !missing-protocol-conformance! NSText should conform to NSChangeSpelling !missing-protocol-conformance! NSText should conform to NSIgnoreMisspelledWords -!missing-protocol-conformance! NSTextAttachment should conform to NSTextAttachmentContainer !missing-protocol-conformance! NSTextAttachmentCell should conform to NSTextAttachmentCell !missing-protocol-conformance! NSTextContainer should conform to NSTextLayoutOrientationProvider !missing-protocol-conformance! NSTextView should conform to NSTextLayoutOrientationProvider @@ -2113,7 +2112,6 @@ !missing-null-allowed! 'System.Void AppKit.NSText::Unscript(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'System.Void AppKit.NSTextAttachment::.ctor(Foundation.NSFileWrapper)' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'System.Void AppKit.NSTextAttachment::set_AttachmentCell(AppKit.NSTextAttachmentCell)' is missing an [NullAllowed] on parameter #0 -!missing-null-allowed! 'System.Void AppKit.NSTextAttachment::set_FileWrapper(Foundation.NSFileWrapper)' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'System.Void AppKit.NSTextBlock::set_BackgroundColor(AppKit.NSColor)' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'System.Void AppKit.NSTextBlock::SetBorderColor(AppKit.NSColor)' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'System.Void AppKit.NSTextBlock::SetBorderColor(AppKit.NSColor,AppKit.NSRectEdge)' is missing an [NullAllowed] on parameter #0 diff --git a/tests/xtro-sharpie/tvOS-UIKit.ignore b/tests/xtro-sharpie/tvOS-UIKit.ignore index c227e3f15ba5..eca5b600848a 100644 --- a/tests/xtro-sharpie/tvOS-UIKit.ignore +++ b/tests/xtro-sharpie/tvOS-UIKit.ignore @@ -142,7 +142,6 @@ # Initial result from new rule missing-null-allowed !missing-null-allowed! 'CoreAnimation.CADisplayLink UIKit.UIScreen::CreateDisplayLink(Foundation.NSObject,ObjCRuntime.Selector)' is missing an [NullAllowed] on return type -!missing-null-allowed! 'CoreGraphics.CGRect UIKit.NSTextAttachmentContainer::GetAttachmentBounds(UIKit.NSTextContainer,CoreGraphics.CGRect,CoreGraphics.CGPoint,System.nuint)' is missing an [NullAllowed] on parameter #0 !missing-null-allowed! 'Foundation.NSArray Foundation.NSBundle::LoadNib(System.String,Foundation.NSObject,Foundation.NSDictionary)' is missing an [NullAllowed] on return type !missing-null-allowed! 'Foundation.NSAttributedString UIKit.UIButton::get_CurrentAttributedTitle()' is missing an [NullAllowed] on return type !missing-null-allowed! 'Foundation.NSAttributedString UIKit.UIButton::GetAttributedTitle(UIKit.UIControlState)' is missing an [NullAllowed] on return type @@ -306,7 +305,6 @@ !missing-null-allowed! 'UIKit.UIDynamicAnimator UIKit.UIDynamicBehavior::get_DynamicAnimator()' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIFontDescriptor UIKit.UIFontDescriptor::CreateWithTraits(UIKit.UIFontDescriptorSymbolicTraits)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIGestureRecognizer[] UIKit.UITouch::get_GestureRecognizers()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'UIKit.UIImage UIKit.NSTextAttachmentContainer::GetImageForBounds(CoreGraphics.CGRect,UIKit.NSTextContainer,System.nuint)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIImage UIKit.UIBarButtonItem::GetBackgroundImage(UIKit.UIControlState,UIKit.UIBarButtonItemStyle,UIKit.UIBarMetrics)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIImage UIKit.UIBarButtonItem::GetBackgroundImage(UIKit.UIControlState,UIKit.UIBarMetrics)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIImage UIKit.UIButton::BackgroundImageForState(UIKit.UIControlState)' is missing an [NullAllowed] on return type From e9c8b50e537f43dcac00b4ac4c0d1c5be874b18b Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 20 Jul 2021 12:19:31 +0200 Subject: [PATCH 3/8] [xharness] Handle exceptions that occur while listing device candidates gracefully. (#12133) This fixes a problem where the html report wouldn't be re-generated if there was a problem loading a device (which for instance could happen if xharness was unable to create a required simulator). --- tests/xharness/Jenkins/Reports/HtmlReportWriter.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/xharness/Jenkins/Reports/HtmlReportWriter.cs b/tests/xharness/Jenkins/Reports/HtmlReportWriter.cs index 2682105dd0b6..bd8700d666af 100644 --- a/tests/xharness/Jenkins/Reports/HtmlReportWriter.cs +++ b/tests/xharness/Jenkins/Reports/HtmlReportWriter.cs @@ -405,8 +405,12 @@
  • Toggle visibility candidates = (runTest as RunSimulatorTask)?.Candidates; if (candidates != null) { writer.WriteLine ($"Candidate devices:
    "); - foreach (var candidate in candidates) - writer.WriteLine ($"    {candidate.Name} (Version: {candidate.OSVersion})
    "); + try { + foreach (var candidate in candidates) + writer.WriteLine ($"    {candidate.Name} (Version: {candidate.OSVersion})
    "); + } catch (Exception e) { + writer.WriteLine ($"    Failed to list candidates: {e}"); + } } writer.WriteLine ($"Build duration: {runTest.BuildTask.Duration}
    "); } From 3c38f8ccd60911cd8827c16cd8d6fd14e5b75ee0 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 20 Jul 2021 14:34:37 +0200 Subject: [PATCH 4/8] [dotnet] Enable autorelease pools for threadpools. Fixes #11750. (#12060) Fixes https://github.com/xamarin/xamarin-macios/issues/11750. --- dotnet/targets/Xamarin.Shared.Sdk.targets | 1 + runtime/runtime.m | 2 +- tests/monotouch-test/ObjCRuntime/RuntimeTest.cs | 3 --- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dotnet/targets/Xamarin.Shared.Sdk.targets b/dotnet/targets/Xamarin.Shared.Sdk.targets index 11d01c8c4fe5..86745895a19a 100644 --- a/dotnet/targets/Xamarin.Shared.Sdk.targets +++ b/dotnet/targets/Xamarin.Shared.Sdk.targets @@ -133,6 +133,7 @@ false true true + true false diff --git a/runtime/runtime.m b/runtime/runtime.m index 3b258ec245f7..ccbd684b8fa7 100644 --- a/runtime/runtime.m +++ b/runtime/runtime.m @@ -1349,7 +1349,7 @@ -(void) xamarinSetFlags: (enum XamarinGCHandleFlags) flags; if (main_bundle == NULL) xamarin_assertion_message ("Could not find the main bundle in the app ([NSBundle mainBundle] returned nil)"); -#if MONOMAC +#if TARGET_OS_MACCATALYST || TARGET_OS_OSX if (xamarin_launch_mode == XamarinLaunchModeEmbedded) { bundle_path = [[[NSBundle bundleForClass: [XamarinAssociatedObject class]] bundlePath] stringByAppendingPathComponent: @"Versions/Current"]; } else { diff --git a/tests/monotouch-test/ObjCRuntime/RuntimeTest.cs b/tests/monotouch-test/ObjCRuntime/RuntimeTest.cs index 903691a1ceb0..8c574a2bc8e4 100644 --- a/tests/monotouch-test/ObjCRuntime/RuntimeTest.cs +++ b/tests/monotouch-test/ObjCRuntime/RuntimeTest.cs @@ -456,9 +456,6 @@ public void GetINativeObjectTest () } [Test] -#if NET - [Ignore ("https://github.com/dotnet/runtime/issues/32543")] -#endif public void NSAutoreleasePoolInThreadPool () { var count = 100; From 09f911b504ec9b803eb6d725cca14cc7d3ed986e Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Tue, 20 Jul 2021 11:32:43 -0400 Subject: [PATCH 5/8] [CI] Add Prepare Release and VS Insertion stages (#12015) Context: https://github.com/xamarin/yaml-templates/pull/117 Updates the .NET 6 NuGet packaging steps to exclude package metadata, as the .msi conversion tooling does not process .nupkg file names with the `+sha.commit` metadata. Two new stages have been added to facilitate the Visual Studio setup authoring process. The first stage named "Prepare Release" will sign the .NET 6 NuGet package content (inside and out), convert relevant packages to .msi installers, generate Visual Studio manifests for the .msi installers, and push the signed packages to the `xamarin-impl` feed. The new `SignList.xml` file is required for our NuGet signing templates. The new `xamarin-workload.props` file contains version information and other metadata required to generate a Visual Studio manifest. The second stage starts with a [manual validation task][0]. This task will pause and wait for someone to click a "Resume" or "Reject" button that will appear on the pipeline UI. This task is configured to be rejected after waiting for two days, but it can be manually re-ran at a later date if we want to trigger VS insertion for an older build. If the manual validation task is approved, a VS Drop will be created containing all .NET 6 .msi files. This Drop URL can then be used to update our component versions in Visual Studio. This last piece is currently manual as we will initially be introducing new components, however we should be able to automate VS PR creation in the future. [0]: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/manual-validation?view=azure-devops&tabs=yaml --- dotnet/Makefile | 34 ++++++---- dotnet/Workloads/SignList.xml | 25 +++++++ dotnet/Workloads/vs-workload.template.props | 16 +++++ ...WorkloadManifest.MacCatalyst.template.json | 2 +- .../WorkloadManifest.iOS.template.json | 2 +- .../WorkloadManifest.macOS.template.json | 2 +- .../WorkloadManifest.tvOS.template.json | 2 +- tools/devops/automation/build-pipeline.yml | 6 ++ .../automation/scripts/bash/build-nugets.sh | 2 + .../automation/templates/build/build.yml | 13 ++-- .../templates/build/publish-nugets.yml | 10 --- .../templates/build/sign-and-notarized.yml | 43 +++--------- .../automation/templates/build/stage.yml | 1 - .../templates/release/vs-insertion-prep.yml | 66 +++++++++++++++++++ 14 files changed, 154 insertions(+), 70 deletions(-) create mode 100644 dotnet/Workloads/SignList.xml create mode 100644 dotnet/Workloads/vs-workload.template.props create mode 100644 tools/devops/automation/templates/release/vs-insertion-prep.yml diff --git a/dotnet/Makefile b/dotnet/Makefile index 9e1a93104654..0d09a8b49713 100644 --- a/dotnet/Makefile +++ b/dotnet/Makefile @@ -129,6 +129,18 @@ LOCAL_WORKLOAD_TARGETS += Workloads/Microsoft.NET.Sdk.$(1)/LICENSE endef $(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call WorkloadTargets,$(platform),$(shell echo $(platform) | tr A-Z a-z),$($(platform)_NUGET_VERSION_NO_METADATA)))) +$(DOTNET_NUPKG_DIR)/vs-workload.props: Workloads/vs-workload.template.props + $(Q) rm -f $@.tmp + $(Q_GEN) sed \ + $(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),-e "s/@$(platform)_WORKLOAD_VERSION@/$($(platform)_NUGET_VERSION).$($(platform)_NUGET_COMMIT_DISTANCE)/g") \ + -e "s/@PACK_VERSION_LONG@/$(IOS_NUGET_VERSION_NO_METADATA)/g" \ + -e "s/@PACK_VERSION_SHORT@/$(IOS_NUGET_VERSION).$(IOS_NUGET_COMMIT_DISTANCE)/g" \ + $< > $@.tmp + $(Q) mv $@.tmp $@ + +$(DOTNET_NUPKG_DIR)/SignList.xml: Workloads/SignList.xml + $(Q) $(CP) $< $@ + TEMPLATED_FILES = \ $(foreach platform,$(DOTNET_PLATFORMS),Microsoft.$(platform).Sdk/targets/Microsoft.$(platform).Sdk.Versions.props) \ $(foreach platform,$(DOTNET_PLATFORMS),Microsoft.$(platform).Sdk/targets/Microsoft.$(platform).Sdk.SupportedTargetPlatforms.props) \ @@ -144,12 +156,10 @@ $(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call NupkgDefinition,$(platform) # Create the nuget in a temporary directory (nupkgs/) define CreateNuGetTemplate -nupkgs/$(1)$(4).$(2)+$(NUGET_BUILD_METADATA).nupkg: $(TEMPLATED_FILES) $(WORKLOAD_TARGETS) $(3) package/$(1)/package.csproj $(wildcard package/*.csproj) $(wildcard $(DOTNET_DESTDIR)/$(1)/* $(DOTNET_DESTDIR)/$(1)/*/* $(DOTNET_DESTDIR)/$(1)/*/*/* $(DOTNET_DESTDIR)/$(1)/*/*/*/*) global.json .stamp-workaround-for-maccore-issue-2427 +nupkgs/$(1)$(4).$(2).nupkg: $(TEMPLATED_FILES) $(WORKLOAD_TARGETS) $(3) package/$(1)/package.csproj $(wildcard package/*.csproj) $(wildcard $(DOTNET_DESTDIR)/$(1)/* $(DOTNET_DESTDIR)/$(1)/*/* $(DOTNET_DESTDIR)/$(1)/*/*/* $(DOTNET_DESTDIR)/$(1)/*/*/*/*) global.json .stamp-workaround-for-maccore-issue-2427 @# Delete any versions of the nuget we're building $$(Q) rm -f nupkgs/$(1).*.nupkg $$(Q_PACK) $(DOTNET6) pack package/$(1)/package.csproj -p:VersionBand=$(DOTNET6_VERSION_BAND) --output "$$(dir $$@)" $(DOTNET_PACK_VERBOSITY) "/bl:$$@.binlog" - @# Nuget pack doesn't add the metadata to the filename, but we want that, so rename nuget to contain the full name - $$(Q) mv "nupkgs/$(1)$(4).$(2).nupkg" "$$@" @# Clean the local feed $$(Q_NUGET_DEL) if test -d $(DOTNET_FEED_DIR)/$(shell echo $(1) | tr A-Z a-z)/$(2); then nuget delete $(1) $(2) -source $(abspath $(DOTNET_FEED_DIR)) -NonInteractive $(NUGET_VERBOSITY); fi @# Add the nupkg to our local feed @@ -157,12 +167,10 @@ nupkgs/$(1)$(4).$(2)+$(NUGET_BUILD_METADATA).nupkg: $(TEMPLATED_FILES) $(WORKLOA endef define CreateWindowsNuGetTemplate -nupkgs/$(1).$(2)+$(NUGET_BUILD_METADATA).nupkg: $(3) $(WORKLOAD_TARGETS) package/$(1)/package.csproj $(wildcard package/*.csproj) $(wildcard $(DOTNET_DESTDIR)/$(1)/* $(DOTNET_DESTDIR)/$(1)/*/* $(DOTNET_DESTDIR)/$(1)/*/*/* $(DOTNET_DESTDIR)/$(1)/*/*/*/*) global.json .stamp-workaround-for-maccore-issue-2427 +nupkgs/$(1).$(2).nupkg: $(3) $(WORKLOAD_TARGETS) package/$(1)/package.csproj $(wildcard package/*.csproj) $(wildcard $(DOTNET_DESTDIR)/$(1)/* $(DOTNET_DESTDIR)/$(1)/*/* $(DOTNET_DESTDIR)/$(1)/*/*/* $(DOTNET_DESTDIR)/$(1)/*/*/*/*) global.json .stamp-workaround-for-maccore-issue-2427 @# Delete any versions of the nuget we're building $$(Q) rm -f nupkgs/$(1).*.nupkg $$(Q_PACK) $(DOTNET6) pack package/$(1)/package.csproj --output "$$(dir $$@)" $(DOTNET_PACK_VERBOSITY) "/bl:$$@.binlog" - @# Nuget pack doesn't add the metadata to the filename, but we want that, so rename nuget to contain the full name - $$(Q) mv "nupkgs/$(1).$(2).nupkg" "$$@" @# Clean the local feed $$(Q_NUGET_DEL) if test -d $(DOTNET_FEED_DIR)/$(shell echo $(1) | tr A-Z a-z)/$(2); then nuget delete $(1) $(2) -source $(abspath $(DOTNET_FEED_DIR)) -NonInteractive $(NUGET_VERBOSITY); fi @# Add the nupkg to our local feed @@ -182,28 +190,28 @@ $(DOTNET_NUPKG_DIR)/%.nupkg: nupkgs/%.nupkg | $(DOTNET_NUPKG_DIR) $(Q) $(CP) $< $@ ifdef INCLUDE_IOS -SDK_PACK_IOS_WINDOWS = $(DOTNET_NUPKG_DIR)/$(IOS_WINDOWS_NUGET).Sdk.$(IOS_WINDOWS_NUGET_VERSION_FULL).nupkg +SDK_PACK_IOS_WINDOWS = $(DOTNET_NUPKG_DIR)/$(IOS_WINDOWS_NUGET).Sdk.$(IOS_WINDOWS_NUGET_VERSION_NO_METADATA).nupkg SDK_PACKS += $(SDK_PACK_IOS_WINDOWS) endif pack-ios-windows: $(SDK_PACK_IOS_WINDOWS) define PacksDefinitions -RUNTIME_PACKS_$(1) = $$(foreach rid,$$(DOTNET_$(1)_RUNTIME_IDENTIFIERS),$(DOTNET_NUPKG_DIR)/$($(1)_NUGET).Runtime.$$(rid).$($(1)_NUGET_VERSION_FULL).nupkg) +RUNTIME_PACKS_$(1) = $$(foreach rid,$$(DOTNET_$(1)_RUNTIME_IDENTIFIERS),$(DOTNET_NUPKG_DIR)/$($(1)_NUGET).Runtime.$$(rid).$($(1)_NUGET_VERSION_NO_METADATA).nupkg) RUNTIME_PACKS += $$(RUNTIME_PACKS_$(1)) -REF_PACKS_$(1) = $(DOTNET_NUPKG_DIR)/$($(1)_NUGET).Ref.$($(1)_NUGET_VERSION_FULL).nupkg +REF_PACKS_$(1) = $(DOTNET_NUPKG_DIR)/$($(1)_NUGET).Ref.$($(1)_NUGET_VERSION_NO_METADATA).nupkg REF_PACKS += $$(REF_PACKS_$(1)) -SDK_PACKS_$(1) = $(DOTNET_NUPKG_DIR)/$($(1)_NUGET).Sdk.$($(1)_NUGET_VERSION_FULL).nupkg +SDK_PACKS_$(1) = $(DOTNET_NUPKG_DIR)/$($(1)_NUGET).Sdk.$($(1)_NUGET_VERSION_NO_METADATA).nupkg SDK_PACKS += $$(SDK_PACKS_$(1)) -TEMPLATE_PACKS_$(1) = $(DOTNET_NUPKG_DIR)/$($(1)_NUGET).Templates.$($(1)_NUGET_VERSION_FULL).nupkg +TEMPLATE_PACKS_$(1) = $(DOTNET_NUPKG_DIR)/$($(1)_NUGET).Templates.$($(1)_NUGET_VERSION_NO_METADATA).nupkg TEMPLATE_PACKS += $$(TEMPLATE_PACKS_$(1)) -WORKLOAD_PACKS_$(1) = $(DOTNET_NUPKG_DIR)/$(subst Microsoft.,Microsoft.NET.Sdk.,$($(1)_NUGET)).Manifest-$(DOTNET6_VERSION_BAND).$($(1)_NUGET_VERSION_FULL).nupkg +WORKLOAD_PACKS_$(1) = $(DOTNET_NUPKG_DIR)/$(subst Microsoft.,Microsoft.NET.Sdk.,$($(1)_NUGET)).Manifest-$(DOTNET6_VERSION_BAND).$($(1)_NUGET_VERSION_NO_METADATA).nupkg WORKLOAD_PACKS += $$(WORKLOAD_PACKS_$(1)) pack-$(shell echo $(1) | tr A-Z a-z): $$(RUNTIME_PACKS_$(1)) $$(REF_PACKS_$(1)) $$(SDK_PACKS_$(1)) $$(TEMPLATE_PACKS_$(1)) $$(WORKLOAD_PACKS_$(1)) endef $(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(eval $(call PacksDefinitions,$(platform)))) -TARGETS += $(RUNTIME_PACKS) $(REF_PACKS) $(SDK_PACKS) $(TEMPLATE_PACKS) $(WORKLOAD_PACKS) +TARGETS += $(RUNTIME_PACKS) $(REF_PACKS) $(SDK_PACKS) $(TEMPLATE_PACKS) $(WORKLOAD_PACKS) $(DOTNET_NUPKG_DIR)/vs-workload.props $(DOTNET_NUPKG_DIR)/SignList.xml define InstallWorkload # .NET comes with a workload for us, but we don't want that, we want our own. So delete the workload that comes with .NET. diff --git a/dotnet/Workloads/SignList.xml b/dotnet/Workloads/SignList.xml new file mode 100644 index 000000000000..cecbdf381152 --- /dev/null +++ b/dotnet/Workloads/SignList.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dotnet/Workloads/vs-workload.template.props b/dotnet/Workloads/vs-workload.template.props new file mode 100644 index 000000000000..cdb3ef238dd1 --- /dev/null +++ b/dotnet/Workloads/vs-workload.template.props @@ -0,0 +1,16 @@ + + + + Microsoft.NET.Sdk.MaciOS.Workload + + + + + @PACK_VERSION_SHORT@ + + + + + + + diff --git a/dotnet/targets/WorkloadManifest.MacCatalyst.template.json b/dotnet/targets/WorkloadManifest.MacCatalyst.template.json index fd9310ace4bd..1eba2462ed3b 100644 --- a/dotnet/targets/WorkloadManifest.MacCatalyst.template.json +++ b/dotnet/targets/WorkloadManifest.MacCatalyst.template.json @@ -2,7 +2,7 @@ "version": "@VERSION@", "workloads": { "@PLATFORM_LOWERCASE@": { - "description": "Microsoft @PLATFORM@ SDK for .NET", + "description": ".NET SDK Workload for building macOS applications with @PLATFORM@.", "packs": [ "Microsoft.@PLATFORM@.Sdk", "Microsoft.@PLATFORM@.Ref", diff --git a/dotnet/targets/WorkloadManifest.iOS.template.json b/dotnet/targets/WorkloadManifest.iOS.template.json index 92c4541080c3..e476d668982c 100644 --- a/dotnet/targets/WorkloadManifest.iOS.template.json +++ b/dotnet/targets/WorkloadManifest.iOS.template.json @@ -2,7 +2,7 @@ "version": "@VERSION@", "workloads": { "@PLATFORM_LOWERCASE@": { - "description": "Microsoft @PLATFORM@ SDK for .NET", + "description": ".NET SDK Workload for building @PLATFORM@ applications.", "packs": [ "Microsoft.@PLATFORM@.Sdk", "Microsoft.@PLATFORM@.Windows.Sdk", diff --git a/dotnet/targets/WorkloadManifest.macOS.template.json b/dotnet/targets/WorkloadManifest.macOS.template.json index 74158a75445f..3a3cebc5bde8 100644 --- a/dotnet/targets/WorkloadManifest.macOS.template.json +++ b/dotnet/targets/WorkloadManifest.macOS.template.json @@ -2,7 +2,7 @@ "version": "@VERSION@", "workloads": { "@PLATFORM_LOWERCASE@": { - "description": "Microsoft @PLATFORM@ SDK for .NET", + "description": ".NET SDK Workload for building @PLATFORM@ applications.", "packs": [ "Microsoft.@PLATFORM@.Sdk", "Microsoft.@PLATFORM@.Ref", diff --git a/dotnet/targets/WorkloadManifest.tvOS.template.json b/dotnet/targets/WorkloadManifest.tvOS.template.json index 53066388a287..4d4dfd16d0c0 100644 --- a/dotnet/targets/WorkloadManifest.tvOS.template.json +++ b/dotnet/targets/WorkloadManifest.tvOS.template.json @@ -2,7 +2,7 @@ "version": "@VERSION@", "workloads": { "@PLATFORM_LOWERCASE@": { - "description": "Microsoft @PLATFORM@ SDK for .NET", + "description": ".NET SDK Workload for building @PLATFORM@ applications.", "packs": [ "Microsoft.@PLATFORM@.Sdk", "Microsoft.@PLATFORM@.Ref", diff --git a/tools/devops/automation/build-pipeline.yml b/tools/devops/automation/build-pipeline.yml index eb281cbd99ac..5f5cdd648c1e 100644 --- a/tools/devops/automation/build-pipeline.yml +++ b/tools/devops/automation/build-pipeline.yml @@ -160,6 +160,8 @@ variables: value: 'VSEng-Xamarin-RedmondMacBuildPool-iOS-Trusted' - name: CIBuildPoolUrl value: 'https://devdiv.visualstudio.com/_settings/agentpools?poolId=367&view=agents' +- name: IsPRBuild + value: ${{ or(eq(variables['Build.Reason'], 'PullRequest'), and(eq(variables['Build.SourceBranchName'], 'merge'), or(eq(variables['Build.Reason'], 'Manual'), eq(variables['Build.Reason'], 'IndividualCI')))) }} trigger: branches: @@ -241,6 +243,10 @@ stages: xqaCertPass: $(xqa--certificates--password) enableDotnet: ${{ parameters.enableDotnet }} +# .NET 6 Release Prep and VS Insertion Stages +- template: templates/release/vs-insertion-prep.yml + +# Test stages - ${{ if eq(parameters.runDeviceTests, true) }}: - ${{ if and(ne(variables['Build.Reason'], 'Schedule'), or(eq(variables['Build.Reason'], 'IndividualCI'), eq(variables['Build.Reason'], 'Manual'))) }}: - ${{ each config in parameters.deviceTestsConfigurations }}: diff --git a/tools/devops/automation/scripts/bash/build-nugets.sh b/tools/devops/automation/scripts/bash/build-nugets.sh index 7b9db9880249..831afb0985ff 100755 --- a/tools/devops/automation/scripts/bash/build-nugets.sh +++ b/tools/devops/automation/scripts/bash/build-nugets.sh @@ -13,6 +13,8 @@ DOTNET_NUPKG_DIR=$(make -C tools/devops print-abspath-variable VARIABLE=DOTNET_N mkdir -p ../package/ rm -f ../package/*.nupkg cp -c "$DOTNET_NUPKG_DIR"/*.nupkg ../package/ +cp -c "$DOTNET_NUPKG_DIR"/vs-workload.props ../package/ +cp -c "$DOTNET_NUPKG_DIR"/SignList.xml ../package/ DOTNET_PKG_DIR=$(make -C tools/devops print-abspath-variable VARIABLE=DOTNET_PKG_DIR | grep "^DOTNET_PKG_DIR=" | sed -e 's/^DOTNET_PKG_DIR=//') make -C dotnet package -j diff --git a/tools/devops/automation/templates/build/build.yml b/tools/devops/automation/templates/build/build.yml index 703e71cbc6e5..7f9459e2bef4 100644 --- a/tools/devops/automation/templates/build/build.yml +++ b/tools/devops/automation/templates/build/build.yml @@ -7,10 +7,6 @@ parameters: type: boolean default: true -- name: isPR - type: boolean - default: false - - name: vsdropsPrefix type: string @@ -328,11 +324,10 @@ steps: - template: build-nugets.yml # only sign an notarize in no PR executions -- ${{ if ne(parameters.isPR, 'True') }}: - - template: sign-and-notarized.yml - parameters: - enableDotnet: ${{ parameters.enableDotnet }} - keyringPass: ${{ parameters.keyringPass }} +- template: sign-and-notarized.yml + parameters: + enableDotnet: ${{ parameters.enableDotnet }} + keyringPass: ${{ parameters.keyringPass }} # publish nugets (must be done after signing) - ${{ if eq(parameters.enableDotnet, true) }}: diff --git a/tools/devops/automation/templates/build/publish-nugets.yml b/tools/devops/automation/templates/build/publish-nugets.yml index 033b65fb5729..c164530b11d4 100644 --- a/tools/devops/automation/templates/build/publish-nugets.yml +++ b/tools/devops/automation/templates/build/publish-nugets.yml @@ -4,16 +4,6 @@ steps: # do not publish on pull requets - ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: - - task: NuGetCommand@2 - displayName: 'Publish Nugets to xamarin-impl' - inputs: - command: push - packagesToPush: $(Build.SourcesDirectory)/package/*.nupkg - nuGetFeedType: external - publishFeedCredentials: xamarin-impl public feed - condition: and(succeeded(), eq(variables['configuration.BuildNugets'], 'True')) - continueOnError: true # should not stop the build since is not official just yet. - - task: NuGetCommand@2 displayName: 'Publish Nugets to dotnet-eng' inputs: diff --git a/tools/devops/automation/templates/build/sign-and-notarized.yml b/tools/devops/automation/templates/build/sign-and-notarized.yml index 53a607eaa4b2..415c7fad53c8 100644 --- a/tools/devops/automation/templates/build/sign-and-notarized.yml +++ b/tools/devops/automation/templates/build/sign-and-notarized.yml @@ -12,6 +12,9 @@ parameters: - name: keyringPass type: string +- name: condition + default: and(succeeded(), eq(variables['IsPRBuild'], 'False')) + steps: - bash: | @@ -82,7 +85,7 @@ steps: echo "Microsoft.MacCatalyst package found at $MACCATALYST_DOTNET_PKG" fi displayName: 'Retrieve packages to sign' - condition: and(succeeded(), contains(variables['configuration.BuildPkgs'], 'True')) + condition: and(${{ parameters.condition }}, contains(variables['configuration.BuildPkgs'], 'True')) timeoutInMinutes: 180 - task: MicroBuildSigningPlugin@3 @@ -93,7 +96,8 @@ steps: zipSources: false # we do not use the feature and makes the installation to last 10/12 mins instead of < 1 min env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) - + condition: ${{ parameters.condition }} + - ${{ if eq(parameters.enableDotnet, true) }}: - pwsh : | # Get the list of files to sign @@ -124,37 +128,7 @@ steps: ConvertTo-Json -InputObject $SignFileList -Depth 5 | Out-File -FilePath $(Build.ArtifactStagingDirectory)/MsiFiles2Notarize.json -Force dotnet $Env:MBSIGN_APPFOLDER/ddsignfiles.dll /filelist:$(Build.ArtifactStagingDirectory)/MsiFiles2Notarize.json displayName: 'Sign .msi' - -- ${{ if eq(parameters.enableDotnet, true) }}: - - pwsh : | - # Get the list of files to sign - $nupkgFiles = Get-ChildItem -Path $(Build.SourcesDirectory)/package/ -Filter "*.nupkg" - - # Add those files to an array - $SignFiles = @() - foreach($nupkg in $nupkgFiles) { - Write-Host "$($nupkg.FullName)" - $SignFiles += @{ "SrcPath"="$($nupkg.FullName)"} - } - - Write-Host "$nupkgFiles" - - # array of dicts - $SignFileRecord = @( - @{ - "Certs" = "401405"; - "SignFileList" = $SignFiles; - } - ) - - $SignFileList = @{ - "SignFileRecordList" = $SignFileRecord - } - - # Write the json to a file - ConvertTo-Json -InputObject $SignFileList -Depth 5 | Out-File -FilePath $(Build.ArtifactStagingDirectory)/NupkgFiles2Notarize.json -Force - dotnet $Env:MBSIGN_APPFOLDER/ddsignfiles.dll /filelist:$(Build.ArtifactStagingDirectory)/NupkgFiles2Notarize.json - displayName: 'Sign .nupkg' + condition: ${{ parameters.condition }} - bash: | security unlock-keychain -p $PRODUCTSIGN_KEYCHAIN_PASSWORD builder.keychain @@ -175,6 +149,7 @@ steps: name: notarize displayName: 'Signing Release Build' timeoutInMinutes: 90 + condition: ${{ parameters.condition }} - task: ms-vseng.MicroBuildTasks.30666190-6959-11e5-9f96-f56098202fef.MicroBuildSigningPlugin@3 displayName: 'Install Notarizing Plugin' @@ -187,6 +162,7 @@ steps: - pwsh: $(Build.SourcesDirectory)/release-scripts/notarize.ps1 -FolderForApps $(Build.SourcesDirectory)/package/notarized displayName: 'ESRP notarizing packages' + condition: ${{ parameters.condition }} - pwsh: | $notarizedRoot = Join-Path $(Build.SourcesDirectory) package notarized @@ -195,3 +171,4 @@ steps: pkgutil --check-signature "$($_.FullName)" } displayName: 'Verify ESRP notarization' + condition: ${{ parameters.condition }} diff --git a/tools/devops/automation/templates/build/stage.yml b/tools/devops/automation/templates/build/stage.yml index 770d4fddcf30..59726c1559b1 100644 --- a/tools/devops/automation/templates/build/stage.yml +++ b/tools/devops/automation/templates/build/stage.yml @@ -98,7 +98,6 @@ jobs: steps: - template: build.yml parameters: - isPR: ${{ or(eq(variables['Build.Reason'], 'PullRequest'), and(eq(variables['Build.SourceBranchName'], 'merge'), or(eq(variables['Build.Reason'], 'Manual'), eq(variables['Build.Reason'], 'IndividualCI')))) }} runTests: ${{ parameters.runTests }} runDeviceTests: ${{ parameters.runDeviceTests }} vsdropsPrefix: ${{ parameters.vsdropsPrefix }} diff --git a/tools/devops/automation/templates/release/vs-insertion-prep.yml b/tools/devops/automation/templates/release/vs-insertion-prep.yml new file mode 100644 index 000000000000..279bcb76d689 --- /dev/null +++ b/tools/devops/automation/templates/release/vs-insertion-prep.yml @@ -0,0 +1,66 @@ +parameters: +- name: enableDotnet + type: boolean + default: true + +- name: dependsOn + type: string + default: build_packages + +stages: +- stage: prepare_release + displayName: Prepare Release + dependsOn: ${{ parameters.dependsOn }} + condition: and(or(eq(dependencies.${{ parameters.dependsOn }}.result, 'Succeeded'), eq(dependencies.${{ parameters.dependsOn }}.result, 'SucceededWithIssues')), eq(variables.IsPRBuild, 'False'), eq(${{ parameters.enableDotnet }}, true)) + jobs: + # Check - "xamarin-macios (Prepare Release Sign NuGets)" + - template: sign-artifacts/jobs/v2.yml@templates + parameters: + artifactName: package + signType: Real + usePipelineArtifactTasks: true + + # Check - "xamarin-macios (Prepare Release Convert NuGet to MSI)" + - template: nuget-msi-convert/job/v1.yml@templates + parameters: + yamlResourceName: templates + dependsOn: signing + artifactName: nuget-signed + artifactPatterns: | + Microsoft.NET.Sdk.iOS.Manifest*.nupkg + Microsoft.NET.Sdk.MacCatalyst.Manifest*.nupkg + Microsoft.iOS*.nupkg + Microsoft.MacCatalyst*.nupkg + propsArtifactName: package + signType: Real + + # Check - "xamarin-macios (Prepare Release Push NuGets)" + - job: push_signed_nugets + displayName: Push NuGets + dependsOn: signing + variables: + skipNugetSecurityAnalysis: true + pool: + vmImage: macOS-10.15 + steps: + - task: DownloadPipelineArtifact@2 + inputs: + artifactName: nuget-signed + downloadPath: $(Build.SourcesDirectory)/package + patterns: | + *.nupkg + + - task: NuGetCommand@2 + displayName: Publish Nugets to xamarin-impl + inputs: + command: push + packagesToPush: $(Build.SourcesDirectory)/package/*.nupkg + nuGetFeedType: external + publishFeedCredentials: xamarin-impl public feed + +# Check - "xamarin-macios (VS Insertion Wait For Approval)" +# Check - "xamarin-macios (VS Insertion Create VS Drop and Open PR)" +- template: vs-insertion/stage/v1.yml@templates + parameters: + dependsOn: prepare_release + condition: eq(variables.IsPRBuild, 'False') From 4d329df138db64fb6c74913374f5d3e554327a45 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Tue, 20 Jul 2021 12:39:39 -0700 Subject: [PATCH 6/8] [GameController] Add support for xcode 13 beta3. (#12144) Co-authored-by: Rolf Bjarne Kvinge --- src/gamecontroller.cs | 36 +++++++++++++++---- .../MacCatalyst-GameController.todo | 11 ------ tests/xtro-sharpie/iOS-GameController.todo | 11 ------ tests/xtro-sharpie/macOS-GameController.todo | 5 --- tests/xtro-sharpie/tvOS-GameController.todo | 5 --- 5 files changed, 30 insertions(+), 38 deletions(-) delete mode 100644 tests/xtro-sharpie/MacCatalyst-GameController.todo delete mode 100644 tests/xtro-sharpie/iOS-GameController.todo delete mode 100644 tests/xtro-sharpie/macOS-GameController.todo delete mode 100644 tests/xtro-sharpie/tvOS-GameController.todo diff --git a/src/gamecontroller.cs b/src/gamecontroller.cs index d590f760c19b..7a25bfb54227 100644 --- a/src/gamecontroller.cs +++ b/src/gamecontroller.cs @@ -1995,6 +1995,26 @@ enum GCInputDirectional { [Field ("GCInputDirectionalCardinalDpad")] CardinalDpad, + + [TV (15, 0), Mac (12, 0), iOS (15, 0), MacCatalyst (15,0)] + [Field ("GCInputDirectionalCenterButton")] + CenterButton, + + [TV (15, 0), Mac (12, 0), iOS (15, 0), MacCatalyst (15,0)] + [Field ("GCInputDirectionalTouchSurfaceButton")] + TouchSurfaceButton, + } + + [TV (15, 0), Mac (12, 0), iOS (15, 0), MacCatalyst (15,0)] + enum GCInputMicroGamepad { + [Field ("GCInputMicroGamepadDpad")] + Dpad, + + [Field ("GCInputMicroGamepadButtonA")] + ButtonA, + + [Field ("GCInputMicroGamepadButtonX")] + ButtonX, } delegate GCVirtualControllerElementConfiguration GCVirtualControllerElementUpdateBlock (GCVirtualControllerElementConfiguration configuration); @@ -2008,8 +2028,12 @@ interface GCVirtualController [Export ("virtualControllerWithConfiguration:")] GCVirtualController Create (GCVirtualControllerConfiguration configuration); + [Export ("initWithConfiguration:")] + [DesignatedInitializer] + IntPtr Constructor (GCVirtualControllerConfiguration configuration); + [Async] - [Export ("connectWithReply:")] + [Export ("connectWithReplyHandler:")] void Connect ([NullAllowed] Action reply); [Export ("disconnect")] @@ -2018,8 +2042,8 @@ interface GCVirtualController [NullAllowed, Export ("controller", ArgumentSemantic.Weak)] GCController Controller { get; } - [Export ("changeElement:configuration:")] - void Change (string element, GCVirtualControllerElementUpdateBlock configuration); + [Export ("updateConfigurationForElement:configuration:")] + void UpdateConfiguration (string element, GCVirtualControllerElementUpdateBlock configuration); } [NoTV, NoMac, NoWatch, iOS (15,0), MacCatalyst (15,0)] @@ -2035,12 +2059,12 @@ interface GCVirtualControllerConfiguration interface GCVirtualControllerElementConfiguration { [Export ("hidden")] - bool Hidden { get; set; } + bool Hidden { [Bind ("isHidden")] get; set; } [NullAllowed, Export ("path", ArgumentSemantic.Strong)] BezierPath Path { get; set; } - [Export ("touchpad")] - bool Touchpad { get; set; } + [Export ("actsAsTouchpad")] + bool ActsAsTouchpad { get; set; } } } diff --git a/tests/xtro-sharpie/MacCatalyst-GameController.todo b/tests/xtro-sharpie/MacCatalyst-GameController.todo deleted file mode 100644 index 4527b6accfb2..000000000000 --- a/tests/xtro-sharpie/MacCatalyst-GameController.todo +++ /dev/null @@ -1,11 +0,0 @@ -!missing-field! GCInputDirectionalCenterButton not bound -!missing-field! GCInputDirectionalTouchSurfaceButton not bound -!missing-field! GCInputMicroGamepadButtonA not bound -!missing-field! GCInputMicroGamepadButtonX not bound -!missing-field! GCInputMicroGamepadDpad not bound -!missing-selector! GCVirtualController::connectWithReplyHandler: not bound -!missing-selector! GCVirtualController::initWithConfiguration: not bound -!missing-selector! GCVirtualController::updateConfigurationForElement:configuration: not bound -!missing-selector! GCVirtualControllerElementConfiguration::actsAsTouchpad not bound -!missing-selector! GCVirtualControllerElementConfiguration::isHidden not bound -!missing-selector! GCVirtualControllerElementConfiguration::setActsAsTouchpad: not bound diff --git a/tests/xtro-sharpie/iOS-GameController.todo b/tests/xtro-sharpie/iOS-GameController.todo deleted file mode 100644 index 4527b6accfb2..000000000000 --- a/tests/xtro-sharpie/iOS-GameController.todo +++ /dev/null @@ -1,11 +0,0 @@ -!missing-field! GCInputDirectionalCenterButton not bound -!missing-field! GCInputDirectionalTouchSurfaceButton not bound -!missing-field! GCInputMicroGamepadButtonA not bound -!missing-field! GCInputMicroGamepadButtonX not bound -!missing-field! GCInputMicroGamepadDpad not bound -!missing-selector! GCVirtualController::connectWithReplyHandler: not bound -!missing-selector! GCVirtualController::initWithConfiguration: not bound -!missing-selector! GCVirtualController::updateConfigurationForElement:configuration: not bound -!missing-selector! GCVirtualControllerElementConfiguration::actsAsTouchpad not bound -!missing-selector! GCVirtualControllerElementConfiguration::isHidden not bound -!missing-selector! GCVirtualControllerElementConfiguration::setActsAsTouchpad: not bound diff --git a/tests/xtro-sharpie/macOS-GameController.todo b/tests/xtro-sharpie/macOS-GameController.todo deleted file mode 100644 index b4b4b4500e69..000000000000 --- a/tests/xtro-sharpie/macOS-GameController.todo +++ /dev/null @@ -1,5 +0,0 @@ -!missing-field! GCInputDirectionalCenterButton not bound -!missing-field! GCInputDirectionalTouchSurfaceButton not bound -!missing-field! GCInputMicroGamepadButtonA not bound -!missing-field! GCInputMicroGamepadButtonX not bound -!missing-field! GCInputMicroGamepadDpad not bound diff --git a/tests/xtro-sharpie/tvOS-GameController.todo b/tests/xtro-sharpie/tvOS-GameController.todo deleted file mode 100644 index b4b4b4500e69..000000000000 --- a/tests/xtro-sharpie/tvOS-GameController.todo +++ /dev/null @@ -1,5 +0,0 @@ -!missing-field! GCInputDirectionalCenterButton not bound -!missing-field! GCInputDirectionalTouchSurfaceButton not bound -!missing-field! GCInputMicroGamepadButtonA not bound -!missing-field! GCInputMicroGamepadButtonX not bound -!missing-field! GCInputMicroGamepadDpad not bound From c138cce7babc94ba135ef4001835da827bb2e839 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Tue, 20 Jul 2021 12:42:56 -0700 Subject: [PATCH 7/8] [ImageIO] Add support for Xcode 13 beta 3. (#12145) --- src/imageio.cs | 3 +++ tests/xtro-sharpie/MacCatalyst-ImageIO.todo | 1 - tests/xtro-sharpie/iOS-ImageIO.todo | 1 - tests/xtro-sharpie/macOS-ImageIO.todo | 1 - tests/xtro-sharpie/tvOS-ImageIO.todo | 1 - tests/xtro-sharpie/watchOS-ImageIO.todo | 1 - 6 files changed, 3 insertions(+), 5 deletions(-) delete mode 100644 tests/xtro-sharpie/MacCatalyst-ImageIO.todo delete mode 100644 tests/xtro-sharpie/iOS-ImageIO.todo delete mode 100644 tests/xtro-sharpie/macOS-ImageIO.todo delete mode 100644 tests/xtro-sharpie/tvOS-ImageIO.todo delete mode 100644 tests/xtro-sharpie/watchOS-ImageIO.todo diff --git a/src/imageio.cs b/src/imageio.cs index d71b42e4b289..3d3a220d1385 100644 --- a/src/imageio.cs +++ b/src/imageio.cs @@ -576,6 +576,9 @@ interface CGImageProperties { NSString PNGSoftware { get; } [Field ("kCGImagePropertyPNGTitle")] NSString PNGTitle { get; } + [Mac (12, 0), iOS (15, 0), TV (15,0), MacCatalyst (15,0), Watch (8,0)] + [Field ("kCGImagePropertyPNGPixelsAspectRatio")] + NSString PNGPixelsAspectRatio { get; } [iOS (9,0)][Mac (10,11)] [Field ("kCGImagePropertyPNGCompressionFilter")] diff --git a/tests/xtro-sharpie/MacCatalyst-ImageIO.todo b/tests/xtro-sharpie/MacCatalyst-ImageIO.todo deleted file mode 100644 index b5a8ec1f4414..000000000000 --- a/tests/xtro-sharpie/MacCatalyst-ImageIO.todo +++ /dev/null @@ -1 +0,0 @@ -!missing-field! kCGImagePropertyPNGPixelsAspectRatio not bound diff --git a/tests/xtro-sharpie/iOS-ImageIO.todo b/tests/xtro-sharpie/iOS-ImageIO.todo deleted file mode 100644 index b5a8ec1f4414..000000000000 --- a/tests/xtro-sharpie/iOS-ImageIO.todo +++ /dev/null @@ -1 +0,0 @@ -!missing-field! kCGImagePropertyPNGPixelsAspectRatio not bound diff --git a/tests/xtro-sharpie/macOS-ImageIO.todo b/tests/xtro-sharpie/macOS-ImageIO.todo deleted file mode 100644 index b5a8ec1f4414..000000000000 --- a/tests/xtro-sharpie/macOS-ImageIO.todo +++ /dev/null @@ -1 +0,0 @@ -!missing-field! kCGImagePropertyPNGPixelsAspectRatio not bound diff --git a/tests/xtro-sharpie/tvOS-ImageIO.todo b/tests/xtro-sharpie/tvOS-ImageIO.todo deleted file mode 100644 index b5a8ec1f4414..000000000000 --- a/tests/xtro-sharpie/tvOS-ImageIO.todo +++ /dev/null @@ -1 +0,0 @@ -!missing-field! kCGImagePropertyPNGPixelsAspectRatio not bound diff --git a/tests/xtro-sharpie/watchOS-ImageIO.todo b/tests/xtro-sharpie/watchOS-ImageIO.todo deleted file mode 100644 index b5a8ec1f4414..000000000000 --- a/tests/xtro-sharpie/watchOS-ImageIO.todo +++ /dev/null @@ -1 +0,0 @@ -!missing-field! kCGImagePropertyPNGPixelsAspectRatio not bound From eea8142e6ba6a8c63f0fb1cc5493e1e0d923d24a Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Tue, 20 Jul 2021 13:17:13 -0700 Subject: [PATCH 8/8] Revert "[CI] Add Prepare Release and VS Insertion stages (#12015)" (#12156) This reverts commit 09f911b504ec9b803eb6d725cca14cc7d3ed986e. The comit made changes in the logic that is used to build the PRs in public bots meaning that all PRs fail. --- dotnet/Makefile | 34 ++++------ dotnet/Workloads/SignList.xml | 25 ------- dotnet/Workloads/vs-workload.template.props | 16 ----- ...WorkloadManifest.MacCatalyst.template.json | 2 +- .../WorkloadManifest.iOS.template.json | 2 +- .../WorkloadManifest.macOS.template.json | 2 +- .../WorkloadManifest.tvOS.template.json | 2 +- tools/devops/automation/build-pipeline.yml | 6 -- .../automation/scripts/bash/build-nugets.sh | 2 - .../automation/templates/build/build.yml | 13 ++-- .../templates/build/publish-nugets.yml | 10 +++ .../templates/build/sign-and-notarized.yml | 43 +++++++++--- .../automation/templates/build/stage.yml | 1 + .../templates/release/vs-insertion-prep.yml | 66 ------------------- 14 files changed, 70 insertions(+), 154 deletions(-) delete mode 100644 dotnet/Workloads/SignList.xml delete mode 100644 dotnet/Workloads/vs-workload.template.props delete mode 100644 tools/devops/automation/templates/release/vs-insertion-prep.yml diff --git a/dotnet/Makefile b/dotnet/Makefile index 0d09a8b49713..9e1a93104654 100644 --- a/dotnet/Makefile +++ b/dotnet/Makefile @@ -129,18 +129,6 @@ LOCAL_WORKLOAD_TARGETS += Workloads/Microsoft.NET.Sdk.$(1)/LICENSE endef $(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call WorkloadTargets,$(platform),$(shell echo $(platform) | tr A-Z a-z),$($(platform)_NUGET_VERSION_NO_METADATA)))) -$(DOTNET_NUPKG_DIR)/vs-workload.props: Workloads/vs-workload.template.props - $(Q) rm -f $@.tmp - $(Q_GEN) sed \ - $(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),-e "s/@$(platform)_WORKLOAD_VERSION@/$($(platform)_NUGET_VERSION).$($(platform)_NUGET_COMMIT_DISTANCE)/g") \ - -e "s/@PACK_VERSION_LONG@/$(IOS_NUGET_VERSION_NO_METADATA)/g" \ - -e "s/@PACK_VERSION_SHORT@/$(IOS_NUGET_VERSION).$(IOS_NUGET_COMMIT_DISTANCE)/g" \ - $< > $@.tmp - $(Q) mv $@.tmp $@ - -$(DOTNET_NUPKG_DIR)/SignList.xml: Workloads/SignList.xml - $(Q) $(CP) $< $@ - TEMPLATED_FILES = \ $(foreach platform,$(DOTNET_PLATFORMS),Microsoft.$(platform).Sdk/targets/Microsoft.$(platform).Sdk.Versions.props) \ $(foreach platform,$(DOTNET_PLATFORMS),Microsoft.$(platform).Sdk/targets/Microsoft.$(platform).Sdk.SupportedTargetPlatforms.props) \ @@ -156,10 +144,12 @@ $(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call NupkgDefinition,$(platform) # Create the nuget in a temporary directory (nupkgs/) define CreateNuGetTemplate -nupkgs/$(1)$(4).$(2).nupkg: $(TEMPLATED_FILES) $(WORKLOAD_TARGETS) $(3) package/$(1)/package.csproj $(wildcard package/*.csproj) $(wildcard $(DOTNET_DESTDIR)/$(1)/* $(DOTNET_DESTDIR)/$(1)/*/* $(DOTNET_DESTDIR)/$(1)/*/*/* $(DOTNET_DESTDIR)/$(1)/*/*/*/*) global.json .stamp-workaround-for-maccore-issue-2427 +nupkgs/$(1)$(4).$(2)+$(NUGET_BUILD_METADATA).nupkg: $(TEMPLATED_FILES) $(WORKLOAD_TARGETS) $(3) package/$(1)/package.csproj $(wildcard package/*.csproj) $(wildcard $(DOTNET_DESTDIR)/$(1)/* $(DOTNET_DESTDIR)/$(1)/*/* $(DOTNET_DESTDIR)/$(1)/*/*/* $(DOTNET_DESTDIR)/$(1)/*/*/*/*) global.json .stamp-workaround-for-maccore-issue-2427 @# Delete any versions of the nuget we're building $$(Q) rm -f nupkgs/$(1).*.nupkg $$(Q_PACK) $(DOTNET6) pack package/$(1)/package.csproj -p:VersionBand=$(DOTNET6_VERSION_BAND) --output "$$(dir $$@)" $(DOTNET_PACK_VERBOSITY) "/bl:$$@.binlog" + @# Nuget pack doesn't add the metadata to the filename, but we want that, so rename nuget to contain the full name + $$(Q) mv "nupkgs/$(1)$(4).$(2).nupkg" "$$@" @# Clean the local feed $$(Q_NUGET_DEL) if test -d $(DOTNET_FEED_DIR)/$(shell echo $(1) | tr A-Z a-z)/$(2); then nuget delete $(1) $(2) -source $(abspath $(DOTNET_FEED_DIR)) -NonInteractive $(NUGET_VERBOSITY); fi @# Add the nupkg to our local feed @@ -167,10 +157,12 @@ nupkgs/$(1)$(4).$(2).nupkg: $(TEMPLATED_FILES) $(WORKLOAD_TARGETS) $(3) package/ endef define CreateWindowsNuGetTemplate -nupkgs/$(1).$(2).nupkg: $(3) $(WORKLOAD_TARGETS) package/$(1)/package.csproj $(wildcard package/*.csproj) $(wildcard $(DOTNET_DESTDIR)/$(1)/* $(DOTNET_DESTDIR)/$(1)/*/* $(DOTNET_DESTDIR)/$(1)/*/*/* $(DOTNET_DESTDIR)/$(1)/*/*/*/*) global.json .stamp-workaround-for-maccore-issue-2427 +nupkgs/$(1).$(2)+$(NUGET_BUILD_METADATA).nupkg: $(3) $(WORKLOAD_TARGETS) package/$(1)/package.csproj $(wildcard package/*.csproj) $(wildcard $(DOTNET_DESTDIR)/$(1)/* $(DOTNET_DESTDIR)/$(1)/*/* $(DOTNET_DESTDIR)/$(1)/*/*/* $(DOTNET_DESTDIR)/$(1)/*/*/*/*) global.json .stamp-workaround-for-maccore-issue-2427 @# Delete any versions of the nuget we're building $$(Q) rm -f nupkgs/$(1).*.nupkg $$(Q_PACK) $(DOTNET6) pack package/$(1)/package.csproj --output "$$(dir $$@)" $(DOTNET_PACK_VERBOSITY) "/bl:$$@.binlog" + @# Nuget pack doesn't add the metadata to the filename, but we want that, so rename nuget to contain the full name + $$(Q) mv "nupkgs/$(1).$(2).nupkg" "$$@" @# Clean the local feed $$(Q_NUGET_DEL) if test -d $(DOTNET_FEED_DIR)/$(shell echo $(1) | tr A-Z a-z)/$(2); then nuget delete $(1) $(2) -source $(abspath $(DOTNET_FEED_DIR)) -NonInteractive $(NUGET_VERBOSITY); fi @# Add the nupkg to our local feed @@ -190,28 +182,28 @@ $(DOTNET_NUPKG_DIR)/%.nupkg: nupkgs/%.nupkg | $(DOTNET_NUPKG_DIR) $(Q) $(CP) $< $@ ifdef INCLUDE_IOS -SDK_PACK_IOS_WINDOWS = $(DOTNET_NUPKG_DIR)/$(IOS_WINDOWS_NUGET).Sdk.$(IOS_WINDOWS_NUGET_VERSION_NO_METADATA).nupkg +SDK_PACK_IOS_WINDOWS = $(DOTNET_NUPKG_DIR)/$(IOS_WINDOWS_NUGET).Sdk.$(IOS_WINDOWS_NUGET_VERSION_FULL).nupkg SDK_PACKS += $(SDK_PACK_IOS_WINDOWS) endif pack-ios-windows: $(SDK_PACK_IOS_WINDOWS) define PacksDefinitions -RUNTIME_PACKS_$(1) = $$(foreach rid,$$(DOTNET_$(1)_RUNTIME_IDENTIFIERS),$(DOTNET_NUPKG_DIR)/$($(1)_NUGET).Runtime.$$(rid).$($(1)_NUGET_VERSION_NO_METADATA).nupkg) +RUNTIME_PACKS_$(1) = $$(foreach rid,$$(DOTNET_$(1)_RUNTIME_IDENTIFIERS),$(DOTNET_NUPKG_DIR)/$($(1)_NUGET).Runtime.$$(rid).$($(1)_NUGET_VERSION_FULL).nupkg) RUNTIME_PACKS += $$(RUNTIME_PACKS_$(1)) -REF_PACKS_$(1) = $(DOTNET_NUPKG_DIR)/$($(1)_NUGET).Ref.$($(1)_NUGET_VERSION_NO_METADATA).nupkg +REF_PACKS_$(1) = $(DOTNET_NUPKG_DIR)/$($(1)_NUGET).Ref.$($(1)_NUGET_VERSION_FULL).nupkg REF_PACKS += $$(REF_PACKS_$(1)) -SDK_PACKS_$(1) = $(DOTNET_NUPKG_DIR)/$($(1)_NUGET).Sdk.$($(1)_NUGET_VERSION_NO_METADATA).nupkg +SDK_PACKS_$(1) = $(DOTNET_NUPKG_DIR)/$($(1)_NUGET).Sdk.$($(1)_NUGET_VERSION_FULL).nupkg SDK_PACKS += $$(SDK_PACKS_$(1)) -TEMPLATE_PACKS_$(1) = $(DOTNET_NUPKG_DIR)/$($(1)_NUGET).Templates.$($(1)_NUGET_VERSION_NO_METADATA).nupkg +TEMPLATE_PACKS_$(1) = $(DOTNET_NUPKG_DIR)/$($(1)_NUGET).Templates.$($(1)_NUGET_VERSION_FULL).nupkg TEMPLATE_PACKS += $$(TEMPLATE_PACKS_$(1)) -WORKLOAD_PACKS_$(1) = $(DOTNET_NUPKG_DIR)/$(subst Microsoft.,Microsoft.NET.Sdk.,$($(1)_NUGET)).Manifest-$(DOTNET6_VERSION_BAND).$($(1)_NUGET_VERSION_NO_METADATA).nupkg +WORKLOAD_PACKS_$(1) = $(DOTNET_NUPKG_DIR)/$(subst Microsoft.,Microsoft.NET.Sdk.,$($(1)_NUGET)).Manifest-$(DOTNET6_VERSION_BAND).$($(1)_NUGET_VERSION_FULL).nupkg WORKLOAD_PACKS += $$(WORKLOAD_PACKS_$(1)) pack-$(shell echo $(1) | tr A-Z a-z): $$(RUNTIME_PACKS_$(1)) $$(REF_PACKS_$(1)) $$(SDK_PACKS_$(1)) $$(TEMPLATE_PACKS_$(1)) $$(WORKLOAD_PACKS_$(1)) endef $(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(eval $(call PacksDefinitions,$(platform)))) -TARGETS += $(RUNTIME_PACKS) $(REF_PACKS) $(SDK_PACKS) $(TEMPLATE_PACKS) $(WORKLOAD_PACKS) $(DOTNET_NUPKG_DIR)/vs-workload.props $(DOTNET_NUPKG_DIR)/SignList.xml +TARGETS += $(RUNTIME_PACKS) $(REF_PACKS) $(SDK_PACKS) $(TEMPLATE_PACKS) $(WORKLOAD_PACKS) define InstallWorkload # .NET comes with a workload for us, but we don't want that, we want our own. So delete the workload that comes with .NET. diff --git a/dotnet/Workloads/SignList.xml b/dotnet/Workloads/SignList.xml deleted file mode 100644 index cecbdf381152..000000000000 --- a/dotnet/Workloads/SignList.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dotnet/Workloads/vs-workload.template.props b/dotnet/Workloads/vs-workload.template.props deleted file mode 100644 index cdb3ef238dd1..000000000000 --- a/dotnet/Workloads/vs-workload.template.props +++ /dev/null @@ -1,16 +0,0 @@ - - - - Microsoft.NET.Sdk.MaciOS.Workload - - - - - @PACK_VERSION_SHORT@ - - - - - - - diff --git a/dotnet/targets/WorkloadManifest.MacCatalyst.template.json b/dotnet/targets/WorkloadManifest.MacCatalyst.template.json index 1eba2462ed3b..fd9310ace4bd 100644 --- a/dotnet/targets/WorkloadManifest.MacCatalyst.template.json +++ b/dotnet/targets/WorkloadManifest.MacCatalyst.template.json @@ -2,7 +2,7 @@ "version": "@VERSION@", "workloads": { "@PLATFORM_LOWERCASE@": { - "description": ".NET SDK Workload for building macOS applications with @PLATFORM@.", + "description": "Microsoft @PLATFORM@ SDK for .NET", "packs": [ "Microsoft.@PLATFORM@.Sdk", "Microsoft.@PLATFORM@.Ref", diff --git a/dotnet/targets/WorkloadManifest.iOS.template.json b/dotnet/targets/WorkloadManifest.iOS.template.json index e476d668982c..92c4541080c3 100644 --- a/dotnet/targets/WorkloadManifest.iOS.template.json +++ b/dotnet/targets/WorkloadManifest.iOS.template.json @@ -2,7 +2,7 @@ "version": "@VERSION@", "workloads": { "@PLATFORM_LOWERCASE@": { - "description": ".NET SDK Workload for building @PLATFORM@ applications.", + "description": "Microsoft @PLATFORM@ SDK for .NET", "packs": [ "Microsoft.@PLATFORM@.Sdk", "Microsoft.@PLATFORM@.Windows.Sdk", diff --git a/dotnet/targets/WorkloadManifest.macOS.template.json b/dotnet/targets/WorkloadManifest.macOS.template.json index 3a3cebc5bde8..74158a75445f 100644 --- a/dotnet/targets/WorkloadManifest.macOS.template.json +++ b/dotnet/targets/WorkloadManifest.macOS.template.json @@ -2,7 +2,7 @@ "version": "@VERSION@", "workloads": { "@PLATFORM_LOWERCASE@": { - "description": ".NET SDK Workload for building @PLATFORM@ applications.", + "description": "Microsoft @PLATFORM@ SDK for .NET", "packs": [ "Microsoft.@PLATFORM@.Sdk", "Microsoft.@PLATFORM@.Ref", diff --git a/dotnet/targets/WorkloadManifest.tvOS.template.json b/dotnet/targets/WorkloadManifest.tvOS.template.json index 4d4dfd16d0c0..53066388a287 100644 --- a/dotnet/targets/WorkloadManifest.tvOS.template.json +++ b/dotnet/targets/WorkloadManifest.tvOS.template.json @@ -2,7 +2,7 @@ "version": "@VERSION@", "workloads": { "@PLATFORM_LOWERCASE@": { - "description": ".NET SDK Workload for building @PLATFORM@ applications.", + "description": "Microsoft @PLATFORM@ SDK for .NET", "packs": [ "Microsoft.@PLATFORM@.Sdk", "Microsoft.@PLATFORM@.Ref", diff --git a/tools/devops/automation/build-pipeline.yml b/tools/devops/automation/build-pipeline.yml index 5f5cdd648c1e..eb281cbd99ac 100644 --- a/tools/devops/automation/build-pipeline.yml +++ b/tools/devops/automation/build-pipeline.yml @@ -160,8 +160,6 @@ variables: value: 'VSEng-Xamarin-RedmondMacBuildPool-iOS-Trusted' - name: CIBuildPoolUrl value: 'https://devdiv.visualstudio.com/_settings/agentpools?poolId=367&view=agents' -- name: IsPRBuild - value: ${{ or(eq(variables['Build.Reason'], 'PullRequest'), and(eq(variables['Build.SourceBranchName'], 'merge'), or(eq(variables['Build.Reason'], 'Manual'), eq(variables['Build.Reason'], 'IndividualCI')))) }} trigger: branches: @@ -243,10 +241,6 @@ stages: xqaCertPass: $(xqa--certificates--password) enableDotnet: ${{ parameters.enableDotnet }} -# .NET 6 Release Prep and VS Insertion Stages -- template: templates/release/vs-insertion-prep.yml - -# Test stages - ${{ if eq(parameters.runDeviceTests, true) }}: - ${{ if and(ne(variables['Build.Reason'], 'Schedule'), or(eq(variables['Build.Reason'], 'IndividualCI'), eq(variables['Build.Reason'], 'Manual'))) }}: - ${{ each config in parameters.deviceTestsConfigurations }}: diff --git a/tools/devops/automation/scripts/bash/build-nugets.sh b/tools/devops/automation/scripts/bash/build-nugets.sh index 831afb0985ff..7b9db9880249 100755 --- a/tools/devops/automation/scripts/bash/build-nugets.sh +++ b/tools/devops/automation/scripts/bash/build-nugets.sh @@ -13,8 +13,6 @@ DOTNET_NUPKG_DIR=$(make -C tools/devops print-abspath-variable VARIABLE=DOTNET_N mkdir -p ../package/ rm -f ../package/*.nupkg cp -c "$DOTNET_NUPKG_DIR"/*.nupkg ../package/ -cp -c "$DOTNET_NUPKG_DIR"/vs-workload.props ../package/ -cp -c "$DOTNET_NUPKG_DIR"/SignList.xml ../package/ DOTNET_PKG_DIR=$(make -C tools/devops print-abspath-variable VARIABLE=DOTNET_PKG_DIR | grep "^DOTNET_PKG_DIR=" | sed -e 's/^DOTNET_PKG_DIR=//') make -C dotnet package -j diff --git a/tools/devops/automation/templates/build/build.yml b/tools/devops/automation/templates/build/build.yml index 7f9459e2bef4..703e71cbc6e5 100644 --- a/tools/devops/automation/templates/build/build.yml +++ b/tools/devops/automation/templates/build/build.yml @@ -7,6 +7,10 @@ parameters: type: boolean default: true +- name: isPR + type: boolean + default: false + - name: vsdropsPrefix type: string @@ -324,10 +328,11 @@ steps: - template: build-nugets.yml # only sign an notarize in no PR executions -- template: sign-and-notarized.yml - parameters: - enableDotnet: ${{ parameters.enableDotnet }} - keyringPass: ${{ parameters.keyringPass }} +- ${{ if ne(parameters.isPR, 'True') }}: + - template: sign-and-notarized.yml + parameters: + enableDotnet: ${{ parameters.enableDotnet }} + keyringPass: ${{ parameters.keyringPass }} # publish nugets (must be done after signing) - ${{ if eq(parameters.enableDotnet, true) }}: diff --git a/tools/devops/automation/templates/build/publish-nugets.yml b/tools/devops/automation/templates/build/publish-nugets.yml index c164530b11d4..033b65fb5729 100644 --- a/tools/devops/automation/templates/build/publish-nugets.yml +++ b/tools/devops/automation/templates/build/publish-nugets.yml @@ -4,6 +4,16 @@ steps: # do not publish on pull requets - ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: + - task: NuGetCommand@2 + displayName: 'Publish Nugets to xamarin-impl' + inputs: + command: push + packagesToPush: $(Build.SourcesDirectory)/package/*.nupkg + nuGetFeedType: external + publishFeedCredentials: xamarin-impl public feed + condition: and(succeeded(), eq(variables['configuration.BuildNugets'], 'True')) + continueOnError: true # should not stop the build since is not official just yet. + - task: NuGetCommand@2 displayName: 'Publish Nugets to dotnet-eng' inputs: diff --git a/tools/devops/automation/templates/build/sign-and-notarized.yml b/tools/devops/automation/templates/build/sign-and-notarized.yml index 415c7fad53c8..53a607eaa4b2 100644 --- a/tools/devops/automation/templates/build/sign-and-notarized.yml +++ b/tools/devops/automation/templates/build/sign-and-notarized.yml @@ -12,9 +12,6 @@ parameters: - name: keyringPass type: string -- name: condition - default: and(succeeded(), eq(variables['IsPRBuild'], 'False')) - steps: - bash: | @@ -85,7 +82,7 @@ steps: echo "Microsoft.MacCatalyst package found at $MACCATALYST_DOTNET_PKG" fi displayName: 'Retrieve packages to sign' - condition: and(${{ parameters.condition }}, contains(variables['configuration.BuildPkgs'], 'True')) + condition: and(succeeded(), contains(variables['configuration.BuildPkgs'], 'True')) timeoutInMinutes: 180 - task: MicroBuildSigningPlugin@3 @@ -96,8 +93,7 @@ steps: zipSources: false # we do not use the feature and makes the installation to last 10/12 mins instead of < 1 min env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) - condition: ${{ parameters.condition }} - + - ${{ if eq(parameters.enableDotnet, true) }}: - pwsh : | # Get the list of files to sign @@ -128,7 +124,37 @@ steps: ConvertTo-Json -InputObject $SignFileList -Depth 5 | Out-File -FilePath $(Build.ArtifactStagingDirectory)/MsiFiles2Notarize.json -Force dotnet $Env:MBSIGN_APPFOLDER/ddsignfiles.dll /filelist:$(Build.ArtifactStagingDirectory)/MsiFiles2Notarize.json displayName: 'Sign .msi' - condition: ${{ parameters.condition }} + +- ${{ if eq(parameters.enableDotnet, true) }}: + - pwsh : | + # Get the list of files to sign + $nupkgFiles = Get-ChildItem -Path $(Build.SourcesDirectory)/package/ -Filter "*.nupkg" + + # Add those files to an array + $SignFiles = @() + foreach($nupkg in $nupkgFiles) { + Write-Host "$($nupkg.FullName)" + $SignFiles += @{ "SrcPath"="$($nupkg.FullName)"} + } + + Write-Host "$nupkgFiles" + + # array of dicts + $SignFileRecord = @( + @{ + "Certs" = "401405"; + "SignFileList" = $SignFiles; + } + ) + + $SignFileList = @{ + "SignFileRecordList" = $SignFileRecord + } + + # Write the json to a file + ConvertTo-Json -InputObject $SignFileList -Depth 5 | Out-File -FilePath $(Build.ArtifactStagingDirectory)/NupkgFiles2Notarize.json -Force + dotnet $Env:MBSIGN_APPFOLDER/ddsignfiles.dll /filelist:$(Build.ArtifactStagingDirectory)/NupkgFiles2Notarize.json + displayName: 'Sign .nupkg' - bash: | security unlock-keychain -p $PRODUCTSIGN_KEYCHAIN_PASSWORD builder.keychain @@ -149,7 +175,6 @@ steps: name: notarize displayName: 'Signing Release Build' timeoutInMinutes: 90 - condition: ${{ parameters.condition }} - task: ms-vseng.MicroBuildTasks.30666190-6959-11e5-9f96-f56098202fef.MicroBuildSigningPlugin@3 displayName: 'Install Notarizing Plugin' @@ -162,7 +187,6 @@ steps: - pwsh: $(Build.SourcesDirectory)/release-scripts/notarize.ps1 -FolderForApps $(Build.SourcesDirectory)/package/notarized displayName: 'ESRP notarizing packages' - condition: ${{ parameters.condition }} - pwsh: | $notarizedRoot = Join-Path $(Build.SourcesDirectory) package notarized @@ -171,4 +195,3 @@ steps: pkgutil --check-signature "$($_.FullName)" } displayName: 'Verify ESRP notarization' - condition: ${{ parameters.condition }} diff --git a/tools/devops/automation/templates/build/stage.yml b/tools/devops/automation/templates/build/stage.yml index 59726c1559b1..770d4fddcf30 100644 --- a/tools/devops/automation/templates/build/stage.yml +++ b/tools/devops/automation/templates/build/stage.yml @@ -98,6 +98,7 @@ jobs: steps: - template: build.yml parameters: + isPR: ${{ or(eq(variables['Build.Reason'], 'PullRequest'), and(eq(variables['Build.SourceBranchName'], 'merge'), or(eq(variables['Build.Reason'], 'Manual'), eq(variables['Build.Reason'], 'IndividualCI')))) }} runTests: ${{ parameters.runTests }} runDeviceTests: ${{ parameters.runDeviceTests }} vsdropsPrefix: ${{ parameters.vsdropsPrefix }} diff --git a/tools/devops/automation/templates/release/vs-insertion-prep.yml b/tools/devops/automation/templates/release/vs-insertion-prep.yml deleted file mode 100644 index 279bcb76d689..000000000000 --- a/tools/devops/automation/templates/release/vs-insertion-prep.yml +++ /dev/null @@ -1,66 +0,0 @@ -parameters: -- name: enableDotnet - type: boolean - default: true - -- name: dependsOn - type: string - default: build_packages - -stages: -- stage: prepare_release - displayName: Prepare Release - dependsOn: ${{ parameters.dependsOn }} - condition: and(or(eq(dependencies.${{ parameters.dependsOn }}.result, 'Succeeded'), eq(dependencies.${{ parameters.dependsOn }}.result, 'SucceededWithIssues')), eq(variables.IsPRBuild, 'False'), eq(${{ parameters.enableDotnet }}, true)) - jobs: - # Check - "xamarin-macios (Prepare Release Sign NuGets)" - - template: sign-artifacts/jobs/v2.yml@templates - parameters: - artifactName: package - signType: Real - usePipelineArtifactTasks: true - - # Check - "xamarin-macios (Prepare Release Convert NuGet to MSI)" - - template: nuget-msi-convert/job/v1.yml@templates - parameters: - yamlResourceName: templates - dependsOn: signing - artifactName: nuget-signed - artifactPatterns: | - Microsoft.NET.Sdk.iOS.Manifest*.nupkg - Microsoft.NET.Sdk.MacCatalyst.Manifest*.nupkg - Microsoft.iOS*.nupkg - Microsoft.MacCatalyst*.nupkg - propsArtifactName: package - signType: Real - - # Check - "xamarin-macios (Prepare Release Push NuGets)" - - job: push_signed_nugets - displayName: Push NuGets - dependsOn: signing - variables: - skipNugetSecurityAnalysis: true - pool: - vmImage: macOS-10.15 - steps: - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: nuget-signed - downloadPath: $(Build.SourcesDirectory)/package - patterns: | - *.nupkg - - - task: NuGetCommand@2 - displayName: Publish Nugets to xamarin-impl - inputs: - command: push - packagesToPush: $(Build.SourcesDirectory)/package/*.nupkg - nuGetFeedType: external - publishFeedCredentials: xamarin-impl public feed - -# Check - "xamarin-macios (VS Insertion Wait For Approval)" -# Check - "xamarin-macios (VS Insertion Create VS Drop and Open PR)" -- template: vs-insertion/stage/v1.yml@templates - parameters: - dependsOn: prepare_release - condition: eq(variables.IsPRBuild, 'False')