Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into mpsgraph
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfbjarne committed May 9, 2022
2 parents eba108c + e9333ba commit a9b1e57
Show file tree
Hide file tree
Showing 24 changed files with 704 additions and 253 deletions.
89 changes: 71 additions & 18 deletions Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -78,28 +78,81 @@ else ifneq ($(SYSTEM_PULLREQUEST_PULLREQUESTNUMBER),)
PULL_REQUEST_ID=$(SYSTEM_PULLREQUEST_PULLREQUESTNUMBER)
endif

# For release branches, modify the following variables to hardcode a version name
# Set the NUGET_HARDCODED_PRERELEASE_IDENTIFIER variable to the prerelease identifer you want (say "rc.1")
## NUGET_HARDCODED_PRERELEASE_IDENTIFIER=rc.3
# Set the NUGET_HARDCODED_PRERELEASE_BRANCH variable to the exact name for the branch the above variable should apply to (so that any other branches won't pick it up by accident).
# For the previous example, this would be "release/6.0.2xx-rc1"
# When creating a release branch from main, this must be changed from "main" to the new release branch.
## NUGET_HARDCODED_PRERELEASE_BRANCH=main

# compute the alphanumeric version of the hardcoded prerelease branch
## NUGET_HARDCODED_PRERELEASE_BRANCH_ALPHANUMERIC:=$(shell export LANG=C; printf "%s" "$(NUGET_HARDCODED_PRERELEASE_BRANCH)" | tr -c '[a-zA-Z0-9-]' '-')

# The prerelease identifier is missing the per-product commit distance, which is added below
# DO NOT MODIFY THE BELOW CONDITIONS TO HARDCODE A VERSION NUMBER FOR RELEASE BRANCHES.
# We have three types of branches:
#
# 1. Release (stable) branches. These have stable versioning (no prerelease identifiers).
# 2. Pre-release branches. These have stable versioning + prerelease identifiers.
# 3. Any other branches, These have CI/PR versioning.
#
# * A PR branch (case 3 above) is identified by the PULL_REQUEST_ID variable
# (set in the environment). This takes precedence over any other variable.
# * Otherwise a release branch (case 1 above) is identified by setting the
# NUGET_RELEASE_BRANCH variable to the name of the release branch (this
# seems redundant: why should a branch name itself? but it's important if
# another branch is created from the release branch: that other branch might
# be any other random branch for whatever purpose, and shouldn't be
# considered a release branch just because someone forgot to unset a
# variable).
# * Otherwise a prerelease branch (case 2 above) is identified by the
# NUGET_HARDCODED_PRERELEASE_IDENTIFIER variable, which is used to hardcode
# a prerelease version. Note that NUGET_HARDCODED_PRERELEASE_BRANCH must
# also be set to the name of the current branch, otherwise
# NUGET_HARDCODED_PRERELEASE_IDENTIFIER will be ignored.
# * Otherwise we're a CI branch (case 3 above).

## If this branch is a release branch, set NUGET_RELEASE_BRANCH to the exact branch name (so that any other branches won't become release branches just by branching off from a release branch).
## Example: release/6.0.3xx
# NUGET_RELEASE_BRANCH=

## If this is a pre-release (alpha, beta, rc, xcode, etc.) branch, set NUGET_HARDCODED_PRERELASE_BRANCH to the exact branch name. Also set NUGET_HARDCODED_PRELEASE_IDENTIFIER to the prerelease identifier to use.
## Example:
## NUGET_HARDCODED_PRERELEASE_BRANCH=release/6.0.3xx-rc3
## NUGET_HARDCODED_PRERELEASE_IDENTIFIER=rc.3
## Example 2: we might sometimes make 'main' a prerelease branch:
## NUGET_HARDCODED_PRERELEASE_BRANCH=main
## NUGET_HARDCODED_PRERELEASE_IDENTIFIER=rc.4
## In this case, when we create an actual rc4 branch, the value for
## NUGET_HARDCODED_PRERELEASE_IDENTIFIER in main must be changed to "rc.5" (or
## anything else), while the value for NUGET_HARDCODED_PRERELEASE_BRANCH in
## the rc4 branch will become the rc4 branch name. The value in main must
## change *first*, otherwise we'll produce builds with the same version from
## two different branches (which is very, very bad).
##
# NUGET_HARDCODED_PRERELEASE_IDENTIFIER=rc.3
# NUGET_HARDCODED_PRERELEASE_BRANCH=release/6.0.3xx

