-
Notifications
You must be signed in to change notification settings - Fork 518
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dev/mandel/just-rsp-apidefinition
- Loading branch information
Showing
26 changed files
with
690 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
src/rgen/Microsoft.Macios.Transformer/Attributes/CoreImageFilterData.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using System.Diagnostics.CodeAnalysis; | ||
using Microsoft.CodeAnalysis; | ||
using MethodAttributes = Mono.Cecil.MethodAttributes; | ||
|
||
namespace Microsoft.Macios.Transformer.Attributes; | ||
|
||
readonly struct CoreImageFilterData : IEquatable<CoreImageFilterData> { | ||
|
||
public MethodAttributes DefaultCtorVisibility { get; init; } | ||
|
||
public MethodAttributes IntPtrCtorVisibility { get; init; } | ||
|
||
public MethodAttributes StringCtorVisibility { get; init; } | ||
|
||
public CoreImageFilterData () | ||
{ | ||
|
||
DefaultCtorVisibility = MethodAttributes.Public; | ||
IntPtrCtorVisibility = MethodAttributes.Private; | ||
StringCtorVisibility = MethodAttributes.Private; | ||
} | ||
|
||
|
||
public static bool TryParse (AttributeData attributeData, | ||
[NotNullWhen (true)] out CoreImageFilterData? data) | ||
{ | ||
var defaultVisibility = MethodAttributes.Public; | ||
var intPtrVisibility = MethodAttributes.Private; | ||
var stringVisibility = MethodAttributes.Private; | ||
|
||
// there is not positional constructor for this attribute | ||
foreach (var (argumentName, value) in attributeData.NamedArguments) { | ||
switch (argumentName) { | ||
case "DefaultCtorVisibility": | ||
defaultVisibility = (MethodAttributes) Convert.ToSingle ((int) value.Value!); | ||
break; | ||
case "IntPtrCtorVisibility": | ||
intPtrVisibility = (MethodAttributes) Convert.ToSingle ((int) value.Value!); | ||
break; | ||
case "StringCtorVisibility": | ||
stringVisibility = (MethodAttributes) Convert.ToSingle ((int) value.Value!); | ||
break; | ||
default: | ||
data = null; | ||
return false; | ||
} | ||
} | ||
|
||
data = new () { | ||
DefaultCtorVisibility = defaultVisibility, | ||
IntPtrCtorVisibility = intPtrVisibility, | ||
StringCtorVisibility = stringVisibility, | ||
}; | ||
return true; | ||
} | ||
|
||
public bool Equals (CoreImageFilterData other) | ||
{ | ||
if (DefaultCtorVisibility != other.DefaultCtorVisibility) | ||
return false; | ||
if (IntPtrCtorVisibility != other.IntPtrCtorVisibility) | ||
return false; | ||
return StringCtorVisibility == other.StringCtorVisibility; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override bool Equals (object? obj) | ||
{ | ||
return obj is CoreImageFilterData other && Equals (other); | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override int GetHashCode () | ||
=> HashCode.Combine (DefaultCtorVisibility, IntPtrCtorVisibility, StringCtorVisibility); | ||
|
||
public static bool operator == (CoreImageFilterData x, CoreImageFilterData y) | ||
{ | ||
return x.Equals (y); | ||
} | ||
|
||
public static bool operator != (CoreImageFilterData x, CoreImageFilterData y) | ||
{ | ||
return !(x == y); | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override string ToString () | ||
{ | ||
return $"{{ DefaultCtorVisibility: {DefaultCtorVisibility}, IntPtrCtorVisibility: {IntPtrCtorVisibility}, StringCtorVisibility: {StringCtorVisibility} }}"; | ||
} | ||
} |
83 changes: 83 additions & 0 deletions
83
src/rgen/Microsoft.Macios.Transformer/Attributes/CoreImageFilterPropertyData.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using System.Diagnostics.CodeAnalysis; | ||
using Microsoft.CodeAnalysis; | ||
|
||
namespace Microsoft.Macios.Transformer.Attributes; | ||
|
||
readonly struct CoreImageFilterPropertyData : IEquatable<CoreImageFilterPropertyData> { | ||
|
||
public string Name { get; } | ||
|
||
public CoreImageFilterPropertyData (string name) | ||
{ | ||
Name = name; | ||
} | ||
|
||
public static bool TryParse (AttributeData attributeData, | ||
[NotNullWhen (true)] out CoreImageFilterPropertyData? data) | ||
{ | ||
data = null; | ||
var count = attributeData.ConstructorArguments.Length; | ||
string name; | ||
|
||
switch (count) { | ||
case 1: | ||
name = (string) attributeData.ConstructorArguments [0].Value!; | ||
break; | ||
default: | ||
// 0 should not be an option.. | ||
return false; | ||
} | ||
|
||
if (attributeData.NamedArguments.Length == 0) { | ||
data = new (name); | ||
return true; | ||
} | ||
|
||
foreach (var (argumentName, value) in attributeData.NamedArguments) { | ||
switch (argumentName) { | ||
case "Name": | ||
name = (string) value.Value!; | ||
break; | ||
default: | ||
data = null; | ||
return false; | ||
} | ||
} | ||
|
||
data = new (name); | ||
return true; | ||
} | ||
|
||
public bool Equals (CoreImageFilterPropertyData other) | ||
=> Name == other.Name; | ||
|
||
/// <inheritdoc /> | ||
public override bool Equals (object? obj) | ||
{ | ||
return obj is CoreImageFilterPropertyData other && Equals (other); | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override int GetHashCode () | ||
=> HashCode.Combine (Name); | ||
|
||
|
||
public static bool operator == (CoreImageFilterPropertyData x, CoreImageFilterPropertyData y) | ||
{ | ||
return x.Equals (y); | ||
} | ||
|
||
public static bool operator != (CoreImageFilterPropertyData x, CoreImageFilterPropertyData y) | ||
{ | ||
return !(x == y); | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override string ToString () | ||
{ | ||
return $"{{ Name: '{Name}' }}"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
3d68d50
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥 [CI Build] Test results 🔥
Test results
❌ Tests failed on VSTS: test results
1 tests crashed, 2 tests failed, 104 tests passed.
Failures
❌ generator tests
Html Report (VSDrops) Download
❌ monotouch tests (iOS)
🔥 Failed catastrophically on VSTS: test results - monotouch_ios (no summary found).
Html Report (VSDrops) Download
❌ monotouch tests (MacCatalyst)
Tests run: 3153 Passed: 2981 Inconclusive: 10 Failed: 1 Ignored: 171)
Html Report (VSDrops) Download
Successes
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 9 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 8 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download
Pipeline on Agent
Hash: 3d68d507e9640255629a6036a4475a47d11fceb2 [CI build]