From c2d60b57066b80b58c162de169143031c163dbbc Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Thu, 9 Jan 2025 12:10:26 -0500 Subject: [PATCH 1/8] [CI] Update the configuration scripts to retrieve PRs when a PR build was started by a CI trigger. (#21927) The way we used to calculate the PR Id (from the merge branch) does not apply to CI builds because those have the real branch name created by the user. We update the scripts in the following way: 1. Make a cmdlet for the retrieval of the PR ids from a hash. 2. Update the ExportChangeId to take into account the cases in which the branch does not start with 'merge' 3. Update the config object to take into account the branches that start with dev. --------- Co-authored-by: Rolf Bjarne Kvinge --- tools/devops/automation/scripts/GitHub.psm1 | 88 +++++++++++++++------ tools/devops/automation/scripts/VSTS.psm1 | 46 +++++++---- 2 files changed, 95 insertions(+), 39 deletions(-) diff --git a/tools/devops/automation/scripts/GitHub.psm1 b/tools/devops/automation/scripts/GitHub.psm1 index d6bb72248d3d..45110f9fd839 100644 --- a/tools/devops/automation/scripts/GitHub.psm1 +++ b/tools/devops/automation/scripts/GitHub.psm1 @@ -252,29 +252,7 @@ class GitHubComments { $this.Repo = $githubRepo $this.Token = $githubToken $this.Hash = $hash - $this.PRIds = [GitHubComments]::GetPRIds($githubOrg, $githubRepo, $githubToken, $hash) - } - - static [string[]] GetPRIds([string] $org, [string] $repo, [string] $token, [string] $hash) { - - Write-Host "Getting related PR ids for commit $hash" - - $url = "https://api.github.com/repos/$($org)/$($repo)/commits/$hash/pulls" - - $headers = @{ - Authorization = ("token {0}" -f $token); - } - - $request = Invoke-Request -Request { Invoke-RestMethod -Uri $url -Method "GET" -ContentType 'application/json' -Headers $headers } - Write-Host "Request result: $request" - - # loop over the result and remove all the extra noise we are not interested in - $prs = [System.Collections.ArrayList]@() - foreach ($prInfo in $request) { - Write-Host "Found PR #$($prInfo.number) for commit $hash" - $prs.Add($prInfo.number) - } - return $prs + $this.PRIds = Get-GitHubPRsForHash -Org $githubOrg -Repo $githubRepo -Token $githubToken -Hash $hash } [bool] IsPR() { @@ -865,6 +843,69 @@ function Get-GitHubPRInfo { return $request } +<# + .SYNOPSIS + Get the PR Ids related to a commit hash. If the hash has multiple PRs, all of them will be returned. + If the commit has landed in main, the PRs will be empty. + + .PARAMETER Org + The organization that owns the repository. + + .PARAMETER Repo + The repository where the commit is located. + + .PARAMETER Token + The token to be used to authenticate with the GitHub API. + + .PARAMETER Hash + The hash of the commit whose PRs we want to retrieve. +#> +function Get-GitHubPRsForHash { + param ( + [String] + $Org, + + [String] + $Repo, + + [string] + $Token, + + [Parameter(Mandatory)] + [String] + $Hash + ) + + Write-Host "Getting related PR ids for commit $Hash" + + if ($Org -and $Repo) { + $url = "https://api.github.com/repos/$($Org)/$($Repo)/commits/$Hash/pulls" + } else { + $url = "https://api.github.com/repos/$Env:BUILD_REPOSITORY_NAME/commits/$Hash/pulls" + } + + if (-not $Token) { + $Token = $Env:GITHUB_TOKEN + } + + $headers = @{ + Authorization = ("token {0}" -f $Token); + } + + $request = Invoke-Request -Request { Invoke-RestMethod -Uri $url -Method "GET" -ContentType 'application/json' -Headers $headers } + Write-Host "Request result: $request" + + # loop over the result and remove all the extra noise we are not interested in + $prs = [System.Collections.ArrayList]@() + foreach ($prInfo in $request) { + $number = $prInfo.number + Write-Host "Found PR #$number for commit $hash" + $prs.Add($number) > $null + } + Write-Host "Found $($prs.Count) PRs for commit $hash" + return $prs +} + <# .SYNOPSIS Class used to represent a single file to be added to a gist. @@ -1120,6 +1161,7 @@ function Convert-Markdown { # module exports, any other functions are private and should not be used outside the module. Export-ModuleMember -Function New-GitHubComment Export-ModuleMember -Function Get-GitHubPRInfo +Export-ModuleMember -Function Get-GitHubPRsForHash Export-ModuleMember -Function New-GistWithFiles Export-ModuleMember -Function New-GistObjectDefinition Export-ModuleMember -Function New-GistWithContent diff --git a/tools/devops/automation/scripts/VSTS.psm1 b/tools/devops/automation/scripts/VSTS.psm1 index 10e51bd062d2..0a6821034089 100644 --- a/tools/devops/automation/scripts/VSTS.psm1 +++ b/tools/devops/automation/scripts/VSTS.psm1 @@ -255,7 +255,8 @@ class BuildConfiguration { "BUILD_REPOSITORY_PROVIDER", "BUILD_REPOSITORY_URI", "BUILD_SOURCEBRANCH", - "BUILD_SOURCEBRANCHNAME" + "BUILD_SOURCEBRANCHNAME", + "BUILD_SOURCEVERSION" ) <# @@ -312,7 +313,7 @@ class BuildConfiguration { [void] SetLabelsFromPR ([PSCustomObject] $prInfo, [bool]$isPR) { if ($prInfo) { - Write-Deubg "Setting VSTS labels from $($prInfo.labels)" + Write-Debug "Setting VSTS labels from $($prInfo.labels)" foreach ($l in [BuildConfiguration]::labelsOfInterest) { $labelPresent = 1 -eq ($prInfo.labels | Where-Object { $_.name -eq "$l"}).Count # We need to replace dashes with underscores, because bash can't access an environment variable with a dash in the name. @@ -335,29 +336,42 @@ class BuildConfiguration { .SYNOPSIS Retrieve the change id and export it as an enviroment variable. #> - [string] ExportChangeId ([object] $configuration) { + [string] ExportPRId ([object] $configuration) { # This is an interesting step, we do know we are dealing with a PR, but we need the PR id to # be able to get the labels, the buildSourceBranch follows the pattern: refs/pull/{ChangeId}/merge # we could use a regexp but then we would have two problems instead of one - $changeId = $null + $prId = $null if ($configuration.PARENT_BUILD_BUILD_SOURCEBRANCH) { - # use the source branch information from the configuration object - $changeId = $configuration.PARENT_BUILD_BUILD_SOURCEBRANCH.Replace("refs/pull/", "").Replace("/merge", "") - } else { - Write-Debug "Retrieving change id from the environment since it could not be found in the config." - # retrieve the change ide form the BUILD_SOURCEBRANCH enviroment variable. - $changeId = "$Env:BUILD_SOURCEBRANCH".Replace("refs/pull/", "").Replace("/merge", "") + # there are two possible situations, the build is a PR manually triggered or a PR triggered by a commit to a + # dev/* branch. In the first case we can get the PR id from the source branch, in the second case we need to + # get the PR id associated to the current commit. + if ($configuration.PARENT_BUILD_BUILD_SOURCEBRANCH.StartsWith("refs/pull")) { + Write-Host "Getting the change id from the parent build source branch" + $prId = $configuration.PARENT_BUILD_BUILD_SOURCEBRANCH.Replace("refs/pull/", "").Replace("/merge", "") + } elseif ($Env:BUILD_SOURCEBRANCH.StartsWith("refs/pull")) { + Write-Host "Getting the change id from the current build source branch" + $prId = "$Env:BUILD_SOURCEBRANCH".Replace("refs/pull/", "").Replace("/merge", "") + } else { + Write-Host "Getting the change id from the current build source version with the Github API" + # use the github command to retrieve the associate PR id + $prIDs = Get-GitHubPRsForHash -Hash $configuration.PARENT_BUILD_BUILD_SOURCEVERSION + Write-Host "PR IDs: $prIDs" + if ($prIDs.Length -gt 0) { + $prId = $prIDs[0] + } + } } # we can always fail (regexp error or not env varaible) - if ($changeId) { + if ($prId) { # add a var with the change id, which can be later consumed by some of the old scripts from # jenkins - Write-Host "##vso[task.setvariable variable=pr_number;isOutput=true]$changeId" + Write-Host "##vso[task.setvariable variable=pr_number;isOutput=true]$prId" } else { Write-Debug "Not setting the change id because it could not be calculated." } - return $changeId + Write-Host "Change id: $prId" + return $prId } [PSCustomObject] Import([string] $configFile) { @@ -507,12 +521,12 @@ class BuildConfiguration { $tags.Add("cronjob") } - if ($configuration.BuildReason -eq "PullRequest" -or (($configuration.BuildReason -eq "Manual") -and ($configuration.PARENT_BUILD_BUILD_SOURCEBRANCH -eq "merge")) ) { + if ($configuration.PARENT_BUILD_BUILD_SOURCEBRANCH.StartsWith("refs/heads/dev/") -or $configuration.BuildReason -eq "PullRequest" -or (($configuration.BuildReason -eq "Manual") -and ($configuration.PARENT_BUILD_BUILD_SOURCEBRANCH -eq "merge")) ) { Write-Host "Configuring build from PR." # retrieve the PR data to be able to fwd the labels from github - $changeId = $this.ExportChangeId($configuration) - $prInfo = Get-GitHubPRInfo -ChangeId $changeId + $prId = $this.ExportPRId($configuration) + $prInfo = Get-GitHubPRInfo -ChangeId $prId Write-Host $prInfo # make peoples life better, loop over the labels and add them as tags in the vsts build From 34d22864f97f8845a47f1b70008eeda596c6707b Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Thu, 9 Jan 2025 12:14:34 -0500 Subject: [PATCH 2/8] [Rgen] Add support for delegates in the data model. (#21902) Add support to keep track of delegate changes so that: 1. The trigger re-generation. 2. Allows us to keep track of callbacks to later generate async and trampolines. --------- Co-authored-by: GitHub Actions Autoformatter --- .../DataModel/Constructor.cs | 2 +- .../DataModel/DelegateInfo.cs | 116 ++++++ .../DataModel/DelegateParameter.cs | 173 ++++++++ .../DataModel/Method.cs | 4 +- .../DataModel/Parameter.cs | 24 +- .../DataModel/ParameterEqualityComparer.cs | 25 +- .../DataModel/DelegateInfoTests.cs | 387 ++++++++++++++++++ .../DataModel/DelegateParameterTests.cs | 379 +++++++++++++++++ .../DataModel/MethodTests.cs | 1 - .../Formatters/MethodFormatterTests.cs | 68 +++ 10 files changed, 1165 insertions(+), 14 deletions(-) create mode 100644 src/rgen/Microsoft.Macios.Generator/DataModel/DelegateInfo.cs create mode 100644 src/rgen/Microsoft.Macios.Generator/DataModel/DelegateParameter.cs create mode 100644 tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/DelegateInfoTests.cs create mode 100644 tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/DelegateParameterTests.cs diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/Constructor.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/Constructor.cs index 64d4ac71aa99..0e2b1945edb0 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/Constructor.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/Constructor.cs @@ -91,7 +91,7 @@ public bool Equals (Constructor other) if (!modifiersComparer.Equals (Modifiers, other.Modifiers)) return false; - var paramComparer = new ParameterEqualityComparer (); + var paramComparer = new MethodParameterEqualityComparer (); return paramComparer.Equals (Parameters, other.Parameters); } diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/DelegateInfo.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/DelegateInfo.cs new file mode 100644 index 000000000000..a33b116bbaf9 --- /dev/null +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/DelegateInfo.cs @@ -0,0 +1,116 @@ +using System; +using System.Collections.Immutable; +using System.Diagnostics.CodeAnalysis; +using System.Text; +using Microsoft.CodeAnalysis; + +namespace Microsoft.Macios.Generator.DataModel; + +/// +/// Readonly structure that describes a delegate callback passed as a parameter. +/// +readonly struct DelegateInfo : IEquatable { + + /// + /// Type name that owns the method. + /// + public string Type { get; } + + /// + /// Method name. + /// + public string Name { get; } + + /// + /// Method return type. + /// + public string ReturnType { get; } + + /// + /// Parameters list. + /// + public ImmutableArray Parameters { get; } = []; + + public DelegateInfo (string type, string name, string returnType, ImmutableArray parameters) + { + Type = type; + Name = name; + ReturnType = returnType; + Parameters = parameters; + } + + public static bool TryCreate (IMethodSymbol method, [NotNullWhen (true)] out DelegateInfo? change) + { + var parametersBucket = ImmutableArray.CreateBuilder (); + // loop over the parameters of the construct since changes on those implies a change in the generated code + foreach (var parameter in method.Parameters) { + if (!DelegateParameter.TryCreate (parameter, out var parameterChange)) + continue; + parametersBucket.Add (parameterChange.Value); + } + + change = new ( + type: method.ContainingSymbol.ToDisplayString ().Trim (), // we want the full name + name: method.Name, + returnType: method.ReturnType.ToDisplayString ().Trim (), + parameters: parametersBucket.ToImmutableArray ()); + return true; + } + + /// + public bool Equals (DelegateInfo other) + { + if (Type != other.Type) + return false; + if (Name != other.Name) + return false; + if (ReturnType != other.ReturnType) + return false; + + var paramComparer = new DelegateParameterEqualityComparer (); + return paramComparer.Equals (Parameters, other.Parameters); + } + + /// + public override bool Equals (object? obj) + { + return obj is DelegateInfo other && Equals (other); + } + + /// + public override int GetHashCode () + { + var hashCode = new HashCode (); + hashCode.Add (Type); + hashCode.Add (Name); + hashCode.Add (ReturnType); + + foreach (var parameter in Parameters) { + hashCode.Add (parameter); + } + + return hashCode.ToHashCode (); + } + + public static bool operator == (DelegateInfo left, DelegateInfo right) + { + return left.Equals (right); + } + + public static bool operator != (DelegateInfo left, DelegateInfo right) + { + return !left.Equals (right); + } + + /// + public override string ToString () + { + var sb = new StringBuilder ($"{{ Type: {Type}, "); + sb.Append ($"Name: {Name}, "); + sb.Append ($"ReturnType: {ReturnType}, "); + sb.Append ("Parameters: ["); + sb.AppendJoin (", ", Parameters); + sb.Append ("] }}"); + return sb.ToString (); + } +} diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/DelegateParameter.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/DelegateParameter.cs new file mode 100644 index 000000000000..8c2ecf50117b --- /dev/null +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/DelegateParameter.cs @@ -0,0 +1,173 @@ +using System; +using System.Diagnostics.CodeAnalysis; +using System.Text; +using Microsoft.CodeAnalysis; +using Microsoft.Macios.Generator.Extensions; + +namespace Microsoft.Macios.Generator.DataModel; + +/// +/// Readonly structure that describes a parameter in a delegate. This class contains less information +/// than Parameter since some of the extra fields make no sense in delegates. +/// +readonly struct DelegateParameter : IEquatable { + + /// + /// Parameter position in the method. + /// + public int Position { get; } + + /// + /// Type of the parameter. + /// + public string Type { get; } + + /// + /// Parameter name + /// + public string Name { get; } + + /// + /// True if the parameter is optional + /// + public bool IsOptional { get; init; } + + /// + /// True if a parameter is using the 'params' modifier. + /// + public bool IsParams { get; init; } + + /// + /// True if the parameter represents the 'this' pointer. + /// + public bool IsThis { get; init; } + + /// + /// True if the parameter is nullable.:w + /// + public bool IsNullable { get; init; } + + /// + /// True if the parameter type is blittable. + /// + public bool IsBlittable { get; } + + /// + /// Returns if the parameter type is a smart enum. + /// + public bool IsSmartEnum { get; init; } + + /// + /// Returns if the parameter is an array type. + /// + public bool IsArray { get; init; } + + /// + /// The reference type used. + /// + public ReferenceKind ReferenceKind { get; init; } + + public DelegateParameter (int position, string type, string name, bool isBlittable) + { + Position = position; + Type = type; + Name = name; + IsBlittable = isBlittable; + } + + public static bool TryCreate (IParameterSymbol symbol, + [NotNullWhen (true)] out DelegateParameter? parameter) + { + var type = symbol.Type is IArrayTypeSymbol arrayTypeSymbol + ? arrayTypeSymbol.ElementType.ToDisplayString () + : symbol.Type.ToDisplayString ().Trim ('?', '[', ']'); + + parameter = new (symbol.Ordinal, type, symbol.Name, symbol.Type.IsBlittable ()) { + IsOptional = symbol.IsOptional, + IsParams = symbol.IsParams, + IsThis = symbol.IsThis, + IsNullable = symbol.NullableAnnotation == NullableAnnotation.Annotated, + IsSmartEnum = symbol.Type.IsSmartEnum (), + IsArray = symbol.Type is IArrayTypeSymbol, + ReferenceKind = symbol.RefKind.ToReferenceKind (), + }; + return true; + } + + /// + public bool Equals (DelegateParameter other) + { + if (Position != other.Position) + return false; + if (Type != other.Type) + return false; + if (Name != other.Name) + return false; + if (IsOptional != other.IsOptional) + return false; + if (IsParams != other.IsParams) + return false; + if (IsThis != other.IsThis) + return false; + if (IsNullable != other.IsNullable) + return false; + if (IsBlittable != other.IsBlittable) + return false; + if (IsSmartEnum != other.IsSmartEnum) + return false; + if (IsArray != other.IsArray) + return false; + return ReferenceKind == other.ReferenceKind; + } + + /// + public override bool Equals (object? obj) + { + return obj is DelegateParameter other && Equals (other); + } + + /// + public override int GetHashCode () + { + var hashCode = new HashCode (); + hashCode.Add (Position); + hashCode.Add (Type); + hashCode.Add (Name); + hashCode.Add (IsOptional); + hashCode.Add (IsParams); + hashCode.Add (IsThis); + hashCode.Add (IsNullable); + hashCode.Add (IsSmartEnum); + hashCode.Add (IsArray); + hashCode.Add ((int) ReferenceKind); + return hashCode.ToHashCode (); + } + + public static bool operator == (DelegateParameter left, DelegateParameter right) + { + return left.Equals (right); + } + + public static bool operator != (DelegateParameter left, DelegateParameter right) + { + return !left.Equals (right); + } + + /// + public override string ToString () + { + var sb = new StringBuilder ("{"); + sb.Append ($"Position: {Position}, "); + sb.Append ($"Type: {Type}, "); + sb.Append ($"Name: {Name}, "); + sb.Append ($"IsOptional: {IsOptional}, "); + sb.Append ($"IsParams: {IsParams}, "); + sb.Append ($"IsThis: {IsThis}, "); + sb.Append ($"IsNullable: {IsNullable}, "); + sb.Append ($"IsBlittable: {IsBlittable}, "); + sb.Append ($"IsSmartEnum: {IsSmartEnum}, "); + sb.Append ($"IsArray: {IsArray}, "); + sb.Append ($"ReferenceKind: {ReferenceKind} "); + return sb.ToString (); + } +} diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/Method.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/Method.cs index d15f63ebb3e1..d0cf6a682233 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/Method.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/Method.cs @@ -15,7 +15,7 @@ namespace Microsoft.Macios.Generator.DataModel; readonly struct Method : IEquatable { /// - /// Type name that owns the constructor. + /// Type name that owns the method. /// public string Type { get; } @@ -127,7 +127,7 @@ public bool Equals (Method other) if (!modifiersComparer.Equals (Modifiers, other.Modifiers)) return false; - var paramComparer = new ParameterEqualityComparer (); + var paramComparer = new MethodParameterEqualityComparer (); return paramComparer.Equals (Parameters, other.Parameters); } diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/Parameter.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/Parameter.cs index e87f9644fe0a..7ede6ec0b916 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/Parameter.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/Parameter.cs @@ -72,6 +72,17 @@ namespace Microsoft.Macios.Generator.DataModel; /// public ReferenceKind ReferenceKind { get; init; } + /// + /// If the parameter is a delegate. The method information of the invoke. + /// + public DelegateInfo? Delegate { get; init; } = null; + + /// + /// True if the parameter is a delegate. + /// + //[MemberNotNullWhen (true, nameof (DelegateMethod))] + public bool IsDelegate => Delegate is not null; + /// /// List of attributes attached to the parameter. /// @@ -91,6 +102,12 @@ public static bool TryCreate (IParameterSymbol symbol, ParameterSyntax declarati var type = symbol.Type is IArrayTypeSymbol arrayTypeSymbol ? arrayTypeSymbol.ElementType.ToDisplayString () : symbol.Type.ToDisplayString ().Trim ('?', '[', ']'); + DelegateInfo? delegateInfo = null; + if (symbol.Type is INamedTypeSymbol namedTypeSymbol + && namedTypeSymbol.DelegateInvokeMethod is not null) { + DelegateInfo.TryCreate (namedTypeSymbol.DelegateInvokeMethod, out delegateInfo); + } + parameter = new (symbol.Ordinal, type, symbol.Name, symbol.Type.IsBlittable ()) { IsOptional = symbol.IsOptional, IsParams = symbol.IsParams, @@ -100,6 +117,7 @@ public static bool TryCreate (IParameterSymbol symbol, ParameterSyntax declarati IsArray = symbol.Type is IArrayTypeSymbol, DefaultValue = (symbol.HasExplicitDefaultValue) ? symbol.ExplicitDefaultValue?.ToString () : null, ReferenceKind = symbol.RefKind.ToReferenceKind (), + Delegate = delegateInfo, Attributes = declaration.GetAttributeCodeChanges (semanticModel), }; return true; @@ -132,6 +150,8 @@ public bool Equals (Parameter other) return false; if (ReferenceKind != other.ReferenceKind) return false; + if (Delegate != other.Delegate) + return false; var attributeComparer = new AttributesEqualityComparer (); return attributeComparer.Equals (Attributes, other.Attributes); @@ -158,6 +178,7 @@ public override int GetHashCode () hashCode.Add (IsArray); hashCode.Add (DefaultValue); hashCode.Add ((int) ReferenceKind); + hashCode.Add (Delegate); return hashCode.ToHashCode (); } @@ -188,7 +209,8 @@ public override string ToString () sb.Append ($"IsSmartEnum: {IsSmartEnum}, "); sb.Append ($"IsArray: {IsArray}, "); sb.Append ($"DefaultValue: {DefaultValue}, "); - sb.Append ($"ReferenceKind: {ReferenceKind} }}"); + sb.Append ($"ReferenceKind: {ReferenceKind}, "); + sb.Append ($"Delegate: {Delegate?.ToString () ?? "null"} }}"); return sb.ToString (); } } diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/ParameterEqualityComparer.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/ParameterEqualityComparer.cs index 563adb3e40f3..19c1e9a81cca 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/ParameterEqualityComparer.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/ParameterEqualityComparer.cs @@ -5,27 +5,34 @@ namespace Microsoft.Macios.Generator.DataModel; -class ParameterEqualityComparer : EqualityComparer> { - +class ParameterEqualityComparer (Func getName) : EqualityComparer> { /// - public override bool Equals (ImmutableArray x, ImmutableArray y) + public override bool Equals (ImmutableArray x, ImmutableArray y) { // we know as a fact that parameter names have to be unique, otherwise we could not // compile the code. So make sure that all the parameters with the same name are the same - var xDictionary = Enumerable.ToDictionary (x, parameter => parameter.Name); - var yDictionary = Enumerable.ToDictionary (y, parameter => parameter.Name); + var xDictionary = Enumerable.ToDictionary (x, getName); + var yDictionary = Enumerable.ToDictionary (y, getName); - var comparer = new DictionaryComparer (); + var comparer = new DictionaryComparer (); return comparer.Equals (xDictionary, yDictionary); } /// - public override int GetHashCode (ImmutableArray obj) + public override int GetHashCode (ImmutableArray obj) { var hashCode = new HashCode (); - foreach (var constructor in obj) { - hashCode.Add (constructor); + foreach (var parameter in obj) { + hashCode.Add (parameter); } return hashCode.ToHashCode (); } } + +class MethodParameterEqualityComparer () : ParameterEqualityComparer (GetName) { + static string GetName (Parameter p) => p.Name; +} + +class DelegateParameterEqualityComparer () : ParameterEqualityComparer (GetName) { + static string GetName (DelegateParameter p) => p.Name; +} diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/DelegateInfoTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/DelegateInfoTests.cs new file mode 100644 index 000000000000..d06619f6e264 --- /dev/null +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/DelegateInfoTests.cs @@ -0,0 +1,387 @@ +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.Macios.Generator.DataModel; +using Xamarin.Tests; +using Xamarin.Utils; +using Xunit; + +namespace Microsoft.Macios.Generator.Tests.DataModel; + +public class DelegateInfoTests : BaseGeneratorTestClass { + + class TestDataFromMethodDeclaration : IEnumerable { + public IEnumerator GetEnumerator () + { + + const string actionNoParam = @" +using System; + +namespace NS { + public class MyClass { + public void MyMethod (Action cb) {} + } +} +"; + + yield return [ + actionNoParam, + new Method ( + type: "NS.MyClass", + name: "MyMethod", + returnType: new ("void"), + symbolAvailability: new (), + exportMethodData: new (), + attributes: [], + modifiers: [ + SyntaxFactory.Token (SyntaxKind.PublicKeyword), + ], + parameters: [ + new ( + position: 0, + type: "System.Action", + name: "cb", + isBlittable: false + ) { + Delegate = new ( + type: "System.Action", + name: "Invoke", + returnType: "void", + parameters: [] + ) + } + ] + ) + ]; + + const string actionSingleParam = @" +using System; + +namespace NS { + public class MyClass { + public void MyMethod (Action cb) {} + } +} +"; + + yield return [ + actionSingleParam, + new Method ( + type: "NS.MyClass", + name: "MyMethod", + returnType: new ("void"), + symbolAvailability: new (), + exportMethodData: new (), + attributes: [], + modifiers: [ + SyntaxFactory.Token (SyntaxKind.PublicKeyword), + ], + parameters: [ + new ( + position: 0, + type: "System.Action", + name: "cb", + isBlittable: false + ) { + Delegate = new ( + type: "System.Action", + name: "Invoke", + returnType: "void", + parameters: [ + new ( + position: 0, + type: "string", + name: "obj", + isBlittable: false + ), + ]) + } + ] + ) + ]; + + const string actionSingleNullableParam = @" +using System; + +namespace NS { + public class MyClass { + public void MyMethod (Action cb) {} + } +} +"; + + yield return [ + actionSingleNullableParam, + new Method ( + type: "NS.MyClass", + name: "MyMethod", + returnType: new ("void"), + symbolAvailability: new (), + exportMethodData: new (), + attributes: [], + modifiers: [ + SyntaxFactory.Token (SyntaxKind.PublicKeyword), + ], + parameters: [ + new ( + position: 0, + type: "System.Action", + name: "cb", + isBlittable: false + ) { + Delegate = new ( + type: "System.Action", + name: "Invoke", + returnType: "void", + parameters: [ + new ( + position: 0, + type: "string", + name: "obj", + isBlittable: false + ) { + IsNullable = true + }, + ]) + } + ] + ) + ]; + + const string actionMultiParam = @" +using System; + +namespace NS { + public class MyClass { + public void MyMethod (Action cb) {} + } +} +"; + + yield return [ + actionMultiParam, + new Method ( + type: "NS.MyClass", + name: "MyMethod", + returnType: new ("void"), + symbolAvailability: new (), + exportMethodData: new (), + attributes: [], + modifiers: [ + SyntaxFactory.Token (SyntaxKind.PublicKeyword), + ], + parameters: [ + new ( + position: 0, + type: "System.Action", + name: "cb", + isBlittable: false + ) { + Delegate = new ( + type: "System.Action", + name: "Invoke", + returnType: "void", + parameters: [ + new ( + position: 0, + type: "string", + name: "arg1", + isBlittable: false + ), + new ( + position: 1, + type: "string", + name: "arg2", + isBlittable: false + ), + ]) + } + ] + ) + ]; + + const string funcSingleParam = @" +using System; + +namespace NS { + public class MyClass { + public void MyMethod (Func cb) {} + } +} +"; + + yield return [ + funcSingleParam, + new Method ( + type: "NS.MyClass", + name: "MyMethod", + returnType: new ("void"), + symbolAvailability: new (), + exportMethodData: new (), + attributes: [], + modifiers: [ + SyntaxFactory.Token (SyntaxKind.PublicKeyword), + ], + parameters: [ + new ( + position: 0, + type: "System.Func", + name: "cb", + isBlittable: false + ) { + Delegate = new ( + type: "System.Func", + name: "Invoke", + returnType: "string", + parameters: [ + new ( + position: 0, + type: "string", + name: "arg", + isBlittable: false + ), + ]) + } + ] + ) + ]; + + const string funcMultiParam = @" +using System; + +namespace NS { + public class MyClass { + public void MyMethod (Func cb) {} + } +} +"; + + yield return [ + funcMultiParam, + new Method ( + type: "NS.MyClass", + name: "MyMethod", + returnType: new ("void"), + symbolAvailability: new (), + exportMethodData: new (), + attributes: [], + modifiers: [ + SyntaxFactory.Token (SyntaxKind.PublicKeyword), + ], + parameters: [ + new ( + position: 0, + type: "System.Func", + name: "cb", + isBlittable: false + ) { + Delegate = new ( + type: "System.Func", + name: "Invoke", + returnType: "string", + parameters: [ + new ( + position: 0, + type: "string", + name: "arg1", + isBlittable: false + ), + new ( + position: 1, + type: "string", + name: "arg2", + isBlittable: false + ), + ]) + } + ] + ) + ]; + + const string customDelegate = @" +using System; + +namespace NS { + public class MyClass { + public delegate int? Callback(string name, string? middleName, params string[] surname); + + public void MyMethod (Callback cb) {} + } +} +"; + + yield return [ + customDelegate, + new Method ( + type: "NS.MyClass", + name: "MyMethod", + returnType: new ("void"), + symbolAvailability: new (), + exportMethodData: new (), + attributes: [], + modifiers: [ + SyntaxFactory.Token (SyntaxKind.PublicKeyword), + ], + parameters: [ + new ( + position: 0, + type: "NS.MyClass.Callback", + name: "cb", + isBlittable: false + ) { + Delegate = new ( + type: "NS.MyClass.Callback", + name: "Invoke", + returnType: "int?", + parameters: [ + new ( + position: 0, + type: "string", + name: "name", + isBlittable: false + ), + new ( + position: 1, + type: "string", + name: "middleName", + isBlittable: false + ) { + IsNullable = true + }, + new ( + position: 2, + type: "string", + name: "surname", + isBlittable: false + ) { + IsParams = true, + IsArray = true, + }, + ]) + } + ] + ) + ]; + } + + IEnumerator IEnumerable.GetEnumerator () => GetEnumerator (); + } + + [Theory] + [AllSupportedPlatformsClassData] + void FromMethodDeclaration (ApplePlatform platform, string inputText, Method expected) + { + var (compilation, syntaxTrees) = CreateCompilation (platform, sources: inputText); + Assert.Single (syntaxTrees); + var semanticModel = compilation.GetSemanticModel (syntaxTrees [0]); + var declaration = syntaxTrees [0].GetRoot () + .DescendantNodes ().OfType () + .FirstOrDefault (); + Assert.NotNull (declaration); + Assert.True (Method.TryCreate (declaration, semanticModel, out var changes)); + Assert.NotNull (changes); + Assert.Equal (expected, changes); + } +} diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/DelegateParameterTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/DelegateParameterTests.cs new file mode 100644 index 000000000000..da7f28d06fa7 --- /dev/null +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/DelegateParameterTests.cs @@ -0,0 +1,379 @@ +using System.Collections; +using System.Collections.Generic; +using Microsoft.Macios.Generator.DataModel; +using Xunit; + +namespace Microsoft.Macios.Generator.Tests.DataModel; + +public class DelegateParameterTests { + + class TestDataEquals : IEnumerable { + public IEnumerator GetEnumerator () + { + // diff pos + yield return [ + new DelegateParameter ( + position: 0, + type: "string", + name: "arg1", + isBlittable: false + ) { + IsOptional = false, + IsParams = false, + IsThis = false, + IsNullable = false, + IsSmartEnum = false, + IsArray = false, + ReferenceKind = ReferenceKind.None, + }, + new DelegateParameter ( + position: 1, + type: "string", + name: "arg1", + isBlittable: false + ) { + IsOptional = false, + IsParams = false, + IsThis = false, + IsNullable = false, + IsSmartEnum = false, + IsArray = false, + ReferenceKind = ReferenceKind.None, + }, + ]; + + // diff type + yield return [ + new DelegateParameter ( + position: 0, + type: "string", + name: "arg1", + isBlittable: false + ) { + IsOptional = false, + IsParams = false, + IsThis = false, + IsNullable = false, + IsSmartEnum = false, + IsArray = false, + ReferenceKind = ReferenceKind.None, + }, + new DelegateParameter ( + position: 0, + type: "int", + name: "arg1", + isBlittable: false + ) { + IsOptional = false, + IsParams = false, + IsThis = false, + IsNullable = false, + IsSmartEnum = false, + IsArray = false, + ReferenceKind = ReferenceKind.None, + }, + ]; + + // diff name + yield return [ + new DelegateParameter ( + position: 0, + type: "string", + name: "arg1", + isBlittable: false + ) { + IsOptional = false, + IsParams = false, + IsThis = false, + IsNullable = false, + IsSmartEnum = false, + IsArray = false, + ReferenceKind = ReferenceKind.None, + }, + new DelegateParameter ( + position: 0, + type: "string", + name: "arg2", + isBlittable: false + ) { + IsOptional = false, + IsParams = false, + IsThis = false, + IsNullable = false, + IsSmartEnum = false, + IsArray = false, + ReferenceKind = ReferenceKind.None, + }, + ]; + + // diff blittable + yield return [ + new DelegateParameter ( + position: 0, + type: "string", + name: "arg1", + isBlittable: true + ) { + IsOptional = false, + IsParams = false, + IsThis = false, + IsNullable = false, + IsSmartEnum = false, + IsArray = false, + ReferenceKind = ReferenceKind.None, + }, + new DelegateParameter ( + position: 0, + type: "string", + name: "arg1", + isBlittable: false + ) { + IsOptional = false, + IsParams = false, + IsThis = false, + IsNullable = false, + IsSmartEnum = false, + IsArray = false, + ReferenceKind = ReferenceKind.None, + }, + ]; + + // diff optional + yield return [ + new DelegateParameter ( + position: 0, + type: "string", + name: "arg1", + isBlittable: false + ) { + IsOptional = true, + IsParams = false, + IsThis = false, + IsNullable = false, + IsSmartEnum = false, + IsArray = false, + ReferenceKind = ReferenceKind.None, + }, + new DelegateParameter ( + position: 0, + type: "string", + name: "arg1", + isBlittable: false + ) { + IsOptional = false, + IsParams = false, + IsThis = false, + IsNullable = false, + IsSmartEnum = false, + IsArray = false, + ReferenceKind = ReferenceKind.None, + }, + ]; + + // diff is params + yield return [ + new DelegateParameter ( + position: 0, + type: "string", + name: "arg1", + isBlittable: false + ) { + IsOptional = false, + IsParams = true, + IsThis = false, + IsNullable = false, + IsSmartEnum = false, + IsArray = false, + ReferenceKind = ReferenceKind.None, + }, + new DelegateParameter ( + position: 0, + type: "string", + name: "arg1", + isBlittable: false + ) { + IsOptional = false, + IsParams = false, + IsThis = false, + IsNullable = false, + IsSmartEnum = false, + IsArray = false, + ReferenceKind = ReferenceKind.None, + }, + ]; + + // diff is this + yield return [ + new DelegateParameter ( + position: 0, + type: "string", + name: "arg1", + isBlittable: false + ) { + IsOptional = false, + IsParams = false, + IsThis = true, + IsNullable = false, + IsSmartEnum = false, + IsArray = false, + ReferenceKind = ReferenceKind.None, + }, + new DelegateParameter ( + position: 0, + type: "string", + name: "arg1", + isBlittable: false + ) { + IsOptional = false, + IsParams = false, + IsThis = false, + IsNullable = false, + IsSmartEnum = false, + IsArray = false, + ReferenceKind = ReferenceKind.None, + }, + ]; + + // diff is nullable + yield return [ + new DelegateParameter ( + position: 0, + type: "string", + name: "arg1", + isBlittable: false + ) { + IsOptional = false, + IsParams = false, + IsThis = false, + IsNullable = true, + IsSmartEnum = false, + IsArray = false, + ReferenceKind = ReferenceKind.None, + }, + new DelegateParameter ( + position: 0, + type: "string", + name: "arg1", + isBlittable: false + ) { + IsOptional = false, + IsParams = false, + IsThis = false, + IsNullable = false, + IsSmartEnum = false, + IsArray = false, + ReferenceKind = ReferenceKind.None, + }, + ]; + + // diff is smart enum + yield return [ + new DelegateParameter ( + position: 0, + type: "string", + name: "arg1", + isBlittable: false + ) { + IsOptional = false, + IsParams = false, + IsThis = false, + IsNullable = false, + IsSmartEnum = true, + IsArray = false, + ReferenceKind = ReferenceKind.None, + }, + new DelegateParameter ( + position: 0, + type: "string", + name: "arg1", + isBlittable: false + ) { + IsOptional = false, + IsParams = false, + IsThis = false, + IsNullable = false, + IsSmartEnum = false, + IsArray = false, + ReferenceKind = ReferenceKind.None, + }, + ]; + + // diff is array + yield return [ + new DelegateParameter ( + position: 0, + type: "string", + name: "arg1", + isBlittable: false + ) { + IsOptional = false, + IsParams = false, + IsThis = false, + IsNullable = false, + IsSmartEnum = false, + IsArray = true, + ReferenceKind = ReferenceKind.None, + }, + new DelegateParameter ( + position: 0, + type: "string", + name: "arg1", + isBlittable: false + ) { + IsOptional = false, + IsParams = false, + IsThis = false, + IsNullable = false, + IsSmartEnum = false, + IsArray = false, + ReferenceKind = ReferenceKind.None, + }, + ]; + + // diff ref type + yield return [ + new DelegateParameter ( + position: 0, + type: "string", + name: "arg1", + isBlittable: false + ) { + IsOptional = false, + IsParams = false, + IsThis = false, + IsNullable = false, + IsSmartEnum = false, + IsArray = false, + ReferenceKind = ReferenceKind.In, + }, + new DelegateParameter ( + position: 0, + type: "string", + name: "arg1", + isBlittable: false + ) { + IsOptional = false, + IsParams = false, + IsThis = false, + IsNullable = false, + IsSmartEnum = false, + IsArray = false, + ReferenceKind = ReferenceKind.None, + }, + ]; + } + + IEnumerator IEnumerable.GetEnumerator () => GetEnumerator (); + } + + [Theory] + [ClassData (typeof (TestDataEquals))] + void CompareDiffPosition (DelegateParameter x, DelegateParameter y) + { + Assert.False (x.Equals (y)); + Assert.False (y.Equals (x)); + Assert.False (x == y); + Assert.True (x != y); + } + +} diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodTests.cs index 19297354315f..c895a9b6cd04 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodTests.cs @@ -624,7 +624,6 @@ public bool TryGetString ([NotNullWhen (true)] out string? example) { ] ) ]; - } IEnumerator IEnumerable.GetEnumerator () => GetEnumerator (); diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Formatters/MethodFormatterTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Formatters/MethodFormatterTests.cs index 0e4f114a7409..74a1de53c874 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Formatters/MethodFormatterTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Formatters/MethodFormatterTests.cs @@ -441,6 +441,74 @@ public partial class MyClass { yield return [paramsMethod, "public partial void TestMethod (params string[] data)"]; + + const string actionNoParam = @" +using System; + +namespace NS { + public class MyClass { + public partial void TestMethod (Action cb) {} + } +} +"; + yield return [actionNoParam, "public partial void TestMethod (System.Action cb)"]; + + const string actionSingleParam = @" +using System; + +namespace NS { + public class MyClass { + public partial void TestMethod (Action cb) {} + } +} +"; + yield return [actionSingleParam, "public partial void TestMethod (System.Action cb)"]; + + const string actionSingleNullableParam = @" +using System; + +namespace NS { + public class MyClass { + public partial void TestMethod (Action cb) {} + } +} +"; + yield return [actionSingleNullableParam, "public partial void TestMethod (System.Action cb)"]; + + const string actionMultiParam = @" +using System; + +namespace NS { + public class MyClass { + public partial void TestMethod (Action cb) {} + } +} +"; + yield return [actionMultiParam, "public partial void TestMethod (System.Action cb)"]; + + const string funcSingleParam = @" +using System; + +namespace NS { + public class MyClass { + public partial void TestMethod (Func cb) {} + } +} +"; + yield return [funcSingleParam, "public partial void TestMethod (System.Func cb)"]; + + const string customDelegate = @" +using System; + +namespace NS { + public class MyClass { + public delegate int? Callback(string name, string? middleName, params string[] surname); + + public partial void TestMethod (Callback cb) {} + } +} +"; + yield return [customDelegate, "public partial void TestMethod (NS.MyClass.Callback cb)"]; } IEnumerator IEnumerable.GetEnumerator () => GetEnumerator (); From 49ebbf55144ccf70ad53eebbfcf7e4c8a600653b Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Thu, 9 Jan 2025 12:17:57 -0500 Subject: [PATCH 3/8] [Rgen] Move the property struct to use the return type one. (#21928) This way we add more flexibility on the data we can store in the return type of the property. Will be usfeul to later share logic between the return type of a method and a property. --------- Co-authored-by: GitHub Actions Autoformatter --- .../DataModel/Method.cs | 4 +- .../DataModel/MethodReturnTypeComparer.cs | 4 +- .../DataModel/MethodsEqualityComparer.cs | 2 +- .../DataModel/Property.cs | 32 +- .../{MethodReturnType.cs => ReturnType.cs} | 22 +- .../Formatters/MethodFormatter.cs | 19 -- .../Formatters/PropertyFormatter.cs | 2 +- .../Formatters/ReturnTypeFormatter.cs | 28 ++ .../DataModel/ClassCodeChangesTests.cs | 40 +-- .../DataModel/CodeChangesComparerTests.cs | 205 +++---------- .../CodeChangesEqualityComparerTests.cs | 145 ++------- .../DataModel/InterfaceCodeChangesTests.cs | 35 +-- .../MethodReturnTypeComparerTests.cs | 24 +- .../PropertiesEqualityComparerTests.cs | 45 +-- .../DataModel/PropertyTests.cs | 287 ++++++++---------- ...dReturnTypeTests.cs => ReturnTypeTests.cs} | 2 +- 16 files changed, 292 insertions(+), 604 deletions(-) rename src/rgen/Microsoft.Macios.Generator/DataModel/{MethodReturnType.cs => ReturnType.cs} (83%) create mode 100644 src/rgen/Microsoft.Macios.Generator/Formatters/ReturnTypeFormatter.cs rename tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/{MethodReturnTypeTests.cs => ReturnTypeTests.cs} (99%) diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/Method.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/Method.cs index d0cf6a682233..f6309af8fab8 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/Method.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/Method.cs @@ -27,7 +27,7 @@ namespace Microsoft.Macios.Generator.DataModel; /// /// Method return type. /// - public MethodReturnType ReturnType { get; } + public ReturnType ReturnType { get; } /// /// The platform availability of the method. @@ -54,7 +54,7 @@ namespace Microsoft.Macios.Generator.DataModel; /// public ImmutableArray Parameters { get; } = []; - public Method (string type, string name, MethodReturnType returnType, + public Method (string type, string name, ReturnType returnType, SymbolAvailability symbolAvailability, ExportData exportMethodData, ImmutableArray attributes, diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/MethodReturnTypeComparer.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/MethodReturnTypeComparer.cs index 37360c0a044e..754cfac875ba 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/MethodReturnTypeComparer.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/MethodReturnTypeComparer.cs @@ -3,10 +3,10 @@ namespace Microsoft.Macios.Generator.DataModel; -class MethodReturnTypeComparer : IComparer { +class MethodReturnTypeComparer : IComparer { /// - public int Compare (MethodReturnType x, MethodReturnType y) + public int Compare (ReturnType x, ReturnType y) { var returnTypeComparison = String.Compare (x.Type, y.Type, StringComparison.Ordinal); if (returnTypeComparison != 0) diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/MethodsEqualityComparer.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/MethodsEqualityComparer.cs index 1ca99038b6e5..99a6ac6d66c2 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/MethodsEqualityComparer.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/MethodsEqualityComparer.cs @@ -21,7 +21,7 @@ public override bool Equals (ImmutableArray x, ImmutableArray y) // create the dictionary comparer that will do the based comparison and relay on a list comparer for the // diff methods var dictionaryComparer = - new DictionaryComparer<(MethodReturnType ReturnType, string Name, int ParameterCount), List> ( + new DictionaryComparer<(ReturnType ReturnType, string Name, int ParameterCount), List> ( new CollectionComparer (new MethodComparer ())); return dictionaryComparer.Equals (xMethods, yMethods); } diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/Property.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/Property.cs index b58e176ae343..d31fdc3a22a2 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/Property.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/Property.cs @@ -24,24 +24,24 @@ namespace Microsoft.Macios.Generator.DataModel; public string BackingField { get; private init; } /// - /// String representation of the property type. + /// Representation of the property type. /// - public string Type { get; } = string.Empty; + public ReturnType ReturnType { get; } = default; /// /// Returns if the property type is bittable. /// - public bool IsBlittable { get; } + public bool IsBlittable => ReturnType.IsBlittable; /// /// Returns if the property type is a smart enum. /// - public bool IsSmartEnum { get; } + public bool IsSmartEnum => ReturnType.IsSmartEnum; /// /// Returns if the property type is a reference type. /// - public bool IsReferenceType { get; } + public bool IsReferenceType => ReturnType.IsReferenceType; /// /// The platform availability of the property. @@ -87,20 +87,14 @@ namespace Microsoft.Macios.Generator.DataModel; /// public ImmutableArray Accessors { get; } = []; - internal Property (string name, string type, - bool isBlittable, - bool isSmartEnum, - bool isReferenceType, + internal Property (string name, ReturnType returnType, SymbolAvailability symbolAvailability, ImmutableArray attributes, ImmutableArray modifiers, ImmutableArray accessors) { Name = name; BackingField = $"_{Name}"; - Type = type; - IsBlittable = isBlittable; - IsSmartEnum = isSmartEnum; - IsReferenceType = isReferenceType; + ReturnType = returnType; SymbolAvailability = symbolAvailability; Attributes = attributes; Modifiers = modifiers; @@ -113,7 +107,7 @@ public bool Equals (Property other) // this could be a large && but ifs are more readable if (Name != other.Name) return false; - if (Type != other.Type) + if (ReturnType != other.ReturnType) return false; if (IsBlittable != other.IsBlittable) return false; @@ -149,7 +143,7 @@ public override bool Equals (object? obj) /// public override int GetHashCode () { - return HashCode.Combine (Name, Type, IsSmartEnum, Attributes, Modifiers, Accessors); + return HashCode.Combine (Name, ReturnType, IsSmartEnum, Attributes, Modifiers, Accessors); } public static bool operator == (Property left, Property right) @@ -173,7 +167,6 @@ public static bool TryCreate (PropertyDeclarationSyntax declaration, SemanticMod } var propertySupportedPlatforms = propertySymbol.GetSupportedPlatforms (); - var type = propertySymbol.Type.ToDisplayString ().Trim (); var attributes = declaration.GetAttributeCodeChanges (semanticModel); ImmutableArray accessorCodeChanges = []; @@ -211,10 +204,7 @@ public static bool TryCreate (PropertyDeclarationSyntax declaration, SemanticMod change = new ( name: memberName, - type: type, - isBlittable: propertySymbol.Type.IsBlittable (), - isSmartEnum: propertySymbol.Type.IsSmartEnum (), - isReferenceType: propertySymbol.Type.IsReferenceType, + returnType: new (propertySymbol.Type), symbolAvailability: propertySupportedPlatforms, attributes: attributes, modifiers: [.. declaration.Modifiers], @@ -229,7 +219,7 @@ public static bool TryCreate (PropertyDeclarationSyntax declaration, SemanticMod public override string ToString () { var sb = new StringBuilder ( - $"Name: '{Name}', Type: '{Type}', IsBlittable: {IsBlittable}, IsSmartEnum: {IsSmartEnum}, IsReferenceType: {IsReferenceType} Supported Platforms: {SymbolAvailability}, ExportFieldData: '{ExportFieldData?.ToString () ?? "null"}', ExportPropertyData: '{ExportPropertyData?.ToString () ?? "null"}' Attributes: ["); + $"Name: '{Name}', Type: {ReturnType}, Supported Platforms: {SymbolAvailability}, ExportFieldData: '{ExportFieldData?.ToString () ?? "null"}', ExportPropertyData: '{ExportPropertyData?.ToString () ?? "null"}' Attributes: ["); sb.AppendJoin (",", Attributes); sb.Append ("], Modifiers: ["); sb.AppendJoin (",", Modifiers.Select (x => x.Text)); diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/MethodReturnType.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/ReturnType.cs similarity index 83% rename from src/rgen/Microsoft.Macios.Generator/DataModel/MethodReturnType.cs rename to src/rgen/Microsoft.Macios.Generator/DataModel/ReturnType.cs index a9a1bb300b39..389ba5cad408 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/MethodReturnType.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/ReturnType.cs @@ -8,7 +8,7 @@ namespace Microsoft.Macios.Generator.DataModel; /// /// Readonly structure that represents a change in a method return type. /// -readonly struct MethodReturnType : IEquatable { +readonly struct ReturnType : IEquatable { /// /// Type of the parameter. @@ -45,14 +45,18 @@ namespace Microsoft.Macios.Generator.DataModel; /// public bool IsVoid { get; } - internal MethodReturnType (string type) + internal ReturnType (string type) { Type = type; IsVoid = type == "void"; } - internal MethodReturnType (string type, bool isNullable, bool isBlittable, bool isSmartEnum, bool isArray, - bool isReferenceType) : this (type) + internal ReturnType (string type, + bool isNullable = false, + bool isBlittable = false, + bool isSmartEnum = false, + bool isArray = false, + bool isReferenceType = false) : this (type) { IsNullable = isNullable; IsBlittable = isBlittable; @@ -61,7 +65,7 @@ internal MethodReturnType (string type, bool isNullable, bool isBlittable, bool IsReferenceType = isReferenceType; } - internal MethodReturnType (ITypeSymbol symbol) : + internal ReturnType (ITypeSymbol symbol) : this ( symbol is IArrayTypeSymbol arrayTypeSymbol ? arrayTypeSymbol.ElementType.ToDisplayString () @@ -75,7 +79,7 @@ symbol is IArrayTypeSymbol arrayTypeSymbol } /// - public bool Equals (MethodReturnType other) + public bool Equals (ReturnType other) { if (Type != other.Type) return false; @@ -98,7 +102,7 @@ public bool Equals (MethodReturnType other) /// public override bool Equals (object? obj) { - return obj is MethodReturnType other && Equals (other); + return obj is ReturnType other && Equals (other); } /// @@ -107,12 +111,12 @@ public override int GetHashCode () return HashCode.Combine (Type, IsNullable, IsBlittable, IsSmartEnum, IsArray, IsReferenceType, IsVoid); } - public static bool operator == (MethodReturnType left, MethodReturnType right) + public static bool operator == (ReturnType left, ReturnType right) { return left.Equals (right); } - public static bool operator != (MethodReturnType left, MethodReturnType right) + public static bool operator != (ReturnType left, ReturnType right) { return !left.Equals (right); } diff --git a/src/rgen/Microsoft.Macios.Generator/Formatters/MethodFormatter.cs b/src/rgen/Microsoft.Macios.Generator/Formatters/MethodFormatter.cs index efae389ee0c0..32fe08b7bfb8 100644 --- a/src/rgen/Microsoft.Macios.Generator/Formatters/MethodFormatter.cs +++ b/src/rgen/Microsoft.Macios.Generator/Formatters/MethodFormatter.cs @@ -6,25 +6,6 @@ namespace Microsoft.Macios.Generator.Formatters; static class MethodFormatter { - static TypeSyntax GetIdentifierSyntax (this in MethodReturnType returnType) - { - if (returnType.IsArray) { - // could be a params array or simply an array - var arrayType = ArrayType (IdentifierName (returnType.Type)) - .WithRankSpecifiers (SingletonList ( - ArrayRankSpecifier ( - SingletonSeparatedList (OmittedArraySizeExpression ())))); - return returnType.IsNullable - ? NullableType (arrayType) - : arrayType; - } - - // dealing with a non-array type - return returnType.IsNullable - ? NullableType (IdentifierName (returnType.Type)) - : IdentifierName (returnType.Type); - } - public static CompilationUnitSyntax? ToDeclaration (this in Method? method) { if (method is null) diff --git a/src/rgen/Microsoft.Macios.Generator/Formatters/PropertyFormatter.cs b/src/rgen/Microsoft.Macios.Generator/Formatters/PropertyFormatter.cs index 806307aa80bf..172fa5b91729 100644 --- a/src/rgen/Microsoft.Macios.Generator/Formatters/PropertyFormatter.cs +++ b/src/rgen/Microsoft.Macios.Generator/Formatters/PropertyFormatter.cs @@ -20,7 +20,7 @@ static class PropertyFormatter { var compilationUnit = CompilationUnit ().WithMembers ( SingletonList ( PropertyDeclaration ( - type: IdentifierName (property.Value.Type), + type: property.Value.ReturnType.GetIdentifierSyntax (), identifier: Identifier (property.Value.Name)) .WithModifiers (TokenList (property.Value.Modifiers)))).NormalizeWhitespace (); return compilationUnit; diff --git a/src/rgen/Microsoft.Macios.Generator/Formatters/ReturnTypeFormatter.cs b/src/rgen/Microsoft.Macios.Generator/Formatters/ReturnTypeFormatter.cs new file mode 100644 index 000000000000..5ff8614e3cb0 --- /dev/null +++ b/src/rgen/Microsoft.Macios.Generator/Formatters/ReturnTypeFormatter.cs @@ -0,0 +1,28 @@ +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.Macios.Generator.DataModel; + +using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; + +namespace Microsoft.Macios.Generator.Formatters; + +static class ReturnTypeFormatter { + + public static TypeSyntax GetIdentifierSyntax (this in ReturnType returnType) + { + if (returnType.IsArray) { + // could be a params array or simply an array + var arrayType = ArrayType (IdentifierName (returnType.Type)) + .WithRankSpecifiers (SingletonList ( + ArrayRankSpecifier ( + SingletonSeparatedList (OmittedArraySizeExpression ())))); + return returnType.IsNullable + ? NullableType (arrayType) + : arrayType; + } + + // dealing with a non-array type + return returnType.IsNullable + ? NullableType (IdentifierName (returnType.Type)) + : IdentifierName (returnType.Type); + } +} diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ClassCodeChangesTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ClassCodeChangesTests.cs index cea5a784c254..5d9c8b937199 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ClassCodeChangesTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ClassCodeChangesTests.cs @@ -353,10 +353,7 @@ public partial class MyClass { Properties = [ new ( name: "Name", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new ("string", isReferenceType: true), symbolAvailability: new (), attributes: [ new ("ObjCBindings.ExportAttribute", ["name"]) @@ -427,10 +424,7 @@ public partial class MyClass { Properties = [ new ( name: "Name", - type: "NS.MyEnum", - isBlittable: true, - isSmartEnum: true, - isReferenceType: false, + returnType: new ("NS.MyEnum", isBlittable: true, isSmartEnum: true), symbolAvailability: new (), attributes: [ new ("ObjCBindings.ExportAttribute", ["name"]) @@ -500,10 +494,7 @@ public partial class MyClass { Properties = [ new ( name: "Name", - type: "NS.MyEnum", - isBlittable: true, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("NS.MyEnum", isBlittable: true), symbolAvailability: new (), attributes: [ new ("ObjCBindings.ExportAttribute", ["name"]) @@ -569,10 +560,7 @@ public partial class MyClass { Properties = [ new ( name: "Name", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new ("string", isReferenceType: true), symbolAvailability: new (), attributes: [ new ("ObjCBindings.ExportAttribute", ["name", "ObjCBindings.Property.Notification"]) @@ -639,10 +627,7 @@ public partial class MyClass { Properties = [ new ( name: "Name", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new ("string", isReferenceType: true), symbolAvailability: new (), attributes: [ new ("ObjCBindings.ExportAttribute", ["CONSTANT"]) @@ -712,10 +697,7 @@ public partial class MyClass { Properties = [ new ( name: "Name", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new ("string", isReferenceType: true), symbolAvailability: new (), attributes: [ new ("ObjCBindings.ExportAttribute", ["name"]) @@ -784,10 +766,7 @@ public partial class MyClass { Properties = [ new ( name: "Name", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new ("string", isReferenceType: true), symbolAvailability: new (), attributes: [ new ("ObjCBindings.ExportAttribute", ["name"]) @@ -817,10 +796,7 @@ public partial class MyClass { }, new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new ("string", isReferenceType: true), symbolAvailability: new (), attributes: [ new ("ObjCBindings.ExportAttribute", ["surname"]) diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/CodeChangesComparerTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/CodeChangesComparerTests.cs index dbfc1e542772..b7c514635a80 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/CodeChangesComparerTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/CodeChangesComparerTests.cs @@ -243,10 +243,7 @@ public void CompareDifferentPropertyLength () Properties = [ new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -291,10 +288,7 @@ public void CompareSamePropertiesDiffOrder () Properties = [ new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -322,10 +316,7 @@ public void CompareSamePropertiesDiffOrder () ]), new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -365,10 +356,7 @@ public void CompareSamePropertiesDiffOrder () Properties = [ new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -398,10 +386,7 @@ public void CompareSamePropertiesDiffOrder () ]), new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -445,10 +430,7 @@ public void CompareDifferentProperties () Properties = [ new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -476,10 +458,7 @@ public void CompareDifferentProperties () ]), new ( name: "Name", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -519,10 +498,7 @@ public void CompareDifferentProperties () Properties = [ new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -551,10 +527,7 @@ public void CompareDifferentProperties () ]), new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -598,10 +571,7 @@ public void CompareDifferentEventsLength () Properties = [ new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -629,10 +599,7 @@ public void CompareDifferentEventsLength () ]), new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -688,10 +655,7 @@ public void CompareDifferentEventsLength () Properties = [ new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -721,10 +685,7 @@ public void CompareDifferentEventsLength () ]), new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -768,10 +729,7 @@ public void CompareSameEventsDiffOrder () Properties = [ new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -799,10 +757,7 @@ public void CompareSameEventsDiffOrder () ]), new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -880,10 +835,7 @@ public void CompareSameEventsDiffOrder () Properties = [ new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -913,10 +865,7 @@ public void CompareSameEventsDiffOrder () ]), new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -1000,10 +949,7 @@ public void CompareDifferentEvents () Properties = [ new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -1031,10 +977,7 @@ public void CompareDifferentEvents () ]), new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -1090,10 +1033,7 @@ public void CompareDifferentEvents () Properties = [ new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -1123,10 +1063,7 @@ public void CompareDifferentEvents () ]), new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -1189,10 +1126,7 @@ public void CompareDifferentMethodsLength () Properties = [ new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -1220,10 +1154,7 @@ public void CompareDifferentMethodsLength () ]), new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -1342,10 +1273,7 @@ public void CompareDifferentMethodsLength () Properties = [ new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -1375,10 +1303,7 @@ public void CompareDifferentMethodsLength () ]), new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -1487,10 +1412,7 @@ public void CompareSameMethodsDiffOrder () Properties = [ new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -1518,10 +1440,7 @@ public void CompareSameMethodsDiffOrder () ]), new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -1640,10 +1559,7 @@ public void CompareSameMethodsDiffOrder () Properties = [ new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -1673,10 +1589,7 @@ public void CompareSameMethodsDiffOrder () ]), new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -1800,10 +1713,7 @@ public void CompareDifferentMethods () Properties = [ new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -1831,10 +1741,7 @@ public void CompareDifferentMethods () ]), new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -1929,10 +1836,7 @@ public void CompareDifferentMethods () Properties = [ new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -1962,10 +1866,7 @@ public void CompareDifferentMethods () ]), new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -2078,10 +1979,7 @@ public void CompareSameMethodsDiffAvailability () Properties = [ new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -2109,10 +2007,7 @@ public void CompareSameMethodsDiffAvailability () ]), new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -2231,10 +2126,7 @@ public void CompareSameMethodsDiffAvailability () Properties = [ new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -2264,10 +2156,7 @@ public void CompareSameMethodsDiffAvailability () ]), new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -2386,10 +2275,7 @@ public void CompareSameMethodsSameAvailability () Properties = [ new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -2417,10 +2303,7 @@ public void CompareSameMethodsSameAvailability () ]), new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -2539,10 +2422,7 @@ public void CompareSameMethodsSameAvailability () Properties = [ new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -2572,10 +2452,7 @@ public void CompareSameMethodsSameAvailability () ]), new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/CodeChangesEqualityComparerTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/CodeChangesEqualityComparerTests.cs index 158e25dc51bc..2ebe57053701 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/CodeChangesEqualityComparerTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/CodeChangesEqualityComparerTests.cs @@ -161,10 +161,7 @@ public void CompareDifferentPropertyLength () Properties = [ new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -211,10 +208,7 @@ public void CompareSamePropertiesDiffOrder () Properties = [ new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -242,10 +236,7 @@ public void CompareSamePropertiesDiffOrder () ]), new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -285,10 +276,7 @@ public void CompareSamePropertiesDiffOrder () Properties = [ new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -318,10 +306,7 @@ public void CompareSamePropertiesDiffOrder () ]), new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -365,10 +350,7 @@ public void CompareDifferentProperties () Properties = [ new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -396,10 +378,7 @@ public void CompareDifferentProperties () ]), new ( name: "Name", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -439,10 +418,7 @@ public void CompareDifferentProperties () Properties = [ new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -472,10 +448,7 @@ public void CompareDifferentProperties () ]), new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -519,10 +492,7 @@ public void CompareDifferentConstructorLength () Properties = [ new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -550,10 +520,7 @@ public void CompareDifferentConstructorLength () ]), new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -594,10 +561,7 @@ public void CompareDifferentConstructorLength () Properties = [ new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -627,10 +591,7 @@ public void CompareDifferentConstructorLength () ]), new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -677,10 +638,7 @@ public void CompareDifferentConstructors () Properties = [ new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -708,10 +666,7 @@ public void CompareDifferentConstructors () ]), new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -754,10 +709,7 @@ public void CompareDifferentConstructors () Properties = [ new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -787,10 +739,7 @@ public void CompareDifferentConstructors () ]), new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -843,10 +792,7 @@ public void CompareSameConstructors () Properties = [ new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -874,10 +820,7 @@ public void CompareSameConstructors () ]), new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -927,10 +870,7 @@ public void CompareSameConstructors () Properties = [ new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -960,10 +900,7 @@ public void CompareSameConstructors () ]), new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -1017,10 +954,7 @@ public void CompareSameConstructorsDiffOrder () Properties = [ new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -1048,10 +982,7 @@ public void CompareSameConstructorsDiffOrder () ]), new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -1101,10 +1032,7 @@ public void CompareSameConstructorsDiffOrder () Properties = [ new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -1133,10 +1061,7 @@ public void CompareSameConstructorsDiffOrder () ]), new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -1194,10 +1119,7 @@ public void CompareSameDiffModifiers () Properties = [ new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -1225,10 +1147,7 @@ public void CompareSameDiffModifiers () ]), new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -1283,10 +1202,7 @@ public void CompareSameDiffModifiers () Properties = [ new ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("Utils.MyClass"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), @@ -1316,10 +1232,7 @@ public void CompareSameDiffModifiers () ]), new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [ new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/InterfaceCodeChangesTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/InterfaceCodeChangesTests.cs index 6a035064127f..342c49532901 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/InterfaceCodeChangesTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/InterfaceCodeChangesTests.cs @@ -117,10 +117,7 @@ public partial interface IProtocol { Properties = [ new ( name: "Name", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new (type: "string", isReferenceType: true), symbolAvailability: new (), attributes: [ new ("ObjCBindings.ExportAttribute", ["name"]) @@ -189,10 +186,7 @@ public partial interface IProtocol { Properties = [ new ( name: "Name", - type: "NS.MyEnum", - isBlittable: true, - isSmartEnum: true, - isReferenceType: false, + returnType: new ("NS.MyEnum", isSmartEnum: true, isBlittable: true), symbolAvailability: new (), attributes: [ new ("ObjCBindings.ExportAttribute", ["name"]) @@ -260,10 +254,7 @@ public partial interface IProtocol { Properties = [ new ( name: "Name", - type: "NS.MyEnum", - isBlittable: true, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("NS.MyEnum", isBlittable: true), symbolAvailability: new (), attributes: [ new ("ObjCBindings.ExportAttribute", ["name"]) @@ -327,10 +318,7 @@ public partial interface IProtocol { Properties = [ new ( name: "Name", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new ("string", isReferenceType: true), symbolAvailability: new (), attributes: [ new ("ObjCBindings.ExportAttribute", ["name", "ObjCBindings.Property.Notification"]) @@ -396,10 +384,7 @@ public partial interface IProtocol { Properties = [ new ( name: "Name", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new ("string", isReferenceType: true), symbolAvailability: new (), attributes: [ new ("ObjCBindings.ExportAttribute", ["name"]) @@ -466,10 +451,7 @@ public partial interface IProtocol { Properties = [ new ( name: "Name", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new ("string", isReferenceType: true), symbolAvailability: new (), attributes: [ new ("ObjCBindings.ExportAttribute", ["name"]) @@ -499,10 +481,7 @@ public partial interface IProtocol { }, new ( name: "Surname", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new ("string", isReferenceType: true), symbolAvailability: new (), attributes: [ new ("ObjCBindings.ExportAttribute", ["surname"]) diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodReturnTypeComparerTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodReturnTypeComparerTests.cs index 2845b3725765..d5ba383ce560 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodReturnTypeComparerTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodReturnTypeComparerTests.cs @@ -11,15 +11,15 @@ public class MethodReturnTypeComparerTests { [Fact] public void CompareDiffReturnType () { - var x = new MethodReturnType ("string"); - var y = new MethodReturnType ("int"); + var x = new ReturnType ("string"); + var y = new ReturnType ("int"); Assert.Equal (String.Compare (x.Type, y.Type, StringComparison.Ordinal), compare.Compare (x, y)); } [Fact] public void CompareDiffNullable () { - var x = new MethodReturnType ( + var x = new ReturnType ( type: "void", isNullable: true, isBlittable: false, @@ -28,7 +28,7 @@ public void CompareDiffNullable () isReferenceType: false ); - var y = new MethodReturnType ( + var y = new ReturnType ( type: "void", isNullable: false, isBlittable: false, @@ -42,7 +42,7 @@ public void CompareDiffNullable () [Fact] public void CompareDiffBlittable () { - var x = new MethodReturnType ( + var x = new ReturnType ( type: "void", isNullable: false, isBlittable: true, @@ -51,7 +51,7 @@ public void CompareDiffBlittable () isReferenceType: false ); - var y = new MethodReturnType ( + var y = new ReturnType ( type: "void", isNullable: false, isBlittable: false, @@ -65,7 +65,7 @@ public void CompareDiffBlittable () [Fact] public void CompareDiffSmartEnum () { - var x = new MethodReturnType ( + var x = new ReturnType ( type: "void", isNullable: false, isBlittable: false, @@ -74,7 +74,7 @@ public void CompareDiffSmartEnum () isReferenceType: false ); - var y = new MethodReturnType ( + var y = new ReturnType ( type: "void", isNullable: false, isBlittable: false, @@ -88,7 +88,7 @@ public void CompareDiffSmartEnum () [Fact] public void CompareDiffIsArray () { - var x = new MethodReturnType ( + var x = new ReturnType ( type: "void", isNullable: false, isBlittable: false, @@ -97,7 +97,7 @@ public void CompareDiffIsArray () isReferenceType: false ); - var y = new MethodReturnType ( + var y = new ReturnType ( type: "void", isNullable: false, isBlittable: false, @@ -111,7 +111,7 @@ public void CompareDiffIsArray () [Fact] public void CompareDiffIsReference () { - var x = new MethodReturnType ( + var x = new ReturnType ( type: "void", isNullable: false, isBlittable: false, @@ -120,7 +120,7 @@ public void CompareDiffIsReference () isReferenceType: true ); - var y = new MethodReturnType ( + var y = new ReturnType ( type: "void", isNullable: false, isBlittable: false, diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/PropertiesEqualityComparerTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/PropertiesEqualityComparerTests.cs index bd20c44133b0..79991ccd4f20 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/PropertiesEqualityComparerTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/PropertiesEqualityComparerTests.cs @@ -23,10 +23,7 @@ public void CompareDifferentSize () ImmutableArray x = [ new ( name: "FirstProperty", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [], modifiers: [ @@ -43,10 +40,7 @@ public void CompareDifferentSize () ]), new ( name: "SecondProperty", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [], modifiers: [ @@ -65,10 +59,7 @@ public void CompareDifferentSize () ImmutableArray y = [ new ( name: "FirstProperty", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [], modifiers: [ @@ -94,10 +85,7 @@ public void CompareSameSizeDiffProperties () ImmutableArray x = [ new ( name: "FirstProperty", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [], modifiers: [ @@ -116,10 +104,7 @@ public void CompareSameSizeDiffProperties () ImmutableArray y = [ new ( name: "FirstProperty", - type: "AVFoundation.AVVideo", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("AVFoundation.AVVideo"), symbolAvailability: new (), attributes: [], modifiers: [ @@ -145,10 +130,7 @@ public void CompareSameSizeSameProperties () ImmutableArray x = [ new ( name: "FirstProperty", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [], modifiers: [ @@ -167,10 +149,7 @@ public void CompareSameSizeSameProperties () ImmutableArray y = [ new ( name: "FirstProperty", - isSmartEnum: false, - type: "string", - isBlittable: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [], modifiers: [ @@ -196,10 +175,7 @@ public void CompareDiffSmartEnum () ImmutableArray x = [ new ( name: "FirstProperty", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [], modifiers: [ @@ -218,10 +194,7 @@ public void CompareDiffSmartEnum () ImmutableArray y = [ new ( name: "FirstProperty", - type: "string", - isBlittable: false, - isSmartEnum: true, - isReferenceType: false, + returnType: new ("string", isSmartEnum: true), symbolAvailability: new (), attributes: [], modifiers: [ diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/PropertyTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/PropertyTests.cs index c1a1e56ec3de..a49caa2b73b0 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/PropertyTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/PropertyTests.cs @@ -23,10 +23,7 @@ public void BackingFieldTests (string propertyName) { var property = new Property ( name: propertyName, - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ReturnType ("string"), symbolAvailability: new (), attributes: [], modifiers: [], @@ -40,10 +37,7 @@ public void CompareDiffName () { var x = new Property ( name: "First", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new ("string"), symbolAvailability: new (), attributes: [], modifiers: [], @@ -51,10 +45,7 @@ public void CompareDiffName () ); var y = new Property ( name: "Second", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new ("string"), symbolAvailability: new (), attributes: [], modifiers: [], @@ -72,10 +63,7 @@ public void CompareDiffType () { var x = new Property ( name: "First", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("string"), symbolAvailability: new (), attributes: [], modifiers: [], @@ -83,10 +71,7 @@ public void CompareDiffType () ); var y = new Property ( name: "First", - type: "int", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ("int"), symbolAvailability: new (), attributes: [], modifiers: [], @@ -104,10 +89,14 @@ public void CompareDiffIsReferenceType () { var x = new Property ( name: "First", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ( + type: "string", + isBlittable: false, + isSmartEnum: false, + isNullable: false, + isArray: false, + isReferenceType: false + ), symbolAvailability: new (), attributes: [], modifiers: [], @@ -115,20 +104,24 @@ public void CompareDiffIsReferenceType () ); var y = new Property ( name: "First", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new ( + type: "string", + isBlittable: false, + isSmartEnum: false, + isNullable: false, + isArray: false, + isReferenceType: true + ), symbolAvailability: new (), attributes: [], modifiers: [], accessors: [] ); - Assert.False (x.Equals (y)); - Assert.False (y.Equals (x)); - Assert.False (x == y); - Assert.True (x != y); + Assert.False (condition: x.Equals (other: y)); + Assert.False (condition: y.Equals (other: x)); + Assert.False (condition: x == y); + Assert.True (condition: x != y); } [Fact] @@ -136,10 +129,14 @@ public void CompareDiffIsBlittableType () { var x = new Property ( name: "First", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ( + type: "string", + isBlittable: true, + isSmartEnum: false, + isNullable: false, + isArray: false, + isReferenceType: false + ), symbolAvailability: new (), attributes: [], modifiers: [], @@ -147,10 +144,14 @@ public void CompareDiffIsBlittableType () ); var y = new Property ( name: "First", - type: "string", - isBlittable: true, - isSmartEnum: false, - isReferenceType: false, + returnType: new ( + type: "string", + isBlittable: false, + isSmartEnum: false, + isNullable: false, + isArray: false, + isReferenceType: false + ), symbolAvailability: new (), attributes: [], modifiers: [], @@ -168,10 +169,14 @@ public void CompareDiffIsSmartEnum () { var x = new Property ( name: "First", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: false, + returnType: new ( + type: "string", + isBlittable: false, + isSmartEnum: true, + isNullable: false, + isArray: false, + isReferenceType: false + ), symbolAvailability: new (), attributes: [], modifiers: [], @@ -179,10 +184,14 @@ public void CompareDiffIsSmartEnum () ); var y = new Property ( name: "First", - type: "string", - isBlittable: false, - isSmartEnum: true, - isReferenceType: false, + returnType: new ( + type: "string", + isBlittable: false, + isSmartEnum: false, + isNullable: false, + isArray: false, + isReferenceType: false + ), symbolAvailability: new (), attributes: [], modifiers: [], @@ -198,11 +207,11 @@ public void CompareDiffIsSmartEnum () [Fact] public void CompareDiffAttrs () { - var x = new Property ("First", "string", false, false, false, new (), [ + var x = new Property ("First", new ("string"), new (), [ new ("Attr1"), new ("Attr2"), ], [], []); - var y = new Property ("First", "int", false, false, false, new (), [ + var y = new Property ("First", new ("string"), new (), [ new ("Attr2"), ], [], []); @@ -215,13 +224,13 @@ public void CompareDiffAttrs () [Fact] public void CompareDiffModifiers () { - var x = new Property ("First", "string", false, false, false, new (), [ + var x = new Property ("First", new ("string"), new (), [ new ("Attr1"), new ("Attr2"), ], [ SyntaxFactory.Token (SyntaxKind.AbstractKeyword) ], []); - var y = new Property ("First", "int", false, false, false, new (), [ + var y = new Property ("First", new ("string"), new (), [ new ("Attr1"), new ("Attr2"), ], [ @@ -237,7 +246,7 @@ public void CompareDiffModifiers () [Fact] public void CompareDiffAccessors () { - var x = new Property ("First", "string", false, false, false, new (), [ + var x = new Property ("First", new ("string"), new (), [ new ("Attr1"), new ("Attr2"), ], [ @@ -258,7 +267,7 @@ public void CompareDiffAccessors () modifiers: [] ), ]); - var y = new Property ("First", "int", false, false, false, new (), [ + var y = new Property ("First", new ("string"), new (), [ new ("Attr1"), new ("Attr2"), ], [ @@ -282,7 +291,7 @@ public void CompareDiffAccessors () [Fact] public void CompareDiffAccessorsExportData () { - var x = new Property ("First", "string", false, false, false, new (), [ + var x = new Property ("First", new ("string"), new (), [ new ("Attr1"), new ("Attr2"), ], [ @@ -296,7 +305,7 @@ public void CompareDiffAccessorsExportData () modifiers: [] ), ]); - var y = new Property ("First", "int", false, false, false, new (), [ + var y = new Property ("First", new ("string"), new (), [ new ("Attr1"), new ("Attr2"), ], [ @@ -320,7 +329,7 @@ public void CompareDiffAccessorsExportData () [Fact] public void CompareEquals () { - var x = new Property ("First", "string", false, false, false, new (), [ + var x = new Property ("First", new ("string"), new (), [ new ("Attr1"), new ("Attr2"), ], [ @@ -341,7 +350,7 @@ public void CompareEquals () modifiers: [] ), ]); - var y = new Property ("First", "string", false, false, false, new (), [ + var y = new Property ("First", new ("string"), new (), [ new ("Attr1"), new ("Attr2"), ], [ @@ -388,16 +397,13 @@ public class TestClass { automaticGetter, new Property ( name: "Name", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new (type: "string", isReferenceType: true), symbolAvailability: new (), attributes: [ - new ("ObjCBindings.ExportAttribute", ["name"]), + new (name: "ObjCBindings.ExportAttribute", arguments: ["name"]), ], modifiers: [ - SyntaxFactory.Token (SyntaxKind.PublicKeyword), + SyntaxFactory.Token (kind: SyntaxKind.PublicKeyword), ], accessors: [ new ( @@ -409,7 +415,7 @@ public class TestClass { ) ] ) { - ExportPropertyData = new ("name"), + ExportPropertyData = new (selector: "name"), } ]; @@ -429,16 +435,13 @@ public class TestClass { valueTypeProperty, new Property ( name: "Name", - type: "int", - isBlittable: true, - isSmartEnum: false, - isReferenceType: false, + returnType: new (type: "int", isBlittable: true), symbolAvailability: new (), attributes: [ - new ("ObjCBindings.ExportAttribute", ["name"]), + new (name: "ObjCBindings.ExportAttribute", arguments: ["name"]), ], modifiers: [ - SyntaxFactory.Token (SyntaxKind.PublicKeyword), + SyntaxFactory.Token (kind: SyntaxKind.PublicKeyword), ], accessors: [ new ( @@ -450,7 +453,7 @@ public class TestClass { ) ] ) { - ExportPropertyData = new ("name"), + ExportPropertyData = new (selector: "name"), }, ]; @@ -473,30 +476,27 @@ public string Name { automaticGetterExportData, new Property ( name: "Name", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new (type: "string", isReferenceType: true), symbolAvailability: new (), attributes: [ - new ("ObjCBindings.ExportAttribute", ["name"]), + new (name: "ObjCBindings.ExportAttribute", arguments: ["name"]), ], modifiers: [ - SyntaxFactory.Token (SyntaxKind.PublicKeyword), + SyntaxFactory.Token (kind: SyntaxKind.PublicKeyword), ], accessors: [ new ( accessorKind: AccessorKind.Getter, symbolAvailability: new (), - exportPropertyData: new ("myName"), + exportPropertyData: new (selector: "myName"), attributes: [ - new ("ObjCBindings.ExportAttribute", ["myName"]), + new (name: "ObjCBindings.ExportAttribute", arguments: ["myName"]), ], modifiers: [] ) ] ) { - ExportPropertyData = new ("name"), + ExportPropertyData = new (selector: "name"), }, ]; @@ -517,16 +517,13 @@ public class TestClass { automaticGetterSetter, new Property ( name: "Name", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new (type: "string", isReferenceType: true), symbolAvailability: new (), attributes: [ - new ("ObjCBindings.ExportAttribute", ["name"]), + new (name: "ObjCBindings.ExportAttribute", arguments: ["name"]), ], modifiers: [ - SyntaxFactory.Token (SyntaxKind.InternalKeyword), + SyntaxFactory.Token (kind: SyntaxKind.InternalKeyword), ], accessors: [ new ( @@ -544,7 +541,7 @@ public class TestClass { modifiers: [] ) ]) { - ExportPropertyData = new ("name"), + ExportPropertyData = new (selector: "name"), }, ]; @@ -570,38 +567,35 @@ internal string Name { automaticGetterSetterExportData, new Property ( name: "Name", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new (type: "string", isReferenceType: true), symbolAvailability: new (), attributes: [ - new ("ObjCBindings.ExportAttribute", ["name"]), + new (name: "ObjCBindings.ExportAttribute", arguments: ["name"]), ], modifiers: [ - SyntaxFactory.Token (SyntaxKind.InternalKeyword), + SyntaxFactory.Token (kind: SyntaxKind.InternalKeyword), ], accessors: [ new ( accessorKind: AccessorKind.Getter, symbolAvailability: new (), - exportPropertyData: new ("myName"), + exportPropertyData: new (selector: "myName"), attributes: [ - new ("ObjCBindings.ExportAttribute", ["myName"]), + new (name: "ObjCBindings.ExportAttribute", arguments: ["myName"]), ], modifiers: [] ), new ( accessorKind: AccessorKind.Setter, symbolAvailability: new (), - exportPropertyData: new ("setMyName"), + exportPropertyData: new (selector: "setMyName"), attributes: [ - new ("ObjCBindings.ExportAttribute", ["setMyName"]), + new (name: "ObjCBindings.ExportAttribute", arguments: ["setMyName"]), ], modifiers: [] ) ]) { - ExportPropertyData = new ("name"), + ExportPropertyData = new (selector: "name"), }, ]; @@ -618,14 +612,11 @@ public class TestClass { manualGetter, new Property ( name: "Name", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new (type: "string", isReferenceType: true), symbolAvailability: new (), attributes: [], modifiers: [ - SyntaxFactory.Token (SyntaxKind.PublicKeyword), + SyntaxFactory.Token (kind: SyntaxKind.PublicKeyword), ], accessors: [ new ( @@ -651,14 +642,11 @@ public class TestClass { expressionGetter, new Property ( name: "Name", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new (type: "string", isReferenceType: true), symbolAvailability: new (), attributes: [], modifiers: [ - SyntaxFactory.Token (SyntaxKind.PublicKeyword), + SyntaxFactory.Token (kind: SyntaxKind.PublicKeyword), ], accessors: [ new ( @@ -686,14 +674,11 @@ public string Name { expressionGetterSetter, new Property ( name: "Name", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new (type: "string", isReferenceType: true), symbolAvailability: new (), attributes: [], modifiers: [ - SyntaxFactory.Token (SyntaxKind.PublicKeyword), + SyntaxFactory.Token (kind: SyntaxKind.PublicKeyword), ], accessors: [ new ( @@ -729,14 +714,11 @@ public string Name { manualGetterSetter, new Property ( name: "Name", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new (type: "string", isReferenceType: true), symbolAvailability: new (), attributes: [], modifiers: [ - SyntaxFactory.Token (SyntaxKind.PublicKeyword), + SyntaxFactory.Token (kind: SyntaxKind.PublicKeyword), ], accessors: [ new ( @@ -772,14 +754,11 @@ public string Name { internalSetter, new Property ( name: "Name", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new (type: "string", isReferenceType: true), symbolAvailability: new (), attributes: [], modifiers: [ - SyntaxFactory.Token (SyntaxKind.PublicKeyword), + SyntaxFactory.Token (kind: SyntaxKind.PublicKeyword), ], accessors: [ new ( @@ -795,7 +774,7 @@ public string Name { exportPropertyData: null, attributes: [], modifiers: [ - SyntaxFactory.Token (SyntaxKind.InternalKeyword), + SyntaxFactory.Token (kind: SyntaxKind.InternalKeyword), ] ), ]) @@ -819,22 +798,19 @@ public string Name { "; var propertyAvailabilityBuilder = SymbolAvailability.CreateBuilder (); - propertyAvailabilityBuilder.Add (new SupportedOSPlatformData ("ios")); + propertyAvailabilityBuilder.Add (supportedPlatform: new SupportedOSPlatformData (platformName: "ios")); yield return [ propertyWithAttribute, new Property ( name: "Name", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new (type: "string", isReferenceType: true), symbolAvailability: propertyAvailabilityBuilder.ToImmutable (), attributes: [ - new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), + new (name: "System.Runtime.Versioning.SupportedOSPlatformAttribute", arguments: ["ios"]), ], modifiers: [ - SyntaxFactory.Token (SyntaxKind.PublicKeyword), + SyntaxFactory.Token (kind: SyntaxKind.PublicKeyword), ], accessors: [ new ( @@ -874,21 +850,18 @@ public string Name { var getterAvailabilityBuilder = SymbolAvailability.CreateBuilder (); var setterAvailabilityBuilder = SymbolAvailability.CreateBuilder (); - getterAvailabilityBuilder.Add (new SupportedOSPlatformData ("ios17.0")); + getterAvailabilityBuilder.Add (supportedPlatform: new SupportedOSPlatformData (platformName: "ios17.0")); yield return [ propertyGetterWithAttribute, new Property ( name: "Name", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new (type: "string", isReferenceType: true), symbolAvailability: propertyAvailabilityBuilder.ToImmutable (), attributes: [ - new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), + new (name: "System.Runtime.Versioning.SupportedOSPlatformAttribute", arguments: ["ios"]), ], modifiers: [ - SyntaxFactory.Token (SyntaxKind.PublicKeyword), + SyntaxFactory.Token (kind: SyntaxKind.PublicKeyword), ], accessors: [ new ( @@ -896,7 +869,7 @@ public string Name { symbolAvailability: getterAvailabilityBuilder.ToImmutable (), exportPropertyData: null, attributes: [ - new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios17.0"]), + new (name: "System.Runtime.Versioning.SupportedOSPlatformAttribute", arguments: ["ios17.0"]), ], modifiers: [] ), @@ -931,23 +904,20 @@ public string Name { getterAvailabilityBuilder.Clear (); setterAvailabilityBuilder.Clear (); - getterAvailabilityBuilder.Add (new SupportedOSPlatformData ("ios17.0")); - setterAvailabilityBuilder.Add (new SupportedOSPlatformData ("ios18.0")); + getterAvailabilityBuilder.Add (supportedPlatform: new SupportedOSPlatformData (platformName: "ios17.0")); + setterAvailabilityBuilder.Add (supportedPlatform: new SupportedOSPlatformData (platformName: "ios18.0")); yield return [ propertyWithGetterAndSetterWithAttribute, new Property ( name: "Name", - type: "string", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new (type: "string", isReferenceType: true), symbolAvailability: propertyAvailabilityBuilder.ToImmutable (), attributes: [ - new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), + new (name: "System.Runtime.Versioning.SupportedOSPlatformAttribute", arguments: ["ios"]), ], modifiers: [ - SyntaxFactory.Token (SyntaxKind.PublicKeyword), + SyntaxFactory.Token (kind: SyntaxKind.PublicKeyword), ], accessors: [ new ( @@ -955,7 +925,7 @@ public string Name { symbolAvailability: getterAvailabilityBuilder.ToImmutable (), exportPropertyData: null, attributes: [ - new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios17.0"]), + new (name: "System.Runtime.Versioning.SupportedOSPlatformAttribute", arguments: ["ios17.0"]), ], modifiers: [] ), @@ -964,7 +934,7 @@ public string Name { symbolAvailability: setterAvailabilityBuilder.ToImmutable (), exportPropertyData: null, attributes: [ - new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios18.0"]), + new (name: "System.Runtime.Versioning.SupportedOSPlatformAttribute", arguments: ["ios18.0"]), ], modifiers: [] ), @@ -995,23 +965,20 @@ public Utils.MyClass Name { "; getterAvailabilityBuilder.Clear (); setterAvailabilityBuilder.Clear (); - getterAvailabilityBuilder.Add (new SupportedOSPlatformData ("ios17.0")); - setterAvailabilityBuilder.Add (new SupportedOSPlatformData ("ios18.0")); + getterAvailabilityBuilder.Add (supportedPlatform: new SupportedOSPlatformData (platformName: "ios17.0")); + setterAvailabilityBuilder.Add (supportedPlatform: new SupportedOSPlatformData (platformName: "ios18.0")); yield return [ propertyWithCustomType, new Property ( name: "Name", - type: "Utils.MyClass", - isBlittable: false, - isSmartEnum: false, - isReferenceType: true, + returnType: new (type: "Utils.MyClass", isReferenceType: true), symbolAvailability: propertyAvailabilityBuilder.ToImmutable (), attributes: [ - new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios"]), + new (name: "System.Runtime.Versioning.SupportedOSPlatformAttribute", arguments: ["ios"]), ], modifiers: [ - SyntaxFactory.Token (SyntaxKind.PublicKeyword), + SyntaxFactory.Token (kind: SyntaxKind.PublicKeyword), ], accessors: [ new ( @@ -1019,7 +986,7 @@ public Utils.MyClass Name { symbolAvailability: getterAvailabilityBuilder.ToImmutable (), exportPropertyData: null, attributes: [ - new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios17.0"]), + new (name: "System.Runtime.Versioning.SupportedOSPlatformAttribute", arguments: ["ios17.0"]), ], modifiers: [] ), @@ -1028,7 +995,7 @@ public Utils.MyClass Name { symbolAvailability: setterAvailabilityBuilder.ToImmutable (), exportPropertyData: null, attributes: [ - new ("System.Runtime.Versioning.SupportedOSPlatformAttribute", ["ios18.0"]), + new (name: "System.Runtime.Versioning.SupportedOSPlatformAttribute", arguments: ["ios18.0"]), ], modifiers: [] ), diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodReturnTypeTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ReturnTypeTests.cs similarity index 99% rename from tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodReturnTypeTests.cs rename to tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ReturnTypeTests.cs index 0d26892fb12a..2d7958492b30 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodReturnTypeTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ReturnTypeTests.cs @@ -10,7 +10,7 @@ namespace Microsoft.Macios.Generator.Tests.DataModel; -public class MethodReturnTypeTests : BaseGeneratorTestClass { +public class ReturnTypeTests : BaseGeneratorTestClass { class TestDataFromMethodDeclaration : IEnumerable { public IEnumerator GetEnumerator () From 7cdc70a169e351dab7ddf603de2414c65c646972 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Thu, 9 Jan 2025 17:33:42 -0500 Subject: [PATCH 4/8] [RGen] Add license header to files. (#21936) --- src/rgen/Microsoft.Macios.Bindings.Analyzer.Sample/Examples.cs | 3 ++- .../BindingTypeSemanticAnalyzer.cs | 2 ++ .../Extensions/IBindingTypeAnalyzerExtensions.cs | 2 ++ .../Extensions/PlatformNameExtensions.cs | 2 ++ .../Microsoft.Macios.Bindings.Analyzer/IBindingTypeAnalyzer.cs | 2 ++ .../Microsoft.Macios.Bindings.Analyzer/SmartEnumsAnalyzer.cs | 2 ++ .../BindingTypeCodeFixProvider.cs | 2 ++ src/rgen/Microsoft.Macios.Generator.Sample/SampleBinding.cs | 2 ++ .../Attributes/AttributeParsingError.cs | 2 ++ .../Microsoft.Macios.Generator/Attributes/BindingTypeData.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/Attributes/ExportData.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/Attributes/FieldData.cs | 2 ++ .../Attributes/ObsoletedOSPlatformData.cs | 2 ++ .../Attributes/SupportedOSPlatformData.cs | 2 ++ .../Attributes/UnsupportedOSPlatformData.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/AttributesNames.cs | 2 ++ .../Availability/PlatformAvailability.cs | 2 ++ .../Availability/PlatformAvailabilityBuilder.cs | 2 ++ .../Availability/SymbolAvailability.cs | 2 ++ .../Availability/SymbolAvailabilityBuilder.cs | 2 ++ .../BindingSourceGeneratorGenerator.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/CollectionComparer.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/Context/BindingContext.cs | 2 ++ .../Microsoft.Macios.Generator/Context/RootBindingContext.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/DataModel/Accessor.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/DataModel/AccessorKind.cs | 2 ++ .../DataModel/AccessorsEqualityComparer.cs | 2 ++ .../DataModel/AttributeCodeChange.cs | 2 ++ .../DataModel/AttributesEqualityComparer.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/DataModel/BindingInfo.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/DataModel/BindingType.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/DataModel/CodeChanges.cs | 2 ++ .../DataModel/CodeChangesEqualityComparer.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/DataModel/Constructor.cs | 2 ++ .../DataModel/ConstructorComparer.cs | 2 ++ .../DataModel/ConstructorsEqualityComparer.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/DataModel/DelegateInfo.cs | 2 ++ .../Microsoft.Macios.Generator/DataModel/DelegateParameter.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/DataModel/EnumMember.cs | 2 ++ .../DataModel/EnumMembersEqualityComparer.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/DataModel/Event.cs | 2 ++ .../DataModel/EventEqualityComparer.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/DataModel/Method.cs | 2 ++ .../Microsoft.Macios.Generator/DataModel/MethodComparer.cs | 2 ++ .../DataModel/MethodReturnTypeComparer.cs | 2 ++ .../DataModel/MethodsEqualityComparer.cs | 2 ++ .../DataModel/ModifiersEqualityComparer.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/DataModel/Parameter.cs | 2 ++ .../Microsoft.Macios.Generator/DataModel/ParameterComparer.cs | 2 ++ .../DataModel/ParameterEqualityComparer.cs | 2 ++ .../DataModel/PropertiesEqualityComparer.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/DataModel/Property.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/DataModel/ReferenceKind.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/DataModel/ReturnType.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/Diagnostics.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/DictionaryComparer.cs | 2 ++ .../Microsoft.Macios.Generator/Emitters/CategoryEmitter.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/Emitters/ClassEmitter.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/Emitters/EmitterFactory.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/Emitters/EnumEmitter.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/Emitters/ICodeEmitter.cs | 2 ++ .../Microsoft.Macios.Generator/Emitters/InterfaceEmitter.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/Emitters/LibraryEmitter.cs | 2 ++ .../Microsoft.Macios.Generator/Emitters/TrampolineEmitter.cs | 2 ++ .../Extensions/AccessorDeclarationSyntaxExtensions.cs | 2 ++ .../Extensions/BaseTypeDeclarationSyntaxExtensions.cs | 2 ++ .../Extensions/CompilationExtensions.cs | 2 ++ .../Extensions/FieldSymbolExtensions.cs | 2 ++ .../Extensions/MemberDeclarationSyntaxExtensions.cs | 2 ++ .../Extensions/NamedTypeSymbolExtensions.cs | 2 ++ .../Extensions/ParameterSyntaxExtensions.cs | 2 ++ .../Extensions/SemanticModelExtensions.cs | 2 ++ .../Extensions/SourceProductionContextExtensions.cs | 2 ++ .../Microsoft.Macios.Generator/Extensions/StringExtensions.cs | 2 ++ .../Extensions/SyntaxTreeExtensions.cs | 2 ++ .../Extensions/TypeSymbolExtensions.cs | 2 ++ .../Extensions/TypedConstantExtensions.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/ExtraSources.cs | 2 ++ .../Formatters/ConstructorFormatter.cs | 2 ++ .../Microsoft.Macios.Generator/Formatters/MethodFormatter.cs | 2 ++ .../Formatters/ParameterFormatter.cs | 2 ++ .../Microsoft.Macios.Generator/Formatters/PropertyFormatter.cs | 2 ++ .../Formatters/ReturnTypeFormatter.cs | 2 ++ .../Formatters/SmartEnumFormatter.cs | 2 ++ src/rgen/Microsoft.Macios.Generator/TabbedStringBuilder.cs | 2 ++ src/rgen/Microsoft.Macios.Transformer/Main.cs | 2 ++ src/rgen/Microsoft.Macios.Transformer/TransformCommand.cs | 2 ++ .../BaseGeneratorWithAnalyzerTestClass.cs | 2 ++ .../BindingTypeSemanticAnalyzerTests.cs | 2 ++ .../SmartEnumsAnalyzerTests.cs | 2 ++ .../BaseCodeFixerTestClass.cs | 2 ++ .../BindingTypeCodeFixProviderTests.cs | 2 ++ .../Attributes/AttributeParsingErrorTests.cs | 2 ++ .../Attributes/ExportDataTests.cs | 2 ++ .../Attributes/FieldDataTests.cs | 2 ++ .../Microsoft.Macios.Generator.Tests/AttributesNamesTests.cs | 2 ++ .../Availability/PlatformAvailabilityEqualityTests.cs | 2 ++ .../Availability/PlatformAvailabilityMergeTests.cs | 2 ++ .../Availability/PlatformAvailabilityTests.cs | 2 ++ .../Availability/PlatformAvailabilityToStringTests.cs | 2 ++ .../Availability/SymbolAvailabilityEqualityTests.cs | 2 ++ .../Availability/SymbolAvailabilityMergeTests.cs | 2 ++ .../Availability/SymbolAvailabilityTests.cs | 2 ++ .../Availability/SymbolAvailabilityToStringTests.cs | 2 ++ .../Microsoft.Macios.Generator.Tests/BaseGeneratorTestClass.cs | 2 ++ .../Microsoft.Macios.Generator.Tests/BaseTestDataGenerator.cs | 2 ++ .../BindingSourceGeneratorGeneratorTests.cs | 2 ++ .../Classes/ClassGenerationTests.cs | 2 ++ .../CollectionComparerTests.cs | 2 ++ .../rgen/Microsoft.Macios.Generator.Tests/CompilationResult.cs | 2 ++ .../Context/RootBindingContextTests.cs | 2 ++ .../DataModel/AccessorKindTests.cs | 2 ++ .../DataModel/AccessorTests.cs | 2 ++ .../DataModel/AccessorsEqualityComparerTests.cs | 2 ++ .../DataModel/AttributeCodeChangeTests.cs | 2 ++ .../DataModel/AttributeComparerTests.cs | 2 ++ .../DataModel/AttributesEqualityComparerTests.cs | 2 ++ .../DataModel/BindingInfoTests.cs | 2 ++ .../DataModel/ClassCodeChangesTests.cs | 2 ++ .../DataModel/CodeChangesComparerTests.cs | 2 ++ .../DataModel/CodeChangesEqualityComparerTests.cs | 2 ++ .../DataModel/CodeChangesTests.cs | 2 ++ .../DataModel/ConstructorComparerTests.cs | 2 ++ .../DataModel/ConstructorTests.cs | 2 ++ .../DataModel/ConstructorsEqualityComparerTests.cs | 2 ++ .../DataModel/DelegateInfoTests.cs | 2 ++ .../DataModel/DelegateParameterTests.cs | 2 ++ .../DataModel/EnumDeclarationCodeChangesTests.cs | 2 ++ .../DataModel/EnumMemberCodeChangesTests.cs | 2 ++ .../DataModel/EnumMembersEqualityComparerTests.cs | 2 ++ .../DataModel/EventEqualityComparerTests.cs | 2 ++ .../Microsoft.Macios.Generator.Tests/DataModel/EventTests.cs | 2 ++ .../DataModel/InterfaceCodeChangesTests.cs | 2 ++ .../DataModel/MethodComparerTests.cs | 2 ++ .../DataModel/MethodEqualityComparerTests.cs | 2 ++ .../DataModel/MethodReturnTypeComparerTests.cs | 2 ++ .../Microsoft.Macios.Generator.Tests/DataModel/MethodTests.cs | 2 ++ .../DataModel/ModifiersEqualityComparerTests.cs | 2 ++ .../DataModel/PropertiesEqualityComparerTests.cs | 2 ++ .../DataModel/PropertyTests.cs | 2 ++ .../DataModel/ReferenceKindTests.cs | 2 ++ .../DataModel/ReturnTypeTests.cs | 2 ++ .../DictionaryComparerTests.cs | 2 ++ .../Emitters/EmitterFactoryTests.cs | 2 ++ .../Extensions/BaseTypeDeclarationSyntaxExtensionsTests.cs | 2 ++ .../Extensions/CompilationExtensionsTest.cs | 2 ++ .../Extensions/FieldSymbolExtensionsTests.cs | 2 ++ .../Extensions/MemberDeclarationSyntaxExtensionsTests.cs | 2 ++ .../Extensions/NamedTypeSymbolExtensionsTests.cs | 2 ++ .../Extensions/SemanticModelExtensionsTests.cs | 2 ++ .../Extensions/StringExtensionsTests.cs | 2 ++ .../Extensions/SyntaxTreeExtensionsTests.cs | 2 ++ .../Extensions/TypeSymbolExtensionsTests.cs | 2 ++ .../Formatters/ConstructorFormatterTests.cs | 2 ++ .../Formatters/MethodFormatterTests.cs | 2 ++ .../Formatters/PropertyFormatterTests.cs | 2 ++ .../Formatters/SmartEnumFormatterTests.cs | 2 ++ .../SmartEnum/SmartEnumDiagnosticsTests.cs | 2 ++ .../TabbedStringBuilderTests.cs | 2 ++ tests/rgen/Microsoft.Macios.Transformer.Tests/UnitTest1.cs | 2 ++ 160 files changed, 320 insertions(+), 1 deletion(-) diff --git a/src/rgen/Microsoft.Macios.Bindings.Analyzer.Sample/Examples.cs b/src/rgen/Microsoft.Macios.Bindings.Analyzer.Sample/Examples.cs index e5d4a943ddf0..1a3835af3a23 100644 --- a/src/rgen/Microsoft.Macios.Bindings.Analyzer.Sample/Examples.cs +++ b/src/rgen/Microsoft.Macios.Bindings.Analyzer.Sample/Examples.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Foundation; using ObjCBindings; @@ -30,4 +32,3 @@ public enum Test { } } - diff --git a/src/rgen/Microsoft.Macios.Bindings.Analyzer/BindingTypeSemanticAnalyzer.cs b/src/rgen/Microsoft.Macios.Bindings.Analyzer/BindingTypeSemanticAnalyzer.cs index 6d8d8d07a7cc..482c409b7455 100644 --- a/src/rgen/Microsoft.Macios.Bindings.Analyzer/BindingTypeSemanticAnalyzer.cs +++ b/src/rgen/Microsoft.Macios.Bindings.Analyzer/BindingTypeSemanticAnalyzer.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Immutable; using System.Linq; using Microsoft.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Bindings.Analyzer/Extensions/IBindingTypeAnalyzerExtensions.cs b/src/rgen/Microsoft.Macios.Bindings.Analyzer/Extensions/IBindingTypeAnalyzerExtensions.cs index e0d6a0e57baf..1079f5e45b37 100644 --- a/src/rgen/Microsoft.Macios.Bindings.Analyzer/Extensions/IBindingTypeAnalyzerExtensions.cs +++ b/src/rgen/Microsoft.Macios.Bindings.Analyzer/Extensions/IBindingTypeAnalyzerExtensions.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/rgen/Microsoft.Macios.Bindings.Analyzer/Extensions/PlatformNameExtensions.cs b/src/rgen/Microsoft.Macios.Bindings.Analyzer/Extensions/PlatformNameExtensions.cs index 2564975dfbe2..1e8266006427 100644 --- a/src/rgen/Microsoft.Macios.Bindings.Analyzer/Extensions/PlatformNameExtensions.cs +++ b/src/rgen/Microsoft.Macios.Bindings.Analyzer/Extensions/PlatformNameExtensions.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Xamarin.Utils; namespace Microsoft.Macios.Bindings.Analyzer.Extensions; diff --git a/src/rgen/Microsoft.Macios.Bindings.Analyzer/IBindingTypeAnalyzer.cs b/src/rgen/Microsoft.Macios.Bindings.Analyzer/IBindingTypeAnalyzer.cs index 71855d16413c..4a16c6876bc9 100644 --- a/src/rgen/Microsoft.Macios.Bindings.Analyzer/IBindingTypeAnalyzer.cs +++ b/src/rgen/Microsoft.Macios.Bindings.Analyzer/IBindingTypeAnalyzer.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Immutable; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; diff --git a/src/rgen/Microsoft.Macios.Bindings.Analyzer/SmartEnumsAnalyzer.cs b/src/rgen/Microsoft.Macios.Bindings.Analyzer/SmartEnumsAnalyzer.cs index e4818a1af68d..3413f74a7b44 100644 --- a/src/rgen/Microsoft.Macios.Bindings.Analyzer/SmartEnumsAnalyzer.cs +++ b/src/rgen/Microsoft.Macios.Bindings.Analyzer/SmartEnumsAnalyzer.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; diff --git a/src/rgen/Microsoft.Macios.Bindings.CodeFixers/BindingTypeCodeFixProvider.cs b/src/rgen/Microsoft.Macios.Bindings.CodeFixers/BindingTypeCodeFixProvider.cs index af5b3790e887..946da3d53c55 100644 --- a/src/rgen/Microsoft.Macios.Bindings.CodeFixers/BindingTypeCodeFixProvider.cs +++ b/src/rgen/Microsoft.Macios.Bindings.CodeFixers/BindingTypeCodeFixProvider.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Immutable; using System.Composition; using System.Linq; diff --git a/src/rgen/Microsoft.Macios.Generator.Sample/SampleBinding.cs b/src/rgen/Microsoft.Macios.Generator.Sample/SampleBinding.cs index 7c2427c1473e..d636e8b6d18d 100644 --- a/src/rgen/Microsoft.Macios.Generator.Sample/SampleBinding.cs +++ b/src/rgen/Microsoft.Macios.Generator.Sample/SampleBinding.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using ObjCBindings; namespace Microsoft.Macios.Generator.Sample; diff --git a/src/rgen/Microsoft.Macios.Generator/Attributes/AttributeParsingError.cs b/src/rgen/Microsoft.Macios.Generator/Attributes/AttributeParsingError.cs index ad8dd516b643..5ed9d9349976 100644 --- a/src/rgen/Microsoft.Macios.Generator/Attributes/AttributeParsingError.cs +++ b/src/rgen/Microsoft.Macios.Generator/Attributes/AttributeParsingError.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Diagnostics.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/Attributes/BindingTypeData.cs b/src/rgen/Microsoft.Macios.Generator/Attributes/BindingTypeData.cs index c518a0aa7154..d9258f5620be 100644 --- a/src/rgen/Microsoft.Macios.Generator/Attributes/BindingTypeData.cs +++ b/src/rgen/Microsoft.Macios.Generator/Attributes/BindingTypeData.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Diagnostics.CodeAnalysis; using Microsoft.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/Attributes/ExportData.cs b/src/rgen/Microsoft.Macios.Generator/Attributes/ExportData.cs index 6c808ccf2eee..786d4de85902 100644 --- a/src/rgen/Microsoft.Macios.Generator/Attributes/ExportData.cs +++ b/src/rgen/Microsoft.Macios.Generator/Attributes/ExportData.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Diagnostics.CodeAnalysis; using Microsoft.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/Attributes/FieldData.cs b/src/rgen/Microsoft.Macios.Generator/Attributes/FieldData.cs index acd4eecd8be1..c927de5e9a57 100644 --- a/src/rgen/Microsoft.Macios.Generator/Attributes/FieldData.cs +++ b/src/rgen/Microsoft.Macios.Generator/Attributes/FieldData.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Diagnostics.CodeAnalysis; using Microsoft.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/Attributes/ObsoletedOSPlatformData.cs b/src/rgen/Microsoft.Macios.Generator/Attributes/ObsoletedOSPlatformData.cs index dbcde5046c49..66d9168f5795 100644 --- a/src/rgen/Microsoft.Macios.Generator/Attributes/ObsoletedOSPlatformData.cs +++ b/src/rgen/Microsoft.Macios.Generator/Attributes/ObsoletedOSPlatformData.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Diagnostics.CodeAnalysis; using Microsoft.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/Attributes/SupportedOSPlatformData.cs b/src/rgen/Microsoft.Macios.Generator/Attributes/SupportedOSPlatformData.cs index 1ca6deae2b34..35d0a168b6e2 100644 --- a/src/rgen/Microsoft.Macios.Generator/Attributes/SupportedOSPlatformData.cs +++ b/src/rgen/Microsoft.Macios.Generator/Attributes/SupportedOSPlatformData.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Diagnostics.CodeAnalysis; using Microsoft.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/Attributes/UnsupportedOSPlatformData.cs b/src/rgen/Microsoft.Macios.Generator/Attributes/UnsupportedOSPlatformData.cs index e6d733bcbe62..cdf39b7b59a8 100644 --- a/src/rgen/Microsoft.Macios.Generator/Attributes/UnsupportedOSPlatformData.cs +++ b/src/rgen/Microsoft.Macios.Generator/Attributes/UnsupportedOSPlatformData.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Diagnostics.CodeAnalysis; using Microsoft.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/AttributesNames.cs b/src/rgen/Microsoft.Macios.Generator/AttributesNames.cs index 6c5ea2ba7554..2a59e148b1ae 100644 --- a/src/rgen/Microsoft.Macios.Generator/AttributesNames.cs +++ b/src/rgen/Microsoft.Macios.Generator/AttributesNames.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; namespace Microsoft.Macios.Generator; diff --git a/src/rgen/Microsoft.Macios.Generator/Availability/PlatformAvailability.cs b/src/rgen/Microsoft.Macios.Generator/Availability/PlatformAvailability.cs index 38b2ffcd190f..ba83bb51bed1 100644 --- a/src/rgen/Microsoft.Macios.Generator/Availability/PlatformAvailability.cs +++ b/src/rgen/Microsoft.Macios.Generator/Availability/PlatformAvailability.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using System.Linq; diff --git a/src/rgen/Microsoft.Macios.Generator/Availability/PlatformAvailabilityBuilder.cs b/src/rgen/Microsoft.Macios.Generator/Availability/PlatformAvailabilityBuilder.cs index d69fffdf38ab..0c9905c9d014 100644 --- a/src/rgen/Microsoft.Macios.Generator/Availability/PlatformAvailabilityBuilder.cs +++ b/src/rgen/Microsoft.Macios.Generator/Availability/PlatformAvailabilityBuilder.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using Microsoft.Macios.Generator.Attributes; diff --git a/src/rgen/Microsoft.Macios.Generator/Availability/SymbolAvailability.cs b/src/rgen/Microsoft.Macios.Generator/Availability/SymbolAvailability.cs index c6f87777b790..29c3ab988327 100644 --- a/src/rgen/Microsoft.Macios.Generator/Availability/SymbolAvailability.cs +++ b/src/rgen/Microsoft.Macios.Generator/Availability/SymbolAvailability.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using System.Linq; diff --git a/src/rgen/Microsoft.Macios.Generator/Availability/SymbolAvailabilityBuilder.cs b/src/rgen/Microsoft.Macios.Generator/Availability/SymbolAvailabilityBuilder.cs index dac67c00bb34..c606e858c0e2 100644 --- a/src/rgen/Microsoft.Macios.Generator/Availability/SymbolAvailabilityBuilder.cs +++ b/src/rgen/Microsoft.Macios.Generator/Availability/SymbolAvailabilityBuilder.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using Microsoft.Macios.Generator.Attributes; diff --git a/src/rgen/Microsoft.Macios.Generator/BindingSourceGeneratorGenerator.cs b/src/rgen/Microsoft.Macios.Generator/BindingSourceGeneratorGenerator.cs index c922071bc749..f4f26afa3e76 100644 --- a/src/rgen/Microsoft.Macios.Generator/BindingSourceGeneratorGenerator.cs +++ b/src/rgen/Microsoft.Macios.Generator/BindingSourceGeneratorGenerator.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.Immutable; using System.IO; diff --git a/src/rgen/Microsoft.Macios.Generator/CollectionComparer.cs b/src/rgen/Microsoft.Macios.Generator/CollectionComparer.cs index 5f0d9718841d..ee9675a579f6 100644 --- a/src/rgen/Microsoft.Macios.Generator/CollectionComparer.cs +++ b/src/rgen/Microsoft.Macios.Generator/CollectionComparer.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using System.Linq; diff --git a/src/rgen/Microsoft.Macios.Generator/Context/BindingContext.cs b/src/rgen/Microsoft.Macios.Generator/Context/BindingContext.cs index 353065f15ea6..060ff84ad4b1 100644 --- a/src/rgen/Microsoft.Macios.Generator/Context/BindingContext.cs +++ b/src/rgen/Microsoft.Macios.Generator/Context/BindingContext.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Microsoft.Macios.Generator.DataModel; namespace Microsoft.Macios.Generator.Context; diff --git a/src/rgen/Microsoft.Macios.Generator/Context/RootBindingContext.cs b/src/rgen/Microsoft.Macios.Generator/Context/RootBindingContext.cs index 61b909e90537..31938667a87f 100644 --- a/src/rgen/Microsoft.Macios.Generator/Context/RootBindingContext.cs +++ b/src/rgen/Microsoft.Macios.Generator/Context/RootBindingContext.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/Accessor.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/Accessor.cs index bd017d5f83e0..989f33a23562 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/Accessor.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/Accessor.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Immutable; using System.Linq; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/AccessorKind.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/AccessorKind.cs index 13b5357f68af..dc0bab1054dd 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/AccessorKind.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/AccessorKind.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Microsoft.CodeAnalysis.CSharp; namespace Microsoft.Macios.Generator.DataModel; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/AccessorsEqualityComparer.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/AccessorsEqualityComparer.cs index a460fea45325..7fd5e40aa933 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/AccessorsEqualityComparer.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/AccessorsEqualityComparer.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using System.Collections.Immutable; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/AttributeCodeChange.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/AttributeCodeChange.cs index 993c40a97b51..b58abbf18bf4 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/AttributeCodeChange.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/AttributeCodeChange.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Immutable; using Microsoft.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/AttributesEqualityComparer.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/AttributesEqualityComparer.cs index da83529093eb..1101a14c3933 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/AttributesEqualityComparer.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/AttributesEqualityComparer.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using System.Collections.Immutable; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/BindingInfo.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/BindingInfo.cs index ac22bf50517b..7b82d096698c 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/BindingInfo.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/BindingInfo.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Runtime.InteropServices; using Microsoft.Macios.Generator.Attributes; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/BindingType.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/BindingType.cs index 3c22bed6f1bb..200142a22090 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/BindingType.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/BindingType.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. namespace Microsoft.Macios.Generator.DataModel; /// diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/CodeChanges.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/CodeChanges.cs index 834c9fda7bfe..50c18fa69c72 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/CodeChanges.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/CodeChanges.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/CodeChangesEqualityComparer.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/CodeChangesEqualityComparer.cs index 12c4843f1fa9..8231c2c2436a 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/CodeChangesEqualityComparer.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/CodeChangesEqualityComparer.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/Constructor.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/Constructor.cs index 0e2b1945edb0..c57ccfa93a98 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/Constructor.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/Constructor.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Immutable; using System.Diagnostics.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/ConstructorComparer.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/ConstructorComparer.cs index 4faf8638a92a..6ce3fa4ecc4c 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/ConstructorComparer.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/ConstructorComparer.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using System.Linq; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/ConstructorsEqualityComparer.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/ConstructorsEqualityComparer.cs index 85f3bb312a31..6b460089e79a 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/ConstructorsEqualityComparer.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/ConstructorsEqualityComparer.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using System.Collections.Immutable; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/DelegateInfo.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/DelegateInfo.cs index a33b116bbaf9..a82c3426cf4f 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/DelegateInfo.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/DelegateInfo.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Immutable; using System.Diagnostics.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/DelegateParameter.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/DelegateParameter.cs index 8c2ecf50117b..4bfb57191d38 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/DelegateParameter.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/DelegateParameter.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Diagnostics.CodeAnalysis; using System.Text; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/EnumMember.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/EnumMember.cs index 8999f8fd0260..8b51297e7cb5 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/EnumMember.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/EnumMember.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Immutable; using System.Text; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/EnumMembersEqualityComparer.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/EnumMembersEqualityComparer.cs index 7f759f8b9cc0..e26ecbf340a1 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/EnumMembersEqualityComparer.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/EnumMembersEqualityComparer.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using System.Collections.Immutable; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/Event.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/Event.cs index 119244996ca4..518b20aeb01e 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/Event.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/Event.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Immutable; using System.Diagnostics.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/EventEqualityComparer.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/EventEqualityComparer.cs index bee09b9e1736..6aa4fd9a017b 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/EventEqualityComparer.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/EventEqualityComparer.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using System.Collections.Immutable; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/Method.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/Method.cs index f6309af8fab8..1d2bddf66211 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/Method.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/Method.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Immutable; using System.Diagnostics.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/MethodComparer.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/MethodComparer.cs index 3316caf3227c..8a32767b8fee 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/MethodComparer.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/MethodComparer.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using System.Linq; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/MethodReturnTypeComparer.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/MethodReturnTypeComparer.cs index 754cfac875ba..38acaaa5928d 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/MethodReturnTypeComparer.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/MethodReturnTypeComparer.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/MethodsEqualityComparer.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/MethodsEqualityComparer.cs index 99a6ac6d66c2..fd73ceb69e74 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/MethodsEqualityComparer.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/MethodsEqualityComparer.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using System.Collections.Immutable; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/ModifiersEqualityComparer.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/ModifiersEqualityComparer.cs index 80eb3030da42..63c99e0f6870 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/ModifiersEqualityComparer.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/ModifiersEqualityComparer.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using System.Collections.Immutable; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/Parameter.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/Parameter.cs index 7ede6ec0b916..ab3f25b149b1 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/Parameter.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/Parameter.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Immutable; using System.Diagnostics.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/ParameterComparer.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/ParameterComparer.cs index bd21759b008b..d3b02979e688 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/ParameterComparer.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/ParameterComparer.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/ParameterEqualityComparer.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/ParameterEqualityComparer.cs index 19c1e9a81cca..8e0e42245306 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/ParameterEqualityComparer.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/ParameterEqualityComparer.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using System.Collections.Immutable; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/PropertiesEqualityComparer.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/PropertiesEqualityComparer.cs index 4428001df0d5..d42f1dada03e 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/PropertiesEqualityComparer.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/PropertiesEqualityComparer.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using System.Collections.Immutable; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/Property.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/Property.cs index d31fdc3a22a2..a846eb51f95f 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/Property.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/Property.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Immutable; using System.Diagnostics.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/ReferenceKind.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/ReferenceKind.cs index bd2725c49fdc..6eb057d63704 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/ReferenceKind.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/ReferenceKind.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; diff --git a/src/rgen/Microsoft.Macios.Generator/DataModel/ReturnType.cs b/src/rgen/Microsoft.Macios.Generator/DataModel/ReturnType.cs index 389ba5cad408..bbcfbcc570d4 100644 --- a/src/rgen/Microsoft.Macios.Generator/DataModel/ReturnType.cs +++ b/src/rgen/Microsoft.Macios.Generator/DataModel/ReturnType.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Text; using Microsoft.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/Diagnostics.cs b/src/rgen/Microsoft.Macios.Generator/Diagnostics.cs index 5e317cbb9f12..d99c4983cf56 100644 --- a/src/rgen/Microsoft.Macios.Generator/Diagnostics.cs +++ b/src/rgen/Microsoft.Macios.Generator/Diagnostics.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Microsoft.CodeAnalysis; namespace Microsoft.Macios.Generator; diff --git a/src/rgen/Microsoft.Macios.Generator/DictionaryComparer.cs b/src/rgen/Microsoft.Macios.Generator/DictionaryComparer.cs index 02f8e3058f2c..2c81566d4b9e 100644 --- a/src/rgen/Microsoft.Macios.Generator/DictionaryComparer.cs +++ b/src/rgen/Microsoft.Macios.Generator/DictionaryComparer.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using System.Linq; diff --git a/src/rgen/Microsoft.Macios.Generator/Emitters/CategoryEmitter.cs b/src/rgen/Microsoft.Macios.Generator/Emitters/CategoryEmitter.cs index 0e9070aa8cbd..062ffb944468 100644 --- a/src/rgen/Microsoft.Macios.Generator/Emitters/CategoryEmitter.cs +++ b/src/rgen/Microsoft.Macios.Generator/Emitters/CategoryEmitter.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/Emitters/ClassEmitter.cs b/src/rgen/Microsoft.Macios.Generator/Emitters/ClassEmitter.cs index c6f210b95ea2..a683f06ca5c9 100644 --- a/src/rgen/Microsoft.Macios.Generator/Emitters/ClassEmitter.cs +++ b/src/rgen/Microsoft.Macios.Generator/Emitters/ClassEmitter.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using System.Collections.Immutable; diff --git a/src/rgen/Microsoft.Macios.Generator/Emitters/EmitterFactory.cs b/src/rgen/Microsoft.Macios.Generator/Emitters/EmitterFactory.cs index 6a9a0f6f879a..b0c0e516f462 100644 --- a/src/rgen/Microsoft.Macios.Generator/Emitters/EmitterFactory.cs +++ b/src/rgen/Microsoft.Macios.Generator/Emitters/EmitterFactory.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using Microsoft.Macios.Generator.DataModel; diff --git a/src/rgen/Microsoft.Macios.Generator/Emitters/EnumEmitter.cs b/src/rgen/Microsoft.Macios.Generator/Emitters/EnumEmitter.cs index 8fb87628abc9..0f095a2d0d76 100644 --- a/src/rgen/Microsoft.Macios.Generator/Emitters/EnumEmitter.cs +++ b/src/rgen/Microsoft.Macios.Generator/Emitters/EnumEmitter.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/Emitters/ICodeEmitter.cs b/src/rgen/Microsoft.Macios.Generator/Emitters/ICodeEmitter.cs index 8100cc7a29bb..c389ab7ce754 100644 --- a/src/rgen/Microsoft.Macios.Generator/Emitters/ICodeEmitter.cs +++ b/src/rgen/Microsoft.Macios.Generator/Emitters/ICodeEmitter.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/Emitters/InterfaceEmitter.cs b/src/rgen/Microsoft.Macios.Generator/Emitters/InterfaceEmitter.cs index 5658d85923d7..2d20cd8107e8 100644 --- a/src/rgen/Microsoft.Macios.Generator/Emitters/InterfaceEmitter.cs +++ b/src/rgen/Microsoft.Macios.Generator/Emitters/InterfaceEmitter.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/Emitters/LibraryEmitter.cs b/src/rgen/Microsoft.Macios.Generator/Emitters/LibraryEmitter.cs index 59c6cd364314..3158185a0171 100644 --- a/src/rgen/Microsoft.Macios.Generator/Emitters/LibraryEmitter.cs +++ b/src/rgen/Microsoft.Macios.Generator/Emitters/LibraryEmitter.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using System.Collections.Immutable; diff --git a/src/rgen/Microsoft.Macios.Generator/Emitters/TrampolineEmitter.cs b/src/rgen/Microsoft.Macios.Generator/Emitters/TrampolineEmitter.cs index a9d93632934e..d6c056a733fb 100644 --- a/src/rgen/Microsoft.Macios.Generator/Emitters/TrampolineEmitter.cs +++ b/src/rgen/Microsoft.Macios.Generator/Emitters/TrampolineEmitter.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/Extensions/AccessorDeclarationSyntaxExtensions.cs b/src/rgen/Microsoft.Macios.Generator/Extensions/AccessorDeclarationSyntaxExtensions.cs index c192f4132887..d7b404432387 100644 --- a/src/rgen/Microsoft.Macios.Generator/Extensions/AccessorDeclarationSyntaxExtensions.cs +++ b/src/rgen/Microsoft.Macios.Generator/Extensions/AccessorDeclarationSyntaxExtensions.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Immutable; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; diff --git a/src/rgen/Microsoft.Macios.Generator/Extensions/BaseTypeDeclarationSyntaxExtensions.cs b/src/rgen/Microsoft.Macios.Generator/Extensions/BaseTypeDeclarationSyntaxExtensions.cs index bb4c14558c61..55a1347339cc 100644 --- a/src/rgen/Microsoft.Macios.Generator/Extensions/BaseTypeDeclarationSyntaxExtensions.cs +++ b/src/rgen/Microsoft.Macios.Generator/Extensions/BaseTypeDeclarationSyntaxExtensions.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Linq; using System.Text; using Microsoft.CodeAnalysis.CSharp.Syntax; diff --git a/src/rgen/Microsoft.Macios.Generator/Extensions/CompilationExtensions.cs b/src/rgen/Microsoft.Macios.Generator/Extensions/CompilationExtensions.cs index 12718874a21f..aa8e8c738efc 100644 --- a/src/rgen/Microsoft.Macios.Generator/Extensions/CompilationExtensions.cs +++ b/src/rgen/Microsoft.Macios.Generator/Extensions/CompilationExtensions.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Microsoft.CodeAnalysis; namespace Microsoft.Macios.Generator.Extensions; diff --git a/src/rgen/Microsoft.Macios.Generator/Extensions/FieldSymbolExtensions.cs b/src/rgen/Microsoft.Macios.Generator/Extensions/FieldSymbolExtensions.cs index 02267af30769..f03daa88f780 100644 --- a/src/rgen/Microsoft.Macios.Generator/Extensions/FieldSymbolExtensions.cs +++ b/src/rgen/Microsoft.Macios.Generator/Extensions/FieldSymbolExtensions.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Microsoft.CodeAnalysis; using Microsoft.Macios.Generator.Attributes; using ObjCBindings; diff --git a/src/rgen/Microsoft.Macios.Generator/Extensions/MemberDeclarationSyntaxExtensions.cs b/src/rgen/Microsoft.Macios.Generator/Extensions/MemberDeclarationSyntaxExtensions.cs index 1e625d7170d7..7083be791cbe 100644 --- a/src/rgen/Microsoft.Macios.Generator/Extensions/MemberDeclarationSyntaxExtensions.cs +++ b/src/rgen/Microsoft.Macios.Generator/Extensions/MemberDeclarationSyntaxExtensions.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.Immutable; using Microsoft.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/Extensions/NamedTypeSymbolExtensions.cs b/src/rgen/Microsoft.Macios.Generator/Extensions/NamedTypeSymbolExtensions.cs index 320eefaabc94..edc13f3384b2 100644 --- a/src/rgen/Microsoft.Macios.Generator/Extensions/NamedTypeSymbolExtensions.cs +++ b/src/rgen/Microsoft.Macios.Generator/Extensions/NamedTypeSymbolExtensions.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Immutable; using System.Diagnostics.CodeAnalysis; using System.Linq; diff --git a/src/rgen/Microsoft.Macios.Generator/Extensions/ParameterSyntaxExtensions.cs b/src/rgen/Microsoft.Macios.Generator/Extensions/ParameterSyntaxExtensions.cs index e6e17a3459a2..bf581adb5522 100644 --- a/src/rgen/Microsoft.Macios.Generator/Extensions/ParameterSyntaxExtensions.cs +++ b/src/rgen/Microsoft.Macios.Generator/Extensions/ParameterSyntaxExtensions.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Immutable; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; diff --git a/src/rgen/Microsoft.Macios.Generator/Extensions/SemanticModelExtensions.cs b/src/rgen/Microsoft.Macios.Generator/Extensions/SemanticModelExtensions.cs index efbdc37e543c..c90a5a1123be 100644 --- a/src/rgen/Microsoft.Macios.Generator/Extensions/SemanticModelExtensions.cs +++ b/src/rgen/Microsoft.Macios.Generator/Extensions/SemanticModelExtensions.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Immutable; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; diff --git a/src/rgen/Microsoft.Macios.Generator/Extensions/SourceProductionContextExtensions.cs b/src/rgen/Microsoft.Macios.Generator/Extensions/SourceProductionContextExtensions.cs index 17483c67f2d8..811051d07cc6 100644 --- a/src/rgen/Microsoft.Macios.Generator/Extensions/SourceProductionContextExtensions.cs +++ b/src/rgen/Microsoft.Macios.Generator/Extensions/SourceProductionContextExtensions.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Immutable; using Microsoft.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/Extensions/StringExtensions.cs b/src/rgen/Microsoft.Macios.Generator/Extensions/StringExtensions.cs index fa316c5b9556..c87f10b2a1b7 100644 --- a/src/rgen/Microsoft.Macios.Generator/Extensions/StringExtensions.cs +++ b/src/rgen/Microsoft.Macios.Generator/Extensions/StringExtensions.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Diagnostics.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; diff --git a/src/rgen/Microsoft.Macios.Generator/Extensions/SyntaxTreeExtensions.cs b/src/rgen/Microsoft.Macios.Generator/Extensions/SyntaxTreeExtensions.cs index 01c5710e24c4..a647db0497e3 100644 --- a/src/rgen/Microsoft.Macios.Generator/Extensions/SyntaxTreeExtensions.cs +++ b/src/rgen/Microsoft.Macios.Generator/Extensions/SyntaxTreeExtensions.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Generic; using System.Linq; using Microsoft.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/Extensions/TypeSymbolExtensions.cs b/src/rgen/Microsoft.Macios.Generator/Extensions/TypeSymbolExtensions.cs index a4e14c317440..44d0e620cca6 100644 --- a/src/rgen/Microsoft.Macios.Generator/Extensions/TypeSymbolExtensions.cs +++ b/src/rgen/Microsoft.Macios.Generator/Extensions/TypeSymbolExtensions.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using System.Collections.Immutable; diff --git a/src/rgen/Microsoft.Macios.Generator/Extensions/TypedConstantExtensions.cs b/src/rgen/Microsoft.Macios.Generator/Extensions/TypedConstantExtensions.cs index 09070c24857c..9f8e40b66b29 100644 --- a/src/rgen/Microsoft.Macios.Generator/Extensions/TypedConstantExtensions.cs +++ b/src/rgen/Microsoft.Macios.Generator/Extensions/TypedConstantExtensions.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; using Microsoft.CodeAnalysis; diff --git a/src/rgen/Microsoft.Macios.Generator/ExtraSources.cs b/src/rgen/Microsoft.Macios.Generator/ExtraSources.cs index 916949db8768..7a238528cb41 100644 --- a/src/rgen/Microsoft.Macios.Generator/ExtraSources.cs +++ b/src/rgen/Microsoft.Macios.Generator/ExtraSources.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. namespace Microsoft.Macios.Generator; public static class ExtraSources { diff --git a/src/rgen/Microsoft.Macios.Generator/Formatters/ConstructorFormatter.cs b/src/rgen/Microsoft.Macios.Generator/Formatters/ConstructorFormatter.cs index 9c2bb7b44fc0..82ce6e9d2544 100644 --- a/src/rgen/Microsoft.Macios.Generator/Formatters/ConstructorFormatter.cs +++ b/src/rgen/Microsoft.Macios.Generator/Formatters/ConstructorFormatter.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.Macios.Generator.DataModel; using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; diff --git a/src/rgen/Microsoft.Macios.Generator/Formatters/MethodFormatter.cs b/src/rgen/Microsoft.Macios.Generator/Formatters/MethodFormatter.cs index 32fe08b7bfb8..ff7f416cebef 100644 --- a/src/rgen/Microsoft.Macios.Generator/Formatters/MethodFormatter.cs +++ b/src/rgen/Microsoft.Macios.Generator/Formatters/MethodFormatter.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.Macios.Generator.DataModel; using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; diff --git a/src/rgen/Microsoft.Macios.Generator/Formatters/ParameterFormatter.cs b/src/rgen/Microsoft.Macios.Generator/Formatters/ParameterFormatter.cs index 1bb750b7e9e2..e2805069b386 100644 --- a/src/rgen/Microsoft.Macios.Generator/Formatters/ParameterFormatter.cs +++ b/src/rgen/Microsoft.Macios.Generator/Formatters/ParameterFormatter.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Immutable; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; diff --git a/src/rgen/Microsoft.Macios.Generator/Formatters/PropertyFormatter.cs b/src/rgen/Microsoft.Macios.Generator/Formatters/PropertyFormatter.cs index 172fa5b91729..51d573c83f7b 100644 --- a/src/rgen/Microsoft.Macios.Generator/Formatters/PropertyFormatter.cs +++ b/src/rgen/Microsoft.Macios.Generator/Formatters/PropertyFormatter.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.Macios.Generator.DataModel; diff --git a/src/rgen/Microsoft.Macios.Generator/Formatters/ReturnTypeFormatter.cs b/src/rgen/Microsoft.Macios.Generator/Formatters/ReturnTypeFormatter.cs index 5ff8614e3cb0..ace3060208ad 100644 --- a/src/rgen/Microsoft.Macios.Generator/Formatters/ReturnTypeFormatter.cs +++ b/src/rgen/Microsoft.Macios.Generator/Formatters/ReturnTypeFormatter.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.Macios.Generator.DataModel; diff --git a/src/rgen/Microsoft.Macios.Generator/Formatters/SmartEnumFormatter.cs b/src/rgen/Microsoft.Macios.Generator/Formatters/SmartEnumFormatter.cs index 24338e64cd8d..43ea585f060f 100644 --- a/src/rgen/Microsoft.Macios.Generator/Formatters/SmartEnumFormatter.cs +++ b/src/rgen/Microsoft.Macios.Generator/Formatters/SmartEnumFormatter.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Generic; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; diff --git a/src/rgen/Microsoft.Macios.Generator/TabbedStringBuilder.cs b/src/rgen/Microsoft.Macios.Generator/TabbedStringBuilder.cs index 60e4a5b2efd2..7d650808de07 100644 --- a/src/rgen/Microsoft.Macios.Generator/TabbedStringBuilder.cs +++ b/src/rgen/Microsoft.Macios.Generator/TabbedStringBuilder.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.ComponentModel; using System.Linq; diff --git a/src/rgen/Microsoft.Macios.Transformer/Main.cs b/src/rgen/Microsoft.Macios.Transformer/Main.cs index 878dae6719c4..fb08b1498f9d 100644 --- a/src/rgen/Microsoft.Macios.Transformer/Main.cs +++ b/src/rgen/Microsoft.Macios.Transformer/Main.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.CommandLine; using System.CommandLine.Builder; using System.CommandLine.Parsing; diff --git a/src/rgen/Microsoft.Macios.Transformer/TransformCommand.cs b/src/rgen/Microsoft.Macios.Transformer/TransformCommand.cs index 25cc6965ba74..20c51b813c94 100644 --- a/src/rgen/Microsoft.Macios.Transformer/TransformCommand.cs +++ b/src/rgen/Microsoft.Macios.Transformer/TransformCommand.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.CommandLine; namespace Microsoft.Macios.Transformer; diff --git a/tests/rgen/Microsoft.Macios.Bindings.Analyzer.Tests/BaseGeneratorWithAnalyzerTestClass.cs b/tests/rgen/Microsoft.Macios.Bindings.Analyzer.Tests/BaseGeneratorWithAnalyzerTestClass.cs index e3df3d973dda..597f281beae0 100644 --- a/tests/rgen/Microsoft.Macios.Bindings.Analyzer.Tests/BaseGeneratorWithAnalyzerTestClass.cs +++ b/tests/rgen/Microsoft.Macios.Bindings.Analyzer.Tests/BaseGeneratorWithAnalyzerTestClass.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Immutable; using System.Threading.Tasks; using Microsoft.CodeAnalysis; diff --git a/tests/rgen/Microsoft.Macios.Bindings.Analyzer.Tests/BindingTypeSemanticAnalyzerTests.cs b/tests/rgen/Microsoft.Macios.Bindings.Analyzer.Tests/BindingTypeSemanticAnalyzerTests.cs index 450f2fcd3468..fd77bd9e9e7a 100644 --- a/tests/rgen/Microsoft.Macios.Bindings.Analyzer.Tests/BindingTypeSemanticAnalyzerTests.cs +++ b/tests/rgen/Microsoft.Macios.Bindings.Analyzer.Tests/BindingTypeSemanticAnalyzerTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Linq; using System.Threading.Tasks; using Microsoft.CodeAnalysis; diff --git a/tests/rgen/Microsoft.Macios.Bindings.Analyzer.Tests/SmartEnumsAnalyzerTests.cs b/tests/rgen/Microsoft.Macios.Bindings.Analyzer.Tests/SmartEnumsAnalyzerTests.cs index 07060227292c..6cd3eb14d3b0 100644 --- a/tests/rgen/Microsoft.Macios.Bindings.Analyzer.Tests/SmartEnumsAnalyzerTests.cs +++ b/tests/rgen/Microsoft.Macios.Bindings.Analyzer.Tests/SmartEnumsAnalyzerTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Linq; using System.Threading.Tasks; using Microsoft.CodeAnalysis; diff --git a/tests/rgen/Microsoft.Macios.Bindings.CodeFixers.Tests/BaseCodeFixerTestClass.cs b/tests/rgen/Microsoft.Macios.Bindings.CodeFixers.Tests/BaseCodeFixerTestClass.cs index 8c1f518c246a..89df86d50f69 100644 --- a/tests/rgen/Microsoft.Macios.Bindings.CodeFixers.Tests/BaseCodeFixerTestClass.cs +++ b/tests/rgen/Microsoft.Macios.Bindings.CodeFixers.Tests/BaseCodeFixerTestClass.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Microsoft.Macios.Bindings.Analyzer.Tests; namespace Microsoft.Bindings.CodeFixers.Tests; diff --git a/tests/rgen/Microsoft.Macios.Bindings.CodeFixers.Tests/BindingTypeCodeFixProviderTests.cs b/tests/rgen/Microsoft.Macios.Bindings.CodeFixers.Tests/BindingTypeCodeFixProviderTests.cs index 905cfb8d5c2f..dc520e4ece28 100644 --- a/tests/rgen/Microsoft.Macios.Bindings.CodeFixers.Tests/BindingTypeCodeFixProviderTests.cs +++ b/tests/rgen/Microsoft.Macios.Bindings.CodeFixers.Tests/BindingTypeCodeFixProviderTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. namespace Microsoft.Bindings.CodeFixers.Tests; public class BindingTypeCodeFixProviderTests { diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Attributes/AttributeParsingErrorTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Attributes/AttributeParsingErrorTests.cs index e1b0f5f0bd3b..cb265841d87e 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Attributes/AttributeParsingErrorTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Attributes/AttributeParsingErrorTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. namespace Microsoft.Macios.Generator.Tests.Attributes; public class AttributeParsingErrorTests { diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Attributes/ExportDataTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Attributes/ExportDataTests.cs index f34c1dee4b71..c801977803f6 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Attributes/ExportDataTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Attributes/ExportDataTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. #pragma warning disable APL0003 using System; using System.Collections; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Attributes/FieldDataTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Attributes/FieldDataTests.cs index d5e2227c9b0c..15fb125cb083 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Attributes/FieldDataTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Attributes/FieldDataTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. #pragma warning disable APL0003 using System; using System.Collections; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/AttributesNamesTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/AttributesNamesTests.cs index b766aef5bea6..ce64599b0ba1 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/AttributesNamesTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/AttributesNamesTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. #pragma warning disable APL0003 using System; using ObjCBindings; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/PlatformAvailabilityEqualityTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/PlatformAvailabilityEqualityTests.cs index ca8b75df650c..3d88956ca95a 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/PlatformAvailabilityEqualityTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/PlatformAvailabilityEqualityTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using Microsoft.Macios.Generator.Availability; using Xamarin.Utils; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/PlatformAvailabilityMergeTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/PlatformAvailabilityMergeTests.cs index ef5baa8096cc..af91249c57e9 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/PlatformAvailabilityMergeTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/PlatformAvailabilityMergeTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using Microsoft.Macios.Generator.Availability; using Xamarin.Utils; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/PlatformAvailabilityTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/PlatformAvailabilityTests.cs index 1a21e042bc1e..9b4a78eeec10 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/PlatformAvailabilityTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/PlatformAvailabilityTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using System.Linq; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/PlatformAvailabilityToStringTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/PlatformAvailabilityToStringTests.cs index 9d7aa5532788..1072fd9fca2e 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/PlatformAvailabilityToStringTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/PlatformAvailabilityToStringTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections; using System.Collections.Generic; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/SymbolAvailabilityEqualityTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/SymbolAvailabilityEqualityTests.cs index da521ac78677..d66d4b24d8a5 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/SymbolAvailabilityEqualityTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/SymbolAvailabilityEqualityTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Microsoft.Macios.Generator.Attributes; using Microsoft.Macios.Generator.Availability; using Xunit; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/SymbolAvailabilityMergeTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/SymbolAvailabilityMergeTests.cs index 3c6291ea1fa3..dd064732a512 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/SymbolAvailabilityMergeTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/SymbolAvailabilityMergeTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Microsoft.Macios.Generator.Attributes; using Microsoft.Macios.Generator.Availability; using Xamarin.Utils; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/SymbolAvailabilityTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/SymbolAvailabilityTests.cs index ee6a74810a35..dd29e269ec0b 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/SymbolAvailabilityTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/SymbolAvailabilityTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Generic; using System.Linq; using Microsoft.Macios.Generator.Attributes; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/SymbolAvailabilityToStringTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/SymbolAvailabilityToStringTests.cs index 6a3753e3d06b..626164ddf1eb 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/SymbolAvailabilityToStringTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Availability/SymbolAvailabilityToStringTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; using Microsoft.Macios.Generator.Availability; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/BaseGeneratorTestClass.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/BaseGeneratorTestClass.cs index 7f086867e090..7d4eaec29e4d 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/BaseGeneratorTestClass.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/BaseGeneratorTestClass.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using System.Collections.Immutable; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/BaseTestDataGenerator.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/BaseTestDataGenerator.cs index b587edeceac1..d3a1915a793e 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/BaseTestDataGenerator.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/BaseTestDataGenerator.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.IO; using System.Runtime.CompilerServices; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/BindingSourceGeneratorGeneratorTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/BindingSourceGeneratorGeneratorTests.cs index 3b0c6698e35b..cbe47cc3287c 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/BindingSourceGeneratorGeneratorTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/BindingSourceGeneratorGeneratorTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Linq; using Xamarin.Tests; using Xamarin.Utils; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/ClassGenerationTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/ClassGenerationTests.cs index 420a5c3e667f..af75b3552a4f 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/ClassGenerationTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Classes/ClassGenerationTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; using Xamarin.Tests; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/CollectionComparerTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/CollectionComparerTests.cs index 0e42eed96105..9ebae0e79961 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/CollectionComparerTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/CollectionComparerTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using Xunit; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/CompilationResult.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/CompilationResult.cs index f01cf39d0174..3cf2bb9d098a 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/CompilationResult.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/CompilationResult.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Immutable; using Microsoft.CodeAnalysis; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Context/RootBindingContextTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Context/RootBindingContextTests.cs index 6ddc7b16a9af..c965e02ba663 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Context/RootBindingContextTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Context/RootBindingContextTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Microsoft.Macios.Generator.Context; using Xamarin.Tests; using Xamarin.Utils; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/AccessorKindTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/AccessorKindTests.cs index b85c43c95c96..8bdea5e0420b 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/AccessorKindTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/AccessorKindTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Microsoft.CodeAnalysis.CSharp; using Microsoft.Macios.Generator.DataModel; using Xunit; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/AccessorTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/AccessorTests.cs index 030accc95e11..844997aa508c 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/AccessorTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/AccessorTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Microsoft.CodeAnalysis.CSharp; using Microsoft.Macios.Generator.Attributes; using Microsoft.Macios.Generator.Availability; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/AccessorsEqualityComparerTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/AccessorsEqualityComparerTests.cs index 64baa3eaf763..09b639bd500e 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/AccessorsEqualityComparerTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/AccessorsEqualityComparerTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Immutable; using Microsoft.Macios.Generator.DataModel; using Xunit; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/AttributeCodeChangeTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/AttributeCodeChangeTests.cs index 708c5aef295e..52d08f8fc451 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/AttributeCodeChangeTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/AttributeCodeChangeTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Microsoft.Macios.Generator.DataModel; using Xunit; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/AttributeComparerTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/AttributeComparerTests.cs index fc1c2052182c..ed35f2f8249a 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/AttributeComparerTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/AttributeComparerTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using Microsoft.Macios.Generator.DataModel; using Xunit; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/AttributesEqualityComparerTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/AttributesEqualityComparerTests.cs index 847b0c9dd0f3..5a592d7d5598 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/AttributesEqualityComparerTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/AttributesEqualityComparerTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Immutable; using Microsoft.Macios.Generator.DataModel; using Xunit; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/BindingInfoTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/BindingInfoTests.cs index d13526ba60ba..a360966921b5 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/BindingInfoTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/BindingInfoTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. #pragma warning disable APL0003 using System; using System.Collections; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ClassCodeChangesTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ClassCodeChangesTests.cs index 5d9c8b937199..0b9a520a159f 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ClassCodeChangesTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ClassCodeChangesTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. #pragma warning disable APL0003 using System.Collections; using System.Collections.Generic; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/CodeChangesComparerTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/CodeChangesComparerTests.cs index b7c514635a80..8e5d25f644dd 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/CodeChangesComparerTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/CodeChangesComparerTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Microsoft.CodeAnalysis.CSharp; using Microsoft.Macios.Generator.Attributes; using Microsoft.Macios.Generator.Availability; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/CodeChangesEqualityComparerTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/CodeChangesEqualityComparerTests.cs index 2ebe57053701..8d6011dc74e3 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/CodeChangesEqualityComparerTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/CodeChangesEqualityComparerTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Microsoft.CodeAnalysis.CSharp; using Microsoft.Macios.Generator.DataModel; using Xunit; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/CodeChangesTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/CodeChangesTests.cs index 41ef4565d0ba..7319ba1794df 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/CodeChangesTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/CodeChangesTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; using System.Linq; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ConstructorComparerTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ConstructorComparerTests.cs index d84a64f935c1..eb8a18369b9d 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ConstructorComparerTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ConstructorComparerTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using Microsoft.CodeAnalysis.CSharp; using Microsoft.Macios.Generator.DataModel; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ConstructorTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ConstructorTests.cs index ec0379837667..1866feddd746 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ConstructorTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ConstructorTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; using System.Linq; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ConstructorsEqualityComparerTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ConstructorsEqualityComparerTests.cs index 83cb1e3eaaca..f21926c38cec 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ConstructorsEqualityComparerTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ConstructorsEqualityComparerTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Microsoft.Macios.Generator.Attributes; using Microsoft.Macios.Generator.Availability; using Microsoft.Macios.Generator.DataModel; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/DelegateInfoTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/DelegateInfoTests.cs index d06619f6e264..45c621618bf5 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/DelegateInfoTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/DelegateInfoTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; using System.Linq; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/DelegateParameterTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/DelegateParameterTests.cs index da7f28d06fa7..25c818713fa1 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/DelegateParameterTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/DelegateParameterTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; using Microsoft.Macios.Generator.DataModel; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/EnumDeclarationCodeChangesTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/EnumDeclarationCodeChangesTests.cs index d07a058aa32c..17dee7248e2c 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/EnumDeclarationCodeChangesTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/EnumDeclarationCodeChangesTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Linq; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.Macios.Generator.DataModel; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/EnumMemberCodeChangesTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/EnumMemberCodeChangesTests.cs index 3b2569352f6e..58501c8857c2 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/EnumMemberCodeChangesTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/EnumMemberCodeChangesTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. #pragma warning disable APL0003 using System.Collections; using System.Collections.Generic; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/EnumMembersEqualityComparerTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/EnumMembersEqualityComparerTests.cs index ad5e562947d0..928c00936a7a 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/EnumMembersEqualityComparerTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/EnumMembersEqualityComparerTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. #pragma warning disable APL0003 using System.Collections.Immutable; using Microsoft.Macios.Generator.Availability; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/EventEqualityComparerTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/EventEqualityComparerTests.cs index c771ddded707..548df3aeb781 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/EventEqualityComparerTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/EventEqualityComparerTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Immutable; using Microsoft.CodeAnalysis.CSharp; using Microsoft.Macios.Generator.DataModel; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/EventTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/EventTests.cs index a304e02b98bf..f95a4c1035e7 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/EventTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/EventTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; using System.Linq; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/InterfaceCodeChangesTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/InterfaceCodeChangesTests.cs index 342c49532901..788b33fd9201 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/InterfaceCodeChangesTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/InterfaceCodeChangesTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. #pragma warning disable APL0003 using System.Collections; using System.Collections.Generic; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodComparerTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodComparerTests.cs index d18089f348f6..9628ecd37e2c 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodComparerTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodComparerTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using Microsoft.CodeAnalysis.CSharp; using Microsoft.Macios.Generator.DataModel; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodEqualityComparerTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodEqualityComparerTests.cs index 88a9700e3cdc..b8c530b4c7ac 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodEqualityComparerTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodEqualityComparerTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Immutable; using Microsoft.Macios.Generator.DataModel; using Xunit; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodReturnTypeComparerTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodReturnTypeComparerTests.cs index d5ba383ce560..9f6bbbd0cf36 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodReturnTypeComparerTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodReturnTypeComparerTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using Microsoft.Macios.Generator.DataModel; using Xunit; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodTests.cs index c895a9b6cd04..e763f90d7dac 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/MethodTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; using System.Linq; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ModifiersEqualityComparerTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ModifiersEqualityComparerTests.cs index 3e9255ee5679..38883184376d 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ModifiersEqualityComparerTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ModifiersEqualityComparerTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Immutable; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/PropertiesEqualityComparerTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/PropertiesEqualityComparerTests.cs index 79991ccd4f20..ecc3fe1a84df 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/PropertiesEqualityComparerTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/PropertiesEqualityComparerTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Immutable; using Microsoft.CodeAnalysis.CSharp; using Microsoft.Macios.Generator.DataModel; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/PropertyTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/PropertyTests.cs index a49caa2b73b0..6e0c4fbcd162 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/PropertyTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/PropertyTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; using System.Linq; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ReferenceKindTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ReferenceKindTests.cs index fef70b020451..79da18c28918 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ReferenceKindTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ReferenceKindTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; using Microsoft.CodeAnalysis; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ReturnTypeTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ReturnTypeTests.cs index 2d7958492b30..80fec7056230 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ReturnTypeTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DataModel/ReturnTypeTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; using System.Linq; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/DictionaryComparerTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/DictionaryComparerTests.cs index 639292978cdb..92512e5979bb 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/DictionaryComparerTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/DictionaryComparerTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections.Generic; using Xunit; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Emitters/EmitterFactoryTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Emitters/EmitterFactoryTests.cs index b4a529896412..63af590719e0 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Emitters/EmitterFactoryTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Emitters/EmitterFactoryTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Linq; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/BaseTypeDeclarationSyntaxExtensionsTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/BaseTypeDeclarationSyntaxExtensionsTests.cs index 98a8d1af7955..b1f7ddc3698a 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/BaseTypeDeclarationSyntaxExtensionsTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/BaseTypeDeclarationSyntaxExtensionsTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; using System.Linq; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/CompilationExtensionsTest.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/CompilationExtensionsTest.cs index a3c27e57430a..6276f27412c1 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/CompilationExtensionsTest.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/CompilationExtensionsTest.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Microsoft.Macios.Generator.Extensions; using Xamarin.Tests; using Xamarin.Utils; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/FieldSymbolExtensionsTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/FieldSymbolExtensionsTests.cs index 924c44748e7c..2bc390bf3482 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/FieldSymbolExtensionsTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/FieldSymbolExtensionsTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. #pragma warning disable APL0003 using System.Collections; using System.Collections.Generic; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/MemberDeclarationSyntaxExtensionsTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/MemberDeclarationSyntaxExtensionsTests.cs index 7e1b34ef101d..eb525592325a 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/MemberDeclarationSyntaxExtensionsTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/MemberDeclarationSyntaxExtensionsTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Linq; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.Macios.Generator.Extensions; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/NamedTypeSymbolExtensionsTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/NamedTypeSymbolExtensionsTests.cs index 6e2707f51aa5..90260031aa6e 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/NamedTypeSymbolExtensionsTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/NamedTypeSymbolExtensionsTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; using System.Linq; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/SemanticModelExtensionsTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/SemanticModelExtensionsTests.cs index 02dc09280718..1826080c045a 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/SemanticModelExtensionsTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/SemanticModelExtensionsTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. #pragma warning disable APL0003 using System; using System.Collections; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/StringExtensionsTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/StringExtensionsTests.cs index 42c27c5e2ca3..f21f1bdc4267 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/StringExtensionsTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/StringExtensionsTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using Microsoft.Macios.Generator.Extensions; using Xunit; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/SyntaxTreeExtensionsTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/SyntaxTreeExtensionsTests.cs index e8b4a3b52f51..c40457499911 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/SyntaxTreeExtensionsTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/SyntaxTreeExtensionsTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections; using System.Collections.Generic; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/TypeSymbolExtensionsTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/TypeSymbolExtensionsTests.cs index 4c8f5927df25..e56942d63ae2 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/TypeSymbolExtensionsTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Extensions/TypeSymbolExtensionsTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. #pragma warning disable APL0003 using System; using System.Collections; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Formatters/ConstructorFormatterTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Formatters/ConstructorFormatterTests.cs index d085007dac25..d427e3ee556f 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Formatters/ConstructorFormatterTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Formatters/ConstructorFormatterTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; using System.Linq; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Formatters/MethodFormatterTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Formatters/MethodFormatterTests.cs index 74a1de53c874..9c431cf3f3b7 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Formatters/MethodFormatterTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Formatters/MethodFormatterTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; using System.Linq; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Formatters/PropertyFormatterTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Formatters/PropertyFormatterTests.cs index ad86c42ec729..aaa35542162d 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Formatters/PropertyFormatterTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Formatters/PropertyFormatterTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; using System.Linq; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/Formatters/SmartEnumFormatterTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/Formatters/SmartEnumFormatterTests.cs index 71fcf626b4da..3293894cb3b9 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/Formatters/SmartEnumFormatterTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/Formatters/SmartEnumFormatterTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; using System.Linq; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/SmartEnum/SmartEnumDiagnosticsTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/SmartEnum/SmartEnumDiagnosticsTests.cs index 1cd4d104c1c7..2fdf3bb1af28 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/SmartEnum/SmartEnumDiagnosticsTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/SmartEnum/SmartEnumDiagnosticsTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; using Xamarin.Tests; diff --git a/tests/rgen/Microsoft.Macios.Generator.Tests/TabbedStringBuilderTests.cs b/tests/rgen/Microsoft.Macios.Generator.Tests/TabbedStringBuilderTests.cs index 3e3e063f31a9..0f37aa02be93 100644 --- a/tests/rgen/Microsoft.Macios.Generator.Tests/TabbedStringBuilderTests.cs +++ b/tests/rgen/Microsoft.Macios.Generator.Tests/TabbedStringBuilderTests.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. using System; using System.Collections.Generic; using System.ComponentModel; diff --git a/tests/rgen/Microsoft.Macios.Transformer.Tests/UnitTest1.cs b/tests/rgen/Microsoft.Macios.Transformer.Tests/UnitTest1.cs index ab641d95d35c..327ca91936b7 100644 --- a/tests/rgen/Microsoft.Macios.Transformer.Tests/UnitTest1.cs +++ b/tests/rgen/Microsoft.Macios.Transformer.Tests/UnitTest1.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. namespace Microsoft.Macios.Transformer.Tests; public class UnitTest1 { From 2814e55c95626b15c5d11401f28cdd86b572ab81 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 10 Jan 2025 08:42:28 +0100 Subject: [PATCH 5/8] [xharness] There's no need to check platform/configuration when setting values in a project file. (#21923) We create a new project file for every build configuration we run anyways. This fixes this output when xharness is run: > Could not parse condition; $(TargetFramework.EndsWith('-ios')) Also remove some unused code. --- tests/xharness/Jenkins/TestData.cs | 1 - .../xharness/Jenkins/TestVariationsFactory.cs | 18 ++++-------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/tests/xharness/Jenkins/TestData.cs b/tests/xharness/Jenkins/TestData.cs index a2baf2d7d1e8..b8e3fde842f1 100644 --- a/tests/xharness/Jenkins/TestData.cs +++ b/tests/xharness/Jenkins/TestData.cs @@ -12,7 +12,6 @@ class TestData { public bool Profiling; public string LinkMode; public string Defines; - public string Undefines; public bool? Ignored; public bool EnableSGenConc; public bool UseLlvm; diff --git a/tests/xharness/Jenkins/TestVariationsFactory.cs b/tests/xharness/Jenkins/TestVariationsFactory.cs index c48bf550990f..3c53b4147668 100644 --- a/tests/xharness/Jenkins/TestVariationsFactory.cs +++ b/tests/xharness/Jenkins/TestVariationsFactory.cs @@ -172,7 +172,6 @@ public IEnumerable CreateTestVariations (IEnumerable tests, Func CreateTestVariations (IEnumerable tests, Func Date: Fri, 10 Jan 2025 08:58:12 +0100 Subject: [PATCH 6/8] [docs] Fix a few issues with the api docs. (#21932) * Fix `see` tags (there's no "cfref" attribute, it's "cref") * Fix `seealso` tags, they shouldn't be nested inside other tags. * Simplify a few "cref" tags. * Remove the "block" tag, there's no such thing. * General formatting improvements. --- docs/api/UIKit/UIAlertView.xml | 51 ++++++++++++++++------- docs/api/UIKit/UIDocument.xml | 22 +++++++--- src/ObjCRuntime/BlockCallbackAttribute.cs | 2 - src/ObjCRuntime/CCallbackAttribute.cs | 2 - src/authenticationservices.cs | 3 +- 5 files changed, 52 insertions(+), 28 deletions(-) diff --git a/docs/api/UIKit/UIAlertView.xml b/docs/api/UIKit/UIAlertView.xml index 00726d4b347f..ab8b1646927d 100644 --- a/docs/api/UIKit/UIAlertView.xml +++ b/docs/api/UIKit/UIAlertView.xml @@ -1,36 +1,55 @@ - A that displays a dialog message with one or more buttons. (As of iOS 8, devs should use rather than this class.) + + A that displays a dialog message with one or more buttons. + (As of iOS 8, devs should use rather than this class.) + - As of iOS 8, app devs should use rather than this class. Extensions may not use this class at all. - The allows the application user to choose among alternative actions. The following code and image, taken from the "AlertViews" section of the "ios Standard Controls" sample illustrates the simplest use-case: + As of iOS 8, app devs should use rather than this class. + Extensions may not use this class at all. + + + The allows the application user to choose among alternative actions. + The following code and image, taken from the "AlertViews" section of the "ios Standard Controls" + sample illustrates the simplest use-case: - Screenshot showing the alert view + An alternative to the is the . - An alternative to the is the . - The application developer can use s such as or to allow the application user to enter values. - The Xamarin API supports two styles of event notification: the Objective-C style that uses a delegate class or the C# style using event notifications. - + The application developer can use s such as + or to allow the application user to enter values. + + + The managed API supports two styles of event notification: the Objective-C style that uses a delegate class or the C# style using event notifications. + - The C# style allows the user to add or remove event handlers at runtime by assigning to the events of properties of this class. Event handlers can be anyone of a method, an anonymous methods or a lambda expression. Using the C# style events or properties will override any manual settings to the Objective-C Delegate or WeakDelegate settings. - - The Objective-C style requires the user to create a new class derived from class and assign it to the P:UIKit.Delegate property. Alternatively, for low-level control, by creating a class derived from which has every entry point properly decorated with an [Export] attribute. The instance of this object can then be assigned to the property. + The C# style allows the user to add or remove event handlers at runtime by assigning to the + events of properties of this class. Event handlers can be anyone of a method, an anonymous method + or a lambda expression. Using the C# style events or properties will override any manual settings + to the Objective-C Delegate or WeakDelegate settings. - + + The Objective-C style requires the user to create a new class derived from + class and assign it to the property. Alternatively, for low-level control, by creating + a class derived from which has every entry point properly decorated with an + attribute and assigning an instance of this class to the + property. + + This class should not be subclassed. - + Apple documentation for UIAlertView diff --git a/docs/api/UIKit/UIDocument.xml b/docs/api/UIKit/UIDocument.xml index cc80ffcb4eae..7f4815374aeb 100644 --- a/docs/api/UIKit/UIDocument.xml +++ b/docs/api/UIKit/UIDocument.xml @@ -2,14 +2,24 @@ Abstract base class providing local and cloud-based management of Model data. - Application developers can subclass to create objects that are "Model-Controllers" and relate to Model (domain) objects analogously to how relate to s. iOS provides a number of functions, including background asynchronous reading and writing of application data, automatic and safe data-saving, storage that is automatically coordinated between the application sandbox and cloud services, etc. - - At a minimum, application developers need to implement (for storage) and (for retrieval). Additionally, application developers need to manage the lifecyle of the and this requires the application developer to set the preferred storage location, create a file URL, and discover, open, and close the file. Application developers should also track changes and resolve conflicts between document versions. - - The members of this class can be used from a background thread. + + Application developers can subclass to create objects that are "Model-Controllers" and + relate to Model (domain) objects analogously to how relate to s. + UIKit provides a number of functions, including background asynchronous reading and writing of application data, + automatic and safe data-saving, storage that is automatically coordinated between the application sandbox and cloud services, etc. + + + At a minimum, application developers need to implement (for storage) and + (for retrieval). Additionally, application developers need to + manage the lifecyle of the and this requires the application developer to set the preferred storage + location, create a file URL, and discover, open, and close the file. Application developers should also track changes and resolve + conflicts between document versions. + + + The members of this class can be used from a background thread. + TaskCloud - Apple documentation for UIDocument \ No newline at end of file diff --git a/src/ObjCRuntime/BlockCallbackAttribute.cs b/src/ObjCRuntime/BlockCallbackAttribute.cs index eac616d8b984..b62761878aa7 100644 --- a/src/ObjCRuntime/BlockCallbackAttribute.cs +++ b/src/ObjCRuntime/BlockCallbackAttribute.cs @@ -5,9 +5,7 @@ namespace ObjCRuntime { /// This attribute is applied to delegate parameters in a delegate to specify /// that the delegate parameter needs an Objective-C Block-style bridge. /// - /// /// - /// [AttributeUsage (AttributeTargets.Parameter, AllowMultiple = false)] public class BlockCallbackAttribute : Attribute { /// diff --git a/src/ObjCRuntime/CCallbackAttribute.cs b/src/ObjCRuntime/CCallbackAttribute.cs index fce65a0d5be8..b692f152ba01 100644 --- a/src/ObjCRuntime/CCallbackAttribute.cs +++ b/src/ObjCRuntime/CCallbackAttribute.cs @@ -5,9 +5,7 @@ namespace ObjCRuntime { /// This attribute is applied to delegate parameters in a delegate to specify /// that the delegate parameter needs an C-style bridge. /// - /// /// - /// [AttributeUsage (AttributeTargets.Parameter, AllowMultiple = false)] public class CCallbackAttribute : Attribute { /// diff --git a/src/authenticationservices.cs b/src/authenticationservices.cs index 1c548e586d14..742d8a534147 100644 --- a/src/authenticationservices.cs +++ b/src/authenticationservices.cs @@ -279,8 +279,7 @@ interface ASCredentialIdentityStoreState { /// Delegate object for completion handlers in methods within T:AuthenticationServices.ASCredentialProviderExtension. delegate void ASCredentialProviderExtensionRequestCompletionHandler (bool expired); - /// - /// subclass that provides context for a credential provider. + /// An subclass that provides context for a credential provider. [Introduced (PlatformName.MacCatalyst, 14, 0)] [NoTV] [NoWatch] From d57af51564ded76903da9a523b88f3ba1f21c878 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 10 Jan 2025 08:58:37 +0100 Subject: [PATCH 7/8] Make our .editorconfig a root editor config. (#21931) This way any other .editorconfig file up the directory hierarchy won't affect us. --- .editorconfig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.editorconfig b/.editorconfig index bb07c60e0b77..def608da89c3 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,3 +1,8 @@ +# EditorConfig is awesome: https://editorconfig.org + +# top-most EditorConfig file +root = true + [*.{props,targets}] indent_style = tab indent_size = 4 From b5b41b1835148d6ddf11798f8be0c0a09d2f8efd Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 10 Jan 2025 16:57:03 +0100 Subject: [PATCH 8/8] [src] Create a rsp file for all the arguments to the C# compiler when compiling the product assembly. (#21924) * Create a rsp file for all the arguments to the C# compiler when compiling both core.dll and the product assembly. * Compile the api definitions from the Makefile instead of from the generator; this way we can create a rsp file for the api definition compilation as well. This is a step towards creating C# project files for these parts of the build. --- src/Foundation/XpcInterfaceAttribute.cs | 2 + src/Makefile | 81 +++++++++++++++++++------ src/bgen/BindingTouch.cs | 11 ++-- src/foundation.cs | 4 ++ 4 files changed, 75 insertions(+), 23 deletions(-) diff --git a/src/Foundation/XpcInterfaceAttribute.cs b/src/Foundation/XpcInterfaceAttribute.cs index 14c1f7726809..2364f588a64d 100644 --- a/src/Foundation/XpcInterfaceAttribute.cs +++ b/src/Foundation/XpcInterfaceAttribute.cs @@ -25,12 +25,14 @@ using ObjCRuntime; namespace Foundation { +#if !COREBUILD /// /// Specifies that the decorated interface (which must also be /// decorated with ) is intended /// to be used with . This enables /// mmp optimizations required for the XPC subsystem to work properly. /// +#endif [AttributeUsage (AttributeTargets.Interface)] public sealed class XpcInterfaceAttribute : Attribute { public XpcInterfaceAttribute () { } diff --git a/src/Makefile b/src/Makefile index 37dd010dc4df..5f63e2736f31 100644 --- a/src/Makefile +++ b/src/Makefile @@ -14,7 +14,7 @@ IOS_DOTNET_BUILD_DIR=$(DOTNET_BUILD_DIR)/ios TVOS_DOTNET_BUILD_DIR=$(DOTNET_BUILD_DIR)/tvos MACCATALYST_DOTNET_BUILD_DIR=$(DOTNET_BUILD_DIR)/maccatalyst -GENERATOR_FLAGS=-process-enums -core -nologo -nostdlib -noconfig -native-exception-marshalling --ns:ObjCRuntime +GENERATOR_FLAGS=-process-enums -core -nologo -nostdlib -native-exception-marshalling --ns:ObjCRuntime GENERATOR_TF_VERSION=$(subst net,,$(DOTNET_TFM)) @@ -56,7 +56,7 @@ DOTNET_REFERENCES = \ /r:$(DOTNET_BCL_DIR)/System.Xml.ReaderWriter.dll \ DOTNET_OR_GREATER_DEFINES:=$(foreach version,$(shell seq 6 $(firstword $(subst ., ,$(subst net,,$(DOTNET_TFM))))),/define:NET$(version)_0_OR_GREATER) -DOTNET_FLAGS=/warnaserror+ /noconfig /nostdlib+ /deterministic /features:strict /nologo /target:library /debug /unsafe /define:NET /define:NET_TODO $(DOTNET_OR_GREATER_DEFINES) $(DOTNET_REFERENCES) +DOTNET_FLAGS=/warnaserror+ /nostdlib+ /deterministic /features:strict /nologo /target:library /debug /unsafe /define:NET /define:NET_TODO $(DOTNET_OR_GREATER_DEFINES) $(DOTNET_REFERENCES) ifeq ($(XCODE_IS_STABLE),true) DOTNET_FLAGS+=/define:XCODE_IS_STABLE @@ -135,7 +135,8 @@ IOS_DOTNET_CORE_SOURCES += $(IOS_DOTNET_EXTRA_SOURCES) IOS_DOTNET_SOURCES += $(IOS_DOTNET_EXTRA_SOURCES) $(IOS_DOTNET_HTTP_SOURCES) -IOS_GENERATOR_FLAGS = -inline-selectors -d:IOS -process-enums $(IOS_GENERATOR_WARNASERROR) +IOS_GENERATOR_DEFINES = -d:IOS +IOS_GENERATOR_FLAGS = -inline-selectors -process-enums $(IOS_GENERATOR_WARNASERROR) $(IOS_GENERATOR_DEFINES) IOS_DEFINES = -define:IPHONE -define:IOS -define:MONOTOUCH -d:__IOS__ -d:SYSTEM_NET_HTTP IOS_CORE_DEFINES=-define:COREBUILD $(IOS_DEFINES) @@ -168,7 +169,8 @@ $(IOS_DOTNET_BUILD_DIR)/AssemblyInfo.cs: $(TOP)/src/AssemblyInfo.cs.in | $(IOS_D # MAC_COMMON_DEFINES = -define:MONOMAC -d:__MACOS__ -MACOS_GENERATOR_FLAGS = -d:MONOMAC -d:__MACOS__ +MACOS_GENERATOR_DEFINES = -d:MONOMAC -d:__MACOS__ +MACOS_GENERATOR_FLAGS = $(MACOS_GENERATOR_DEFINES) MACOS_CORE_DEFINES = $(MAC_COMMON_DEFINES),COREBUILD MACOS_DEFINES = $(MAC_COMMON_DEFINES) -D:XAMARIN_MODERN @@ -234,7 +236,8 @@ $(MACOS_DOTNET_BUILD_DIR)/AssemblyInfo.cs: $(TOP)/src/AssemblyInfo.cs.in | $(MAC TVOS_DEFINES = -define:IPHONE -define:MONOTOUCH -d:TVOS -d:__TVOS__ -d:SYSTEM_NET_HTTP TVOS_CORE_DEFINES=$(TVOS_DEFINES) -d:COREBUILD -TVOS_GENERATOR_FLAGS = -d:TVOS -inline-selectors +TVOS_GENERATOR_DEFINES = -d:TVOS +TVOS_GENERATOR_FLAGS = $(TVOS_GENERATOR_DEFINES) -inline-selectors TVOS_DOTNET_EXTRA_CORE_SOURCES = \ $(TVOS_DOTNET_BUILD_DIR)/Constants.cs \ @@ -292,7 +295,8 @@ $(TVOS_DOTNET_BUILD_DIR)/AssemblyInfo.cs: $(TOP)/src/AssemblyInfo.cs.in $(TOP)/M MACCATALYST_DEFINES = -define:IPHONE -define:IOS -define:MONOTOUCH -d:__IOS__ -d:__MACCATALYST__ -d:SYSTEM_NET_HTTP MACCATALYST_CORE_DEFINES=$(MACCATALYST_DEFINES) -d:COREBUILD -MACCATALYST_GENERATOR_FLAGS = -d:__MACCATALYST__ -d:IOS -inline-selectors +MACCATALYST_GENERATOR_DEFINES = -d:__MACCATALYST__ -d:IOS +MACCATALYST_GENERATOR_FLAGS = $(MACCATALYST_GENERATOR_DEFINES) -inline-selectors MACCATALYST_DOTNET_EXTRA_CORE_SOURCES = \ $(MACCATALYST_DOTNET_BUILD_DIR)/Constants.cs \ @@ -341,9 +345,9 @@ $(MACCATALYST_DOTNET_BUILD_DIR)/AssemblyInfo.cs: $(TOP)/src/AssemblyInfo.cs.in $ include $(TOP)/scripts/generate-sourcelink-json/fragment.mk define BuildDotNetIntermediateAssembly -$($(2)_DOTNET_BUILD_DIR)/core-$(3).dll: $($(2)_DOTNET_CORE_SOURCES) frameworks.sources $(RSP_DIR)/dotnet/$(3)-defines-dotnet.rsp | $($(2)_DOTNET_BUILD_DIR) - $$(Q_DOTNET_GEN) \ - $(DOTNET_CSC) \ +rsp:: $($(2)_DOTNET_BUILD_DIR)/core-$(3).rsp +$($(2)_DOTNET_BUILD_DIR)/core-$(3).rsp: Makefile frameworks.sources | $($(2)_DOTNET_BUILD_DIR) + $$(Q_DOTNET_GEN) echo \ $(DOTNET_FLAGS) \ $(DOTNET_CORE_WARNINGS_TO_FIX) \ @$(RSP_DIR)/dotnet/$(3)-defines-dotnet.rsp \ @@ -351,9 +355,41 @@ $($(2)_DOTNET_BUILD_DIR)/core-$(3).dll: $($(2)_DOTNET_CORE_SOURCES) frameworks.s $($(2)_DOTNET_CORE_SOURCES) \ -nullable+ \ -warnaserror+ \ - -out:$$@ + -nowarn:1591 \ + -out:$($(2)_DOTNET_BUILD_DIR)/core-$(3).dll \ + -doc:$($(2)_DOTNET_BUILD_DIR)/core-$(3).xml \ + > $$@.tmp + $$(Q) mv $$@.tmp $$@ + +$($(2)_DOTNET_BUILD_DIR)/core-$(3).dll: $($(2)_DOTNET_CORE_SOURCES) $($(2)_DOTNET_BUILD_DIR)/core-$(3).rsp | $($(2)_DOTNET_BUILD_DIR) + $$(Q_DOTNET_GEN) $(DOTNET_CSC) @$($(2)_DOTNET_BUILD_DIR)/core-$(3).rsp + +$($(2)_DOTNET_BUILD_DIR)/apidefinition-$(3).rsp: Makefile frameworks.sources + $$(Q_DOTNET_GEN) echo \ + -debug \ + -unsafe \ + -target:library \ + -nowarn:436,1591,CA1416,CS8981 \ + -warnaserror+ \ + -out:$($(2)_DOTNET_BUILD_DIR)/apidefinition-$(3).dll \ + -doc:$($(2)_DOTNET_BUILD_DIR)/apidefinition-$(3).xml \ + -r:$($(2)_DOTNET_BUILD_DIR)/core-$(3).dll \ + -nostdlib \ + -nologo \ + -r:$(DOTNET_BINDING_ATTRIBUTES) \ + $($(2)_APIS) \ + $($(2)_GENERATOR_DEFINES) \ + @$(RSP_DIR)/dotnet/$(3)-defines-dotnet.rsp \ + > $$@.tmp + $$(Q) mv $$@.tmp $$@ + +$($(2)_DOTNET_BUILD_DIR)/apidefinition-$(3).dll: $($(2)_DOTNET_BUILD_DIR)/apidefinition-$(3).rsp $($(2)_DOTNET_BUILD_DIR)/core-$(3).dll $(DOTNET_BINDING_ATTRIBUTES) + $$(Q_GEN) $(DOTNET_CSC) $(DOTNET_FLAGS) @$$< -$($(2)_DOTNET_BUILD_DIR)/$(3)-generated-sources: $(DOTNET_GENERATOR) $($(2)_DOTNET_APIS) $($(2)_DOTNET_BUILD_DIR)/core-$(3).dll $(DOTNET_BINDING_ATTRIBUTES) $($(2)_DOTNET_BUILD_DIR)/$(3).rsp | $($(2)_DOTNET_BUILD_DIR)/generated-sources +apidefinition:: $(3)-apidefinition +$(3)-apidefinition: $($(2)_DOTNET_BUILD_DIR)/apidefinition-$(3).dll + +$($(2)_DOTNET_BUILD_DIR)/$(3)-generated-sources: $(DOTNET_GENERATOR) $($(2)_DOTNET_APIS) $($(2)_DOTNET_BUILD_DIR)/core-$(3).dll $($(2)_DOTNET_BUILD_DIR)/apidefinition-$(3).dll $(DOTNET_BINDING_ATTRIBUTES) $($(2)_DOTNET_BUILD_DIR)/$(3).rsp | $($(2)_DOTNET_BUILD_DIR)/generated-sources $$(Q_DOTNET_GEN) $$< @$($(2)_DOTNET_BUILD_DIR)/$(3).rsp $($(2)_DOTNET_BUILD_DIR)/$(3).rsp: Makefile Makefile.generator Makefile.rgenerator frameworks.sources $(ROSLYN_GENERATOR) $(ROSLYN_ANALYZER) $(DOTNET_COMPILER) | $($(2)_DOTNET_BUILD_DIR) @@ -365,8 +401,7 @@ $($(2)_DOTNET_BUILD_DIR)/$(3).rsp: Makefile Makefile.generator Makefile.rgenerat -tmpdir=$($(2)_DOTNET_BUILD_DIR)/generated-sources \ -baselib=$($(2)_DOTNET_BUILD_DIR)/core-$(3).dll \ --target-framework=.NETCoreApp,Version=$(GENERATOR_TF_VERSION),Profile=$(3) \ - $($(2)_APIS) \ - @$(RSP_DIR)/dotnet/$(3)-defines-dotnet.rsp \ + --compiled-api-definition-assembly=$($(2)_DOTNET_BUILD_DIR)/apidefinition-$(3).dll \ > $$@ DOTNET_TARGETS_$(3) += \ @@ -440,6 +475,7 @@ endif $(2)_DOTNET_PLATFORM_ASSEMBLY_DEPENDENCIES = \ $($(2)_DOTNET_SOURCES) \ + $($(2)_DOTNET_BUILD_DIR)/Microsoft.$(1).rsp \ $($(2)_DOTNET_BUILD_DIR)/$(3)-generated-sources \ $($(2)_DOTNET_BUILD_DIR)/SourceLink.json \ $($(2)_DOTNET_BUILD_DIR)/embed-files.rsp \ @@ -451,9 +487,11 @@ $(2)_DOTNET_PLATFORM_ASSEMBLY_DIR_DEPENDENCIES = \ $($(2)_DOTNET_BUILD_DIR)/$(4) \ $($(2)_DOTNET_BUILD_DIR)/ref \ -$($(2)_DOTNET_BUILD_DIR)/$(4)/Microsoft.$(1)%dll $($(2)_DOTNET_BUILD_DIR)/$(4)/Microsoft.$(1)%pdb $$($(2)_$(4)_REF_TARGET) $$($(2)_$(4)_DOC_TARGET): $$($(2)_DOTNET_PLATFORM_ASSEMBLY_DEPENDENCIES) $$(ROSLYN_GENERATOR) $$(ROSLYN_ANALYZER) | $$($(2)_DOTNET_PLATFORM_ASSEMBLY_DIR_DEPENDENCIES) - $$(call Q_PROF_CSC,dotnet/$(4)-bit) \ - $(DOTNET_CSC) \ +rsp:: $($(2)_DOTNET_BUILD_DIR)/Microsoft.$(1).rsp + +$($(2)_DOTNET_BUILD_DIR)/Microsoft.$(1).rsp: Makefile | $($(2)_DOTNET_BUILD_DIR) + $$(Q) rm -f $$@ + $$(Q) echo \ $(DOTNET_FLAGS) \ /analyzer:$(ROSLYN_GENERATOR_COMMON) \ /analyzer:$(ROSLYN_GENERATOR) \ @@ -468,18 +506,23 @@ $($(2)_DOTNET_BUILD_DIR)/$(4)/Microsoft.$(1)%dll $($(2)_DOTNET_BUILD_DIR)/$(4)/M $$($(2)_$(4)_REFOUT_ARG) \ $$($(2)_$(4)_DOC_ARG) \ -sourcelink:$($(2)_DOTNET_BUILD_DIR)/SourceLink.json \ - @$($(2)_DOTNET_BUILD_DIR)/embed-files.rsp \ + @$$(abspath $($(2)_DOTNET_BUILD_DIR)/embed-files.rsp) \ $$($(2)_DEFINES) \ $(ARGS_$(4)) \ $$(DOTNET_WARNINGS_TO_FIX) \ - @$(RSP_DIR)/dotnet/$(3)-defines-dotnet.rsp \ + @$$(abspath $(RSP_DIR)/dotnet/$(3)-defines-dotnet.rsp) \ -res:$($(2)_DOTNET_BUILD_DIR)/ILLink.LinkAttributes.xml \ -res:$($(2)_DOTNET_BUILD_DIR)/ILLink.Substitutions.xml \ -warnaserror+ \ -nullable+ \ $$($(2)_DOTNET_SOURCES) \ - @$($(2)_DOTNET_BUILD_DIR)/$(3)-generated-sources \ + @$$(abspath $($(2)_DOTNET_BUILD_DIR)/$(3)-generated-sources) \ -out:$($(2)_DOTNET_BUILD_DIR)/$(4)/Microsoft.$(1).dll \ + > $$@.tmp + $$(Q) mv $$@.tmp $$@ + +$($(2)_DOTNET_BUILD_DIR)/$(4)/Microsoft.$(1)%dll $($(2)_DOTNET_BUILD_DIR)/$(4)/Microsoft.$(1)%pdb $$($(2)_$(4)_REF_TARGET) $$($(2)_$(4)_DOC_TARGET): $$($(2)_DOTNET_PLATFORM_ASSEMBLY_DEPENDENCIES) $$(ROSLYN_GENERATOR) $$(ROSLYN_ANALYZER) | $$($(2)_DOTNET_PLATFORM_ASSEMBLY_DIR_DEPENDENCIES) + $$(call Q_PROF_CSC,dotnet/$(4)-bit) $(DOTNET_CSC) @$($(2)_DOTNET_BUILD_DIR)/Microsoft.$(1).rsp dotnet-$(3):: $($(2)_DOTNET_BUILD_DIR)/$(4)/Microsoft.$(1).dll diff --git a/src/bgen/BindingTouch.cs b/src/bgen/BindingTouch.cs index 4d47eda6123e..8a6ca641537c 100644 --- a/src/bgen/BindingTouch.cs +++ b/src/bgen/BindingTouch.cs @@ -264,8 +264,8 @@ public bool TryInitializeApi (BindingTouchConfig config, [NotNullWhen (true)] ou config.CoreSources.Insert (i - 1, config.Sources [i]); } - if (config.ApiSources.Count == 0) { - Console.WriteLine ("Error: no api file provided"); + if (config.ApiSources.Count == 0 && string.IsNullOrEmpty (compiled_api_definition_assembly)) { + Console.WriteLine ("Error: no api file provided, nor a compiled api definition assembly"); ShowHelp (config.OptionSet); return false; } @@ -273,8 +273,11 @@ public bool TryInitializeApi (BindingTouchConfig config, [NotNullWhen (true)] ou if (config.TemporaryFileDirectory is null) config.TemporaryFileDirectory = GetWorkDir (); - string firstApiDefinitionName = Path.GetFileNameWithoutExtension (config.ApiSources [0]); - firstApiDefinitionName = firstApiDefinitionName.Replace ('-', '_'); // This is not exhaustive, but common. + var firstApiDefinitionName = string.Empty; + if (config.ApiSources.Count > 0) { + firstApiDefinitionName = Path.GetFileNameWithoutExtension (config.ApiSources [0]); + firstApiDefinitionName = firstApiDefinitionName.Replace ('-', '_'); // This is not exhaustive, but common. + } if (outfile is null) outfile = firstApiDefinitionName + ".dll"; diff --git a/src/foundation.cs b/src/foundation.cs index 7a25c1cf2e99..81e97254f221 100644 --- a/src/foundation.cs +++ b/src/foundation.cs @@ -30,7 +30,11 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // + #define DOUBLE_BLOCKS + +global using nfloat = global::System.Runtime.InteropServices.NFloat; + using ObjCRuntime; using CloudKit; using CoreData;