# compute the alphanumeric version of branch names
NUGET_RELEASE_BRANCH_ALPHANUMERIC:=$(shell export LANG=C; printf "%s" "$(NUGET_RELEASE_BRANCH)" | tr -c '[a-zA-Z0-9-]' '-')
NUGET_HARDCODED_PRERELEASE_BRANCH_ALPHANUMERIC:=$(shell export LANG=C; printf "%s" "$(NUGET_HARDCODED_PRERELEASE_BRANCH)" | tr -c '[a-zA-Z0-9-]' '-')

# Compute the prerelease identifier based on the variables above
# DO NOT MODIFY THE BELOW CONDITIONS TO HARDCODE A VERSION NUMBER FOR (PRE)RELEASE BRANCHES.
# READ INSTRUCTIONS ABOVE INSTEAD.
ifneq ($(PULL_REQUEST_ID),)
# we're a PR, so PR versioning
NUGET_PRERELEASE_IDENTIFIER=ci.pr.gh$(PULL_REQUEST_ID).
else ifeq ($(NUGETNUGET_RELEASE_BRANCH_ALPHANUMERIC_RELEASE_BRANCH),$(CURRENT_BRANCH_ALPHANUMERIC))
# this is a release branch, so no prerelease identifier
NUGET_PRERELEASE_IDENTIFIER=
else ifeq ($(NUGET_HARDCODED_PRERELEASE_BRANCH_ALPHANUMERIC),$(CURRENT_BRANCH_ALPHANUMERIC))
# this is a prerelease branch!
NUGET_PRERELEASE_IDENTIFIER=$(NUGET_HARDCODED_PRERELEASE_IDENTIFIER).
else
# this is a CI branch!
NUGET_PRERELEASE_IDENTIFIER=ci.$(CURRENT_BRANCH_ALPHANUMERIC).
endif

NUGET_BUILD_METADATA=sha.$(CURRENT_HASH)

# The prerelease identifier is missing the per-product commit distance, which is added here
ifneq ($(NUGET_PRERELEASE_IDENTIFIER),)
IOS_NUGET_PRERELEASE_IDENTIFIER=-$(NUGET_PRERELEASE_IDENTIFIER)$(IOS_NUGET_COMMIT_DISTANCE)
TVOS_NUGET_PRERELEASE_IDENTIFIER=-$(NUGET_PRERELEASE_IDENTIFIER)$(TVOS_NUGET_COMMIT_DISTANCE)
WATCHOSOS_NUGET_PRERELEASE_IDENTIFIER=-$(NUGET_PRERELEASE_IDENTIFIER)$(WATCHOSOS_NUGET_COMMIT_DISTANCE)
MACCATALYST_NUGET_PRERELEASE_IDENTIFIER=-$(NUGET_PRERELEASE_IDENTIFIER)$(MACCATALYST_NUGET_COMMIT_DISTANCE)
MACOS_NUGET_PRERELEASE_IDENTIFIER=-$(NUGET_PRERELEASE_IDENTIFIER)$(MACOS_NUGET_COMMIT_DISTANCE)
endif

IOS_PRODUCT=Xamarin.iOS
IOS_PACKAGE_NAME=Xamarin.iOS
IOS_PACKAGE_NAME_LOWER=$(shell echo $(IOS_PACKAGE_NAME) | tr "[:upper:]" "[:lower:]")
Expand All @@ -113,7 +166,7 @@ IOS_NUGET=Microsoft.iOS
IOS_NUGET_VERSION_MAJOR=$(word 1, $(subst ., ,$(IOS_NUGET_VERSION)))
IOS_NUGET_VERSION_MINOR=$(word 2, $(subst ., ,$(IOS_NUGET_VERSION)))
IOS_NUGET_VERSION_PATCH=$(word 3, $(subst ., ,$(IOS_NUGET_VERSION)))
IOS_NUGET_VERSION_NO_METADATA=$(IOS_NUGET_VERSION)-$(NUGET_PRERELEASE_IDENTIFIER)$(IOS_NUGET_COMMIT_DISTANCE)
IOS_NUGET_VERSION_NO_METADATA=$(IOS_NUGET_VERSION)$(IOS_NUGET_PRERELEASE_IDENTIFIER)
IOS_NUGET_VERSION_FULL=$(IOS_NUGET_VERSION_NO_METADATA)+$(NUGET_BUILD_METADATA)

