Autoformat cecil-tests.csproj. (#16103)
All other changes should be blank space only. Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
This commit is contained in:
Родитель
13e3d85a41
Коммит
deb0faa4f2
|
@ -43,6 +43,7 @@ jobs:
|
||||||
SRC_DIR=$(pwd)
|
SRC_DIR=$(pwd)
|
||||||
cd ..
|
cd ..
|
||||||
dotnet format "$SRC_DIR/tools/xibuild/xibuild.csproj"
|
dotnet format "$SRC_DIR/tools/xibuild/xibuild.csproj"
|
||||||
|
dotnet format whitespace "$SRC_DIR/tests/cecil-tests/cecil-tests.csproj"
|
||||||
# dotnet format "$SRC_DIR/[...]"
|
# dotnet format "$SRC_DIR/[...]"
|
||||||
# add more projects here...
|
# add more projects here...
|
||||||
cd "$SRC_DIR"
|
cd "$SRC_DIR"
|
||||||
|
|
|
@ -91,25 +91,24 @@ namespace Cecil.Tests {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var doubleAttributed = new List<string>();
|
var doubleAttributed = new List<string> ();
|
||||||
foreach (var type in Helper.FilterTypes (assembly, a => HasAnyAvailabilityAttribute (a))) {
|
foreach (var type in Helper.FilterTypes (assembly, a => HasAnyAvailabilityAttribute (a))) {
|
||||||
var platformCount = new Dictionary<string, int> ();
|
var platformCount = new Dictionary<string, int> ();
|
||||||
foreach (var attribute in type.CustomAttributes.Where (a => IsAvailabilityAttribute (a))) {
|
foreach (var attribute in type.CustomAttributes.Where (a => IsAvailabilityAttribute (a))) {
|
||||||
var kind = FindAvailabilityKind (attribute);
|
var kind = FindAvailabilityKind (attribute);
|
||||||
if (kind is not null) {
|
if (kind is not null) {
|
||||||
string key = $"{attribute.AttributeType.Name}-{kind}";
|
string key = $"{attribute.AttributeType.Name}-{kind}";
|
||||||
if (platformCount.ContainsKey (key)) {
|
if (platformCount.ContainsKey (key)) {
|
||||||
platformCount[key] += 1;
|
platformCount [key] += 1;
|
||||||
}
|
} else {
|
||||||
else {
|
platformCount [key] = 1;
|
||||||
platformCount[key] = 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach (var (kind, count) in platformCount) {
|
foreach (var (kind, count) in platformCount) {
|
||||||
// AVFoundation.AVMetadataIdentifiers uses an old pattern of a parent
|
// AVFoundation.AVMetadataIdentifiers uses an old pattern of a parent
|
||||||
// class and many child classes with constants.
|
// class and many child classes with constants.
|
||||||
if (type.ToString() == "AVFoundation.AVMetadataIdentifiers") {
|
if (type.ToString () == "AVFoundation.AVMetadataIdentifiers") {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (count != 1) {
|
if (count != 1) {
|
||||||
|
@ -133,13 +132,12 @@ namespace Cecil.Tests {
|
||||||
|
|
||||||
var myAvailability = GetAvailabilityAttributes (item);
|
var myAvailability = GetAvailabilityAttributes (item);
|
||||||
if (!FirstContainsAllOfSecond (myAvailability, parentAvailability)) {
|
if (!FirstContainsAllOfSecond (myAvailability, parentAvailability)) {
|
||||||
DebugPrint (fullName, parentAvailability, myAvailability);
|
DebugPrint (fullName, parentAvailability, myAvailability);
|
||||||
found.Add (fullName);
|
found.Add (fullName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class PlatformClaimInfo
|
public class PlatformClaimInfo {
|
||||||
{
|
|
||||||
public HashSet<string> MentionedPlatforms { get; set; } // Mentioned in both Supported and Unsupported contexts
|
public HashSet<string> MentionedPlatforms { get; set; } // Mentioned in both Supported and Unsupported contexts
|
||||||
public HashSet<string> ClaimedPlatforms { get; set; } // Mentioned only in Supported contexts
|
public HashSet<string> ClaimedPlatforms { get; set; } // Mentioned only in Supported contexts
|
||||||
|
|
||||||
|
@ -192,59 +190,58 @@ namespace Cecil.Tests {
|
||||||
foreach (var module in assembly.Modules) {
|
foreach (var module in assembly.Modules) {
|
||||||
foreach (var type in module.Types) {
|
foreach (var type in module.Types) {
|
||||||
foreach (var member in GetAllTypeMembers (type)) {
|
foreach (var member in GetAllTypeMembers (type)) {
|
||||||
var mentionedPlatforms = GetAvailabilityAttributes (member).ToList();
|
var mentionedPlatforms = GetAvailabilityAttributes (member).ToList ();
|
||||||
if (mentionedPlatforms.Any()) {
|
if (mentionedPlatforms.Any ()) {
|
||||||
var claimedPlatforms = GetSupportedAvailabilityAttributes (member).ToList();
|
var claimedPlatforms = GetSupportedAvailabilityAttributes (member).ToList ();
|
||||||
string key = GetMemberLookupKey (member);
|
string key = GetMemberLookupKey (member);
|
||||||
if (!harvestedInfo.ContainsKey (key)) {
|
if (!harvestedInfo.ContainsKey (key)) {
|
||||||
harvestedInfo[key] = new Dictionary<string, PlatformClaimInfo>();
|
harvestedInfo [key] = new Dictionary<string, PlatformClaimInfo> ();
|
||||||
}
|
}
|
||||||
var claimInfo = new PlatformClaimInfo (mentionedPlatforms, claimedPlatforms);
|
var claimInfo = new PlatformClaimInfo (mentionedPlatforms, claimedPlatforms);
|
||||||
if (harvestedInfo[key].ContainsKey(currentPlatform)) {
|
if (harvestedInfo [key].ContainsKey (currentPlatform)) {
|
||||||
harvestedInfo[key][currentPlatform].UnionWith (claimInfo);
|
harvestedInfo [key] [currentPlatform].UnionWith (claimInfo);
|
||||||
}
|
} else {
|
||||||
else {
|
harvestedInfo [key] [currentPlatform] = claimInfo;
|
||||||
harvestedInfo[key][currentPlatform] = claimInfo;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now walk every item found above and check two things:
|
// Now walk every item found above and check two things:
|
||||||
var attributesWereCompiledOut = new List<string>();
|
var attributesWereCompiledOut = new List<string> ();
|
||||||
var doesNotExistWhereClaimed = new List<string>();
|
var doesNotExistWhereClaimed = new List<string> ();
|
||||||
foreach (var (member, info) in harvestedInfo) {
|
foreach (var (member, info) in harvestedInfo) {
|
||||||
// 1. All platforms match in count of mentioned (we did not conditionally compile out attributes)
|
// 1. All platforms match in count of mentioned (we did not conditionally compile out attributes)
|
||||||
int expectedPlatformCount = info.First().Value.MentionedPlatforms.Count();
|
int expectedPlatformCount = info.First ().Value.MentionedPlatforms.Count ();
|
||||||
if (info.Any (i => i.Value.MentionedPlatforms.Count() != expectedPlatformCount)) {
|
if (info.Any (i => i.Value.MentionedPlatforms.Count () != expectedPlatformCount)) {
|
||||||
if (IgnoreElementsThatDoNotExistInThatAssembly (member)) {
|
if (IgnoreElementsThatDoNotExistInThatAssembly (member)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
string detailedPlatformBreakdown = string.Join ("\n", info.Select(x => ($"Assembly {x.Key} => {x.Value}")));
|
string detailedPlatformBreakdown = string.Join ("\n", info.Select (x => ($"Assembly {x.Key} => {x.Value}")));
|
||||||
string errorMessage = $"{member} did not have the same number of SupportedOSPlatformAttribute in every assembly:\n{detailedPlatformBreakdown}";
|
string errorMessage = $"{member} did not have the same number of SupportedOSPlatformAttribute in every assembly:\n{detailedPlatformBreakdown}";
|
||||||
attributesWereCompiledOut.Add (errorMessage);
|
attributesWereCompiledOut.Add (errorMessage);
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
Console.Error.WriteLine (errorMessage);
|
Console.Error.WriteLine (errorMessage);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 2. For each supported attribute claim exist, that it exists on that platform
|
// 2. For each supported attribute claim exist, that it exists on that platform
|
||||||
// Since we know each platform claims are now equal, just use the first one
|
// Since we know each platform claims are now equal, just use the first one
|
||||||
var claimedPlatforms = info.First().Value.ClaimedPlatforms;
|
var claimedPlatforms = info.First ().Value.ClaimedPlatforms;
|
||||||
foreach (var platform in claimedPlatforms) {
|
foreach (var platform in claimedPlatforms) {
|
||||||
if (!info.ContainsKey (platform)) {
|
if (!info.ContainsKey (platform)) {
|
||||||
if (IgnoreElementsThatDoNotExistInThatAssembly (member)) {
|
if (IgnoreElementsThatDoNotExistInThatAssembly (member)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
string detailedPlatformBreakdown = string.Join ("\n", info.Select(x => ($"Assembly {x.Key} => Declares ({string.Join (" ", x.Value)})")));
|
string detailedPlatformBreakdown = string.Join ("\n", info.Select (x => ($"Assembly {x.Key} => Declares ({string.Join (" ", x.Value)})")));
|
||||||
string errorMessage = $"{member} was not found on {platform} despite being declared supported there.";
|
string errorMessage = $"{member} was not found on {platform} despite being declared supported there.";
|
||||||
doesNotExistWhereClaimed.Add (errorMessage);
|
doesNotExistWhereClaimed.Add (errorMessage);
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
Console.Error.WriteLine (errorMessage);
|
Console.Error.WriteLine (errorMessage);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -260,7 +257,7 @@ namespace Cecil.Tests {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// QuickLook is aliased with QuickLookUI on some platforms
|
// QuickLook is aliased with QuickLookUI on some platforms
|
||||||
if (member.StartsWith("QuickLook")) {
|
if (member.StartsWith ("QuickLook")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// These two types are defined with non-trivial define magic and one platform doesn't necessarily have
|
// These two types are defined with non-trivial define magic and one platform doesn't necessarily have
|
||||||
|
@ -275,7 +272,7 @@ namespace Cecil.Tests {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// Generator Bug - Protocol inline with different attribute bug
|
// Generator Bug - Protocol inline with different attribute bug
|
||||||
if (member.StartsWith ("SceneKit.SCNLayer") ||
|
if (member.StartsWith ("SceneKit.SCNLayer") ||
|
||||||
member.StartsWith ("AVFoundation.AVAudioSession")) {
|
member.StartsWith ("AVFoundation.AVAudioSession")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -459,7 +456,7 @@ namespace Cecil.Tests {
|
||||||
// Members of xkit and other places conditionally inline and include members in one of two namespaces
|
// Members of xkit and other places conditionally inline and include members in one of two namespaces
|
||||||
// based upon platform assembly. Cludge them to the same key, so we don't mistakenly think members are missing
|
// based upon platform assembly. Cludge them to the same key, so we don't mistakenly think members are missing
|
||||||
// from some platforms
|
// from some platforms
|
||||||
return $"{member.DeclaringType.FullName}.{member.Name}".Replace("AppKit", "Kit").Replace("UIKit", "Kit");
|
return $"{member.DeclaringType.FullName}.{member.Name}".Replace ("AppKit", "Kit").Replace ("UIKit", "Kit");
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerable<IMemberDefinition> GetAllTypeMembers (TypeDefinition type)
|
IEnumerable<IMemberDefinition> GetAllTypeMembers (TypeDefinition type)
|
||||||
|
@ -525,7 +522,7 @@ namespace Cecil.Tests {
|
||||||
if (!supportedAttributes.Any (a => FindAvailabilityKind (a) == platformName)) {
|
if (!supportedAttributes.Any (a => FindAvailabilityKind (a) == platformName)) {
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
Console.WriteLine (fullName);
|
Console.WriteLine (fullName);
|
||||||
Console.WriteLine (String.Join(" ", supportedAttributes.Select (x => FindAvailabilityKind(x))));
|
Console.WriteLine (String.Join (" ", supportedAttributes.Select (x => FindAvailabilityKind (x))));
|
||||||
Console.WriteLine (platformName);
|
Console.WriteLine (platformName);
|
||||||
#endif
|
#endif
|
||||||
found.Add (fullName);
|
found.Add (fullName);
|
||||||
|
@ -617,7 +614,7 @@ namespace Cecil.Tests {
|
||||||
|
|
||||||
bool HasAnyAvailabilityAttribute (ICustomAttributeProvider provider) => provider.CustomAttributes.Any (a => IsAvailabilityAttribute (a));
|
bool HasAnyAvailabilityAttribute (ICustomAttributeProvider provider) => provider.CustomAttributes.Any (a => IsAvailabilityAttribute (a));
|
||||||
bool HasAnySupportedAttribute (ICustomAttributeProvider provider) => provider.CustomAttributes.Any (a => IsSupportedAttribute (a));
|
bool HasAnySupportedAttribute (ICustomAttributeProvider provider) => provider.CustomAttributes.Any (a => IsSupportedAttribute (a));
|
||||||
|
|
||||||
bool IsAvailabilityAttribute (CustomAttribute attribute) => IsSupportedAttribute (attribute) || attribute.AttributeType.Name == "UnsupportedOSPlatformAttribute";
|
bool IsAvailabilityAttribute (CustomAttribute attribute) => IsSupportedAttribute (attribute) || attribute.AttributeType.Name == "UnsupportedOSPlatformAttribute";
|
||||||
bool IsSupportedAttribute (CustomAttribute attribute) => attribute.AttributeType.Name == "SupportedOSPlatformAttribute";
|
bool IsSupportedAttribute (CustomAttribute attribute) => attribute.AttributeType.Name == "SupportedOSPlatformAttribute";
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,7 @@ namespace Cecil.Tests {
|
||||||
{
|
{
|
||||||
var list = new StringBuilder ();
|
var list = new StringBuilder ();
|
||||||
foreach (var mar in methodAndResults) {
|
foreach (var mar in methodAndResults) {
|
||||||
list.Append ("\n\"").Append (mar.Method.FullName).Append("\" : ");
|
list.Append ("\n\"").Append (mar.Method.FullName).Append ("\" : ");
|
||||||
switch (mar.Result) {
|
switch (mar.Result) {
|
||||||
case GenericCheckResult.ContainsGenerics:
|
case GenericCheckResult.ContainsGenerics:
|
||||||
list.Append ("method contains a generic argument for the first arg of SetupBlockUnsafe. This is problematic in .NET 7 and above.");
|
list.Append ("method contains a generic argument for the first arg of SetupBlockUnsafe. This is problematic in .NET 7 and above.");
|
||||||
|
@ -151,7 +151,7 @@ namespace Cecil.Tests {
|
||||||
if (method.Body is null)
|
if (method.Body is null)
|
||||||
return false;
|
return false;
|
||||||
return method.Body.Instructions.Any (IsCallToSetupBlockUnsafe);
|
return method.Body.Instructions.Any (IsCallToSetupBlockUnsafe);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool IsCallToSetupBlockUnsafe (Instruction instr)
|
static bool IsCallToSetupBlockUnsafe (Instruction instr)
|
||||||
|
@ -160,7 +160,8 @@ namespace Cecil.Tests {
|
||||||
instr.Operand.ToString () == "System.Void ObjCRuntime.BlockLiteral::SetupBlockUnsafe(System.Delegate,System.Delegate)";
|
instr.Operand.ToString () == "System.Void ObjCRuntime.BlockLiteral::SetupBlockUnsafe(System.Delegate,System.Delegate)";
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool IsCall (Instruction instr) {
|
static bool IsCall (Instruction instr)
|
||||||
|
{
|
||||||
return instr.OpCode == OpCodes.Call ||
|
return instr.OpCode == OpCodes.Call ||
|
||||||
instr.OpCode == OpCodes.Calli;
|
instr.OpCode == OpCodes.Calli;
|
||||||
}
|
}
|
||||||
|
@ -229,7 +230,7 @@ namespace Cecil.Tests {
|
||||||
|
|
||||||
static TypeReference GetLastArgType (MethodDefinition method, Instruction instr)
|
static TypeReference GetLastArgType (MethodDefinition method, Instruction instr)
|
||||||
{
|
{
|
||||||
var paramDef = GetOperandType(method, instr);
|
var paramDef = GetOperandType (method, instr);
|
||||||
if (paramDef is null) {
|
if (paramDef is null) {
|
||||||
throw new NotImplementedException ($"Last instruction before call to SetupBlockUnsafe ({instr.ToString ()}) was not a Ldfld, Ldarg or Ldloc - this is quite unexpected - something's changed in the code base!");
|
throw new NotImplementedException ($"Last instruction before call to SetupBlockUnsafe ({instr.ToString ()}) was not a Ldfld, Ldarg or Ldloc - this is quite unexpected - something's changed in the code base!");
|
||||||
}
|
}
|
||||||
|
|
|
@ -198,7 +198,7 @@ namespace Cecil.Tests {
|
||||||
if (Configuration.include_ios)
|
if (Configuration.include_ios)
|
||||||
yield return CreateTestFixtureDataFromPath (Path.Combine (Configuration.SdkRootXI, "lib", "msbuild", "iOS", "Xamarin.iOS.Tasks.dll"));
|
yield return CreateTestFixtureDataFromPath (Path.Combine (Configuration.SdkRootXI, "lib", "msbuild", "iOS", "Xamarin.iOS.Tasks.dll"));
|
||||||
if (Configuration.include_mac)
|
if (Configuration.include_mac)
|
||||||
yield return CreateTestFixtureDataFromPath (Path.Combine (Configuration.SdkRootXM, "lib", "msbuild", "Xamarin.Mac.Tasks.dll"));
|
yield return CreateTestFixtureDataFromPath (Path.Combine (Configuration.SdkRootXM, "lib", "msbuild", "Xamarin.Mac.Tasks.dll"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,10 +210,9 @@ namespace Cecil.Tests {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class CompatExtensions
|
public static class CompatExtensions {
|
||||||
{
|
|
||||||
// cecil-tests is not NET5 yet, this is required to foreach over a dictionary
|
// cecil-tests is not NET5 yet, this is required to foreach over a dictionary
|
||||||
public static void Deconstruct<T1, T2>(this KeyValuePair<T1, T2> tuple, out T1 key, out T2 value)
|
public static void Deconstruct<T1, T2> (this KeyValuePair<T1, T2> tuple, out T1 key, out T2 value)
|
||||||
{
|
{
|
||||||
key = tuple.Key;
|
key = tuple.Key;
|
||||||
value = tuple.Value;
|
value = tuple.Value;
|
||||||
|
|
|
@ -50,7 +50,7 @@ namespace Cecil.Tests {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestCaseSource (typeof (Helper), nameof (Helper.PlatformAssemblies))]
|
[TestCaseSource (typeof (Helper), nameof (Helper.PlatformAssemblies))]
|
||||||
[TestCaseSource (typeof (Helper), nameof (Helper.NetPlatformImplementationAssemblies))]
|
[TestCaseSource (typeof (Helper), nameof (Helper.NetPlatformImplementationAssemblies))]
|
||||||
// ref: https://github.com/xamarin/xamarin-macios/issues/8249
|
// ref: https://github.com/xamarin/xamarin-macios/issues/8249
|
||||||
public void EnsureUIThreadOnInit (string assemblyPath)
|
public void EnsureUIThreadOnInit (string assemblyPath)
|
||||||
|
|
|
@ -11,10 +11,8 @@ using Xamarin.Utils;
|
||||||
|
|
||||||
#nullable disable // until we get around to fixing this file
|
#nullable disable // until we get around to fixing this file
|
||||||
|
|
||||||
namespace Xamarin.Tests
|
namespace Xamarin.Tests {
|
||||||
{
|
static partial class Configuration {
|
||||||
static partial class Configuration
|
|
||||||
{
|
|
||||||
public const string XI_ProductName = "MonoTouch";
|
public const string XI_ProductName = "MonoTouch";
|
||||||
public const string XM_ProductName = "Xamarin.Mac";
|
public const string XM_ProductName = "Xamarin.Mac";
|
||||||
|
|
||||||
|
@ -89,7 +87,7 @@ namespace Xamarin.Tests
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string IOS_DESTDIR {
|
public static string IOS_DESTDIR {
|
||||||
get { return ios_destdir; }
|
get { return ios_destdir; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string MAC_DESTDIR {
|
public static string MAC_DESTDIR {
|
||||||
|
@ -121,8 +119,7 @@ namespace Xamarin.Tests
|
||||||
if (with_versions.Count == 0)
|
if (with_versions.Count == 0)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
with_versions.Sort ((x, y) =>
|
with_versions.Sort ((x, y) => {
|
||||||
{
|
|
||||||
if (x.Item1 > y.Item1)
|
if (x.Item1 > y.Item1)
|
||||||
return -1;
|
return -1;
|
||||||
else if (x.Item1 < y.Item1)
|
else if (x.Item1 < y.Item1)
|
||||||
|
@ -354,7 +351,7 @@ namespace Xamarin.Tests
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static string TestAssemblyDirectory {
|
static string TestAssemblyDirectory {
|
||||||
get {
|
get {
|
||||||
return TestContext.CurrentContext.WorkDirectory;
|
return TestContext.CurrentContext.WorkDirectory;
|
||||||
|
@ -417,7 +414,7 @@ namespace Xamarin.Tests
|
||||||
|
|
||||||
public static string TargetDirectoryXI {
|
public static string TargetDirectoryXI {
|
||||||
get {
|
get {
|
||||||
if (UseSystem)
|
if (UseSystem)
|
||||||
return "/";
|
return "/";
|
||||||
return make_config ["IOS_DESTDIR"];
|
return make_config ["IOS_DESTDIR"];
|
||||||
}
|
}
|
||||||
|
@ -425,7 +422,7 @@ namespace Xamarin.Tests
|
||||||
|
|
||||||
public static string TargetDirectoryXM {
|
public static string TargetDirectoryXM {
|
||||||
get {
|
get {
|
||||||
if (UseSystem)
|
if (UseSystem)
|
||||||
return "/";
|
return "/";
|
||||||
return make_config ["MAC_DESTDIR"];
|
return make_config ["MAC_DESTDIR"];
|
||||||
}
|
}
|
||||||
|
@ -450,7 +447,7 @@ namespace Xamarin.Tests
|
||||||
static string GetRefNuGetName (TargetFramework targetFramework) => GetRefNuGetName (targetFramework.Platform);
|
static string GetRefNuGetName (TargetFramework targetFramework) => GetRefNuGetName (targetFramework.Platform);
|
||||||
|
|
||||||
static string GetRefNuGetName (ApplePlatform platform)
|
static string GetRefNuGetName (ApplePlatform platform)
|
||||||
{
|
{
|
||||||
switch (platform) {
|
switch (platform) {
|
||||||
case ApplePlatform.iOS:
|
case ApplePlatform.iOS:
|
||||||
return "Microsoft.iOS.Ref";
|
return "Microsoft.iOS.Ref";
|
||||||
|
@ -747,7 +744,7 @@ namespace Xamarin.Tests
|
||||||
throw new NotSupportedException ($"Unknown assembly: {assemblyName}");
|
throw new NotSupportedException ($"Unknown assembly: {assemblyName}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetBaseLibrary (TargetFramework targetFramework)
|
public static string GetBaseLibrary (TargetFramework targetFramework)
|
||||||
{
|
{
|
||||||
|
@ -901,7 +898,7 @@ namespace Xamarin.Tests
|
||||||
return "/Library/Frameworks/Mono.framework/Commands/csc";
|
return "/Library/Frameworks/Mono.framework/Commands/csc";
|
||||||
}
|
}
|
||||||
#endif // !XAMMAC_TESTS
|
#endif // !XAMMAC_TESTS
|
||||||
|
|
||||||
public static IEnumerable<ApplePlatform> GetIncludedPlatforms (bool dotnet)
|
public static IEnumerable<ApplePlatform> GetIncludedPlatforms (bool dotnet)
|
||||||
{
|
{
|
||||||
if (include_ios)
|
if (include_ios)
|
||||||
|
@ -1021,7 +1018,7 @@ namespace Xamarin.Tests
|
||||||
environment ["MD_APPLE_SDK_ROOT"] = Path.GetDirectoryName (Path.GetDirectoryName (xcode_root));
|
environment ["MD_APPLE_SDK_ROOT"] = Path.GetDirectoryName (Path.GetDirectoryName (xcode_root));
|
||||||
environment ["TargetFrameworkFallbackSearchPaths"] = Path.Combine (rootDirectory, "Library", "Frameworks", "Mono.framework", "External", "xbuild-frameworks");
|
environment ["TargetFrameworkFallbackSearchPaths"] = Path.Combine (rootDirectory, "Library", "Frameworks", "Mono.framework", "External", "xbuild-frameworks");
|
||||||
environment ["MSBuildExtensionsPathFallbackPathsOverride"] = Path.Combine (rootDirectory, "Library", "Frameworks", "Mono.framework", "External", "xbuild");
|
environment ["MSBuildExtensionsPathFallbackPathsOverride"] = Path.Combine (rootDirectory, "Library", "Frameworks", "Mono.framework", "External", "xbuild");
|
||||||
|
|
||||||
// This is set by `dotnet test` and can cause building legacy projects to fail to build with:
|
// This is set by `dotnet test` and can cause building legacy projects to fail to build with:
|
||||||
// Microsoft.NET.Build.Extensions.ConflictResolution.targets(30,5):
|
// Microsoft.NET.Build.Extensions.ConflictResolution.targets(30,5):
|
||||||
// error MSB4062: The "ResolvePackageFileConflicts" task could not be loaded from the assembly Microsoft.NET.Build.Extensions.Tasks.dll.
|
// error MSB4062: The "ResolvePackageFileConflicts" task could not be loaded from the assembly Microsoft.NET.Build.Extensions.Tasks.dll.
|
||||||
|
@ -1063,7 +1060,7 @@ namespace Xamarin.Tests
|
||||||
if (!include_dotnet_watchos)
|
if (!include_dotnet_watchos)
|
||||||
Assert.Ignore ("watchOS is not included in this build");
|
Assert.Ignore ("watchOS is not included in this build");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ApplePlatform.MacOSX:
|
case ApplePlatform.MacOSX:
|
||||||
if (!include_mac)
|
if (!include_mac)
|
||||||
|
|
|
@ -10,13 +10,10 @@ using Xamarin.Utils;
|
||||||
|
|
||||||
#nullable disable // until we get around to fixing this file
|
#nullable disable // until we get around to fixing this file
|
||||||
|
|
||||||
namespace Xamarin.Tests
|
namespace Xamarin.Tests {
|
||||||
{
|
class XBuild {
|
||||||
class XBuild
|
|
||||||
{
|
|
||||||
public static string ToolPath {
|
public static string ToolPath {
|
||||||
get
|
get {
|
||||||
{
|
|
||||||
return Configuration.XIBuildPath;
|
return Configuration.XIBuildPath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
using System;
|
using System;
|
||||||
using Xamarin.Utils;
|
using Xamarin.Utils;
|
||||||
|
|
||||||
namespace Xamarin.Tests
|
namespace Xamarin.Tests {
|
||||||
{
|
public enum Profile {
|
||||||
public enum Profile
|
|
||||||
{
|
|
||||||
None,
|
None,
|
||||||
iOS,
|
iOS,
|
||||||
tvOS,
|
tvOS,
|
||||||
|
|
|
@ -5,8 +5,7 @@ using System.Threading;
|
||||||
|
|
||||||
#nullable enable
|
#nullable enable
|
||||||
|
|
||||||
namespace Xamarin
|
namespace Xamarin {
|
||||||
{
|
|
||||||
// A class that creates temporary directories next to the test assembly, and cleans the output on startup
|
// A class that creates temporary directories next to the test assembly, and cleans the output on startup
|
||||||
// Advantages:
|
// Advantages:
|
||||||
// * The temporary directories are automatically cleaned on Wrench (unlike /tmp, which isn't)
|
// * The temporary directories are automatically cleaned on Wrench (unlike /tmp, which isn't)
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
//
|
//
|
||||||
// Copyright 2020 Microsoft Corp. All Rights Reserved.
|
// Copyright 2020 Microsoft Corp. All Rights Reserved.
|
||||||
|
|
||||||
namespace Xamarin.Utils
|
namespace Xamarin.Utils {
|
||||||
{
|
|
||||||
public enum ApplePlatform {
|
public enum ApplePlatform {
|
||||||
None,
|
None,
|
||||||
MacOSX,
|
MacOSX,
|
||||||
|
|
|
@ -12,10 +12,8 @@ using System.Linq;
|
||||||
|
|
||||||
#nullable disable // until we get around to fixing this file
|
#nullable disable // until we get around to fixing this file
|
||||||
|
|
||||||
namespace Xamarin.Utils
|
namespace Xamarin.Utils {
|
||||||
{
|
public struct TargetFramework : IEquatable<TargetFramework> {
|
||||||
public struct TargetFramework : IEquatable<TargetFramework>
|
|
||||||
{
|
|
||||||
const string TFMVersion = "6.0";
|
const string TFMVersion = "6.0";
|
||||||
public const string DotNet_iOS_String = ".NETCoreApp,Version=" + TFMVersion + ",Profile=ios"; // Short form: netX.Y-ios
|
public const string DotNet_iOS_String = ".NETCoreApp,Version=" + TFMVersion + ",Profile=ios"; // Short form: netX.Y-ios
|
||||||
public const string DotNet_tvOS_String = ".NETCoreApp,Version=" + TFMVersion + ",Profile=tvos"; // Short form: netX.Y-tvos
|
public const string DotNet_tvOS_String = ".NETCoreApp,Version=" + TFMVersion + ",Profile=tvos"; // Short form: netX.Y-tvos
|
||||||
|
@ -191,7 +189,7 @@ namespace Xamarin.Utils
|
||||||
|
|
||||||
public override bool Equals (object obj)
|
public override bool Equals (object obj)
|
||||||
{
|
{
|
||||||
return obj is TargetFramework ? Equals ((TargetFramework)obj) : false;
|
return obj is TargetFramework ? Equals ((TargetFramework) obj) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int GetHashCode ()
|
public override int GetHashCode ()
|
||||||
|
|
Загрузка…
Ссылка в новой задаче