IOS_WINDOWS_NUGET=Microsoft.iOS.Windows
Expand All @@ -127,21 +180,21 @@ TVOS_NUGET=Microsoft.tvOS
TVOS_NUGET_VERSION_MAJOR=$(word 1, $(subst ., ,$(TVOS_NUGET_VERSION)))
TVOS_NUGET_VERSION_MINOR=$(word 2, $(subst ., ,$(TVOS_NUGET_VERSION)))
TVOS_NUGET_VERSION_PATCH=$(word 3, $(subst ., ,$(TVOS_NUGET_VERSION)))
TVOS_NUGET_VERSION_NO_METADATA=$(TVOS_NUGET_VERSION)-$(NUGET_PRERELEASE_IDENTIFIER)$(TVOS_NUGET_COMMIT_DISTANCE)
TVOS_NUGET_VERSION_NO_METADATA=$(TVOS_NUGET_VERSION)$(TVOS_NUGET_PRERELEASE_IDENTIFIER)
TVOS_NUGET_VERSION_FULL=$(TVOS_NUGET_VERSION_NO_METADATA)+$(NUGET_BUILD_METADATA)

WATCHOS_NUGET=Microsoft.watchOS
WATCHOS_NUGET_VERSION_MAJOR=$(word 1, $(subst ., ,$(WATCHOS_NUGET_VERSION)))
WATCHOS_NUGET_VERSION_MINOR=$(word 2, $(subst ., ,$(WATCHOS_NUGET_VERSION)))
WATCHOS_NUGET_VERSION_PATCH=$(word 3, $(subst ., ,$(WATCHOS_NUGET_VERSION)))
WATCHOS_NUGET_VERSION_NO_METADATA=$(WATCHOS_NUGET_VERSION)-$(NUGET_PRERELEASE_IDENTIFIER)$(WATCHOS_NUGET_COMMIT_DISTANCE)
WATCHOS_NUGET_VERSION_NO_METADATA=$(WATCHOS_NUGET_VERSION)$(WATCHOSOS_NUGET_PRERELEASE_IDENTIFIER)
WATCHOS_NUGET_VERSION_FULL=$(WATCHOS_NUGET_VERSION_NO_METADATA)+$(NUGET_BUILD_METADATA)

MACCATALYST_NUGET=Microsoft.MacCatalyst
MACCATALYST_NUGET_VERSION_MAJOR=$(word 1, $(subst ., ,$(MACCATALYST_NUGET_VERSION)))
MACCATALYST_NUGET_VERSION_MINOR=$(word 2, $(subst ., ,$(MACCATALYST_NUGET_VERSION)))
MACCATALYST_NUGET_VERSION_PATCH=$(word 3, $(subst ., ,$(MACCATALYST_NUGET_VERSION)))
MACCATALYST_NUGET_VERSION_NO_METADATA=$(MACCATALYST_NUGET_VERSION)-$(NUGET_PRERELEASE_IDENTIFIER)$(MACCATALYST_NUGET_COMMIT_DISTANCE)
MACCATALYST_NUGET_VERSION_NO_METADATA=$(MACCATALYST_NUGET_VERSION)$(MACCATALYST_NUGET_PRERELEASE_IDENTIFIER)
MACCATALYST_NUGET_VERSION_FULL=$(MACCATALYST_NUGET_VERSION_NO_METADATA)+$(NUGET_BUILD_METADATA)

# Xcode version should have both a major and a minor version (even if the minor version is 0)
Expand Down Expand Up @@ -443,7 +496,7 @@ MACOS_NUGET=Microsoft.macOS
MACOS_NUGET_VERSION_MAJOR=$(word 1, $(subst ., ,$(MACOS_NUGET_VERSION)))
MACOS_NUGET_VERSION_MINOR=$(word 2, $(subst ., ,$(MACOS_NUGET_VERSION)))
MACOS_NUGET_VERSION_PATCH=$(word 3, $(subst ., ,$(MACOS_NUGET_VERSION)))
MACOS_NUGET_VERSION_NO_METADATA=$(MACOS_NUGET_VERSION)-$(NUGET_PRERELEASE_IDENTIFIER)$(MACOS_NUGET_COMMIT_DISTANCE)
MACOS_NUGET_VERSION_NO_METADATA=$(MACOS_NUGET_VERSION)$(MACOS_NUGET_PRERELEASE_IDENTIFIER)
MACOS_NUGET_VERSION_FULL=$(MACOS_NUGET_VERSION_NO_METADATA)+$(NUGET_BUILD_METADATA)

ifneq ($(TESTS_USE_SYSTEM),)
Expand Down
2 changes: 1 addition & 1 deletion NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<!-- Begin: Package sources from dotnet-aspnetcore -->
<!-- End: Package sources from dotnet-aspnetcore -->
<!-- Begin: Package sources from dotnet-runtime -->
<add key="darc-pub-dotnet-runtime-a21b9a2" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-a21b9a2d/nuget/v3/index.json" />
<add key="darc-pub-dotnet-runtime-ac796cb" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-ac796cb1/nuget/v3/index.json" />
<!-- End: Package sources from dotnet-runtime -->
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" protocolVersion="3" />
Expand Down
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="6.0.301-rtm.22253.26">
<Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="6.0.301-rtm.22254.17">
<Uri>https://github.com/dotnet/installer</Uri>
<Sha>49c376098d0e3312475c0fd88a19bdedba1579c0</Sha>
<Sha>3fed194c0b277b0ac0986f92401a50dd6c34f43d</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.ILLink.Tasks" Version="6.0.200-1.22178.2" CoherentParentDependency="Microsoft.Dotnet.Sdk.Internal">
<Uri>https://github.com/dotnet/linker</Uri>
<Sha>01c4f5905959c29f86781b85187bb676fc517ee9</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.App.Ref" Version="6.0.5">
<Dependency Name="Microsoft.NETCore.App.Ref" Version="6.0.6">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>a21b9a2dd4c31cf5bd37626562b7612faf21cee6</Sha>
<Sha>ac796cb1b08987f2b8019f78659431813e1b93c3</Sha>
</Dependency>
<!-- This is required for our test apps to build; in some cases Microsoft.AspNetCore.App is pulled in, and when building test apps the build needs to be able to resolve that -->
<Dependency Name="Microsoft.AspNetCore.App.Ref" Version="6.0.4" CoherentParentDependency="Microsoft.Dotnet.Sdk.Internal">
Expand Down
4 changes: 2 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project>
<!--Package versions-->
<PropertyGroup>
<MicrosoftDotnetSdkInternalPackageVersion>6.0.301-rtm.22253.26</MicrosoftDotnetSdkInternalPackageVersion>
<MicrosoftDotnetSdkInternalPackageVersion>6.0.301-rtm.22254.17</MicrosoftDotnetSdkInternalPackageVersion>
<MicrosoftNETILLinkTasksPackageVersion>6.0.200-1.22178.2</MicrosoftNETILLinkTasksPackageVersion>
<MicrosoftDotNetBuildTasksFeedPackageVersion>6.0.0-beta.21212.6</MicrosoftDotNetBuildTasksFeedPackageVersion>
<MicrosoftNETILStripTasksPackageVersion>6.0.0-rc.2.21468.3</MicrosoftNETILStripTasksPackageVersion>
<MicrosoftNETCoreAppRefPackageVersion>6.0.5</MicrosoftNETCoreAppRefPackageVersion>
<MicrosoftNETCoreAppRefPackageVersion>6.0.6</MicrosoftNETCoreAppRefPackageVersion>
<MicrosoftNETWorkloadEmscriptenManifest60100PackageVersion>6.0.4</MicrosoftNETWorkloadEmscriptenManifest60100PackageVersion>
<MicrosoftTemplateEngineTasksVersion>7.0.100-alpha.1.21601.1</MicrosoftTemplateEngineTasksVersion>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<MtouchExtraArgs>--registrar:dynamic</MtouchExtraArgs>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Xamarin.iOS.HotRestart.Application" Version="1.1.4" />
<PackageReference Include="Xamarin.iOS.HotRestart.Application" Version="1.1.5" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\appiconfg.png" />
Expand Down
19 changes: 10 additions & 9 deletions msbuild/Xamarin.MacDev.Tasks.Core/Tasks/AOTCompileTaskBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,41 @@
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Text;

using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;

using Xamarin.Localization.MSBuild;
using Xamarin.Utils;

#nullable enable

namespace Xamarin.MacDev.Tasks {
public abstract class AOTCompileTaskBase : XamarinTask {
[Required]
public string AOTCompilerPath { get; set; }
public string AOTCompilerPath { get; set; } = string.Empty;

[Required]
public ITaskItem [] Assemblies { get; set; }
public ITaskItem [] Assemblies { get; set; } = Array.Empty<ITaskItem> ();

[Required]
public string InputDirectory { get; set; }
public string InputDirectory { get; set; } = string.Empty;

[Required]
public string MinimumOSVersion { get; set; }
public string MinimumOSVersion { get; set; } = string.Empty;

[Required]
public string OutputDirectory { get; set; }
public string OutputDirectory { get; set; } = string.Empty;

[Required]
public string SdkDevPath { get; set; }
public string SdkDevPath { get; set; } = string.Empty;

#region Output
[Output]
public ITaskItem[] AssemblyFiles { get; set; }
public ITaskItem[]? AssemblyFiles { get; set; }

[Output]
public ITaskItem[] FileWrites { get; set; }
public ITaskItem[]? FileWrites { get; set; }
#endregion

public override bool Execute ()
Expand Down
24 changes: 16 additions & 8 deletions src/Foundation/NSUrl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
//
using System;

#nullable enable

namespace Foundation {

// Equals(Object) and GetHashCode are provided by NSObject
Expand All @@ -36,25 +38,31 @@ public NSUrl (string path, string relativeToUrl)
}

// but NSUrl has it's own isEqual: selector, which we re-expose in a more .NET-ish way
public bool Equals (NSUrl url)
public bool Equals (NSUrl? url)
{
if (url == null)
if (url is null)
return false;
// we can only ask `isEqual:` to test equality if both objects are direct bindings
return IsDirectBinding && url.IsDirectBinding ? IsEqual (url) : Equals ((object) url);
}

// Converts from an NSURL to a System.Uri
public static implicit operator Uri (NSUrl url)
public static implicit operator Uri? (NSUrl? url)
{
if (url is null) {
return null;
}
if (Uri.TryCreate (url.AbsoluteString, UriKind.Absolute, out var uri))
return uri;
else
return new Uri (url.AbsoluteString, UriKind.Relative);
}

public static implicit operator NSUrl (Uri uri)
public static implicit operator NSUrl? (Uri? uri)
{
if (uri is null) {
return null;
}
if (uri.IsAbsoluteUri)
return new NSUrl (uri.AbsoluteUri);
else
Expand Down Expand Up @@ -104,18 +112,18 @@ public int Port {
}
}

public static bool operator == (NSUrl x, NSUrl y)
public static bool operator == (NSUrl? x, NSUrl? y)
{
if ((object) x == (object) y) // If both are null, or both are same instance, return true.
if ((object?) x == (object?) y) // If both are null, or both are same instance, return true.
return true;

if (((object) x == null) || ((object) y == null)) // If one is null, but not both, return false.
if (x is null || y is null) // If one is null, but not both, return false.
return false;

return x.Equals (y);
}

public static bool operator != (NSUrl x, NSUrl y)
public static bool operator != (NSUrl? x, NSUrl? y)
{
return !(x == y);
}
Expand Down
38 changes: 38 additions & 0 deletions tests/introspection/ApiSelectorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,44 @@ protected virtual bool Skip (Type type, string selectorName)
}
#endif
break;
#if NET
// Incorrect attributes in inlined protocol selectors - https://github.com/xamarin/xamarin-macios/issues/14802
case "NSTextAttachment":
switch (selectorName) {
case "attachmentBoundsForAttributes:location:textContainer:proposedLineFragment:position:":
case "imageForBounds:attributes:location:textContainer:":
case "viewProviderForParentView:location:textContainer:":
return true;
}
break;
// Incorrect attributes in get/set selectors - https://github.com/xamarin/xamarin-macios/issues/14802
case "CBManager":
switch (selectorName) {
case "authorization":
case "authorizations":
return true;
}
break;
case "NEAppProxyFlow":
switch (selectorName) {
case "networkInterface":
case "setNetworkInterface:":
return true;
}
break;
case "WKPreferences":
switch (selectorName) {
case "setTextInteractionEnabled:":
return true;
}
break;
case "MidiCISession":
switch (selectorName) {
case "midiDestination":
return true;
}
break;
#endif
}

// old binding mistake
Expand Down
20 changes: 20 additions & 0 deletions tests/monotouch-test/Network/NSUrlTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#if !__WATCHOS__
using Foundation;
using Network;

using NUnit.Framework;

namespace MonoTouchFixtures.Network {
[TestFixture]
[Preserve (AllMembers = true)]
public class NSUrlTest {
[Test]
public void ImplicitConversion ()
{
global::System.Uri uri = null;
NSUrl sUrl = uri;
Assert.IsNull (sUrl);
}
}
}
#endif
5 changes: 3 additions & 2 deletions tests/xharness/Jenkins/TestTasks/AppleTestTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
using System.IO;
using System.Threading.Tasks;
using Microsoft.DotNet.XHarness.Common.Logging;
#nullable enable

namespace Xharness.Jenkins.TestTasks {
abstract class AppleTestTask : TestTasks, ITestTask
abstract class AppleTestTask : TestTasks
{
public Jenkins Jenkins { get; private set; }
public IHarness Harness { get { return Jenkins.Harness; } }
Expand All @@ -21,7 +22,7 @@ public override string LogDirectory {
}
}

public AppleTestTask (Jenkins jenkins) : base ()
public AppleTestTask (Jenkins jenkins)
{
Jenkins = jenkins ?? throw new ArgumentNullException (nameof (jenkins));
}
Expand Down
Loading

0 comments on commit a9b1e57

Please sign in to comment.