[tools] Use Extensions.Is instead of Extensions.IsPlatformType. (#9530)
The latter just calls the former.
This commit is contained in:
Родитель
48090369db
Коммит
84758616ce
|
@ -6,6 +6,7 @@ using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using Mono.Cecil;
|
using Mono.Cecil;
|
||||||
|
using Mono.Tuner;
|
||||||
using MonoTouch.Tuner;
|
using MonoTouch.Tuner;
|
||||||
using ObjCRuntime;
|
using ObjCRuntime;
|
||||||
using Xamarin;
|
using Xamarin;
|
||||||
|
@ -243,7 +244,7 @@ namespace Xamarin.Bundler {
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
TypeReference type = attr.Constructor.DeclaringType;
|
TypeReference type = attr.Constructor.DeclaringType;
|
||||||
if (!type.IsPlatformType ("ObjCRuntime", "LinkWithAttribute"))
|
if (!type.Is ("ObjCRuntime", "LinkWithAttribute"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Let the linker remove it the attribute from the assembly
|
// Let the linker remove it the attribute from the assembly
|
||||||
|
|
|
@ -21,10 +21,5 @@ namespace MonoTouch.Tuner {
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsPlatformType (this TypeReference type, string @namespace, string name)
|
|
||||||
{
|
|
||||||
return type.Is (@namespace, name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace Xamarin.Linker.Steps
|
||||||
|
|
||||||
// We don't need to process assemblies that don't reference ObjCRuntime.BindAsAttribute.
|
// We don't need to process assemblies that don't reference ObjCRuntime.BindAsAttribute.
|
||||||
foreach (var tr in assembly.MainModule.GetTypeReferences ()) {
|
foreach (var tr in assembly.MainModule.GetTypeReferences ()) {
|
||||||
if (tr.IsPlatformType ("ObjCRuntime", "BindAsAttribute"))
|
if (tr.Is ("ObjCRuntime", "BindAsAttribute"))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ namespace Xamarin.Linker.Steps
|
||||||
foreach (var ca in provider.CustomAttributes) {
|
foreach (var ca in provider.CustomAttributes) {
|
||||||
var tr = ca.Constructor.DeclaringType;
|
var tr = ca.Constructor.DeclaringType;
|
||||||
|
|
||||||
if (!tr.IsPlatformType ("ObjCRuntime", "BindAsAttribute"))
|
if (!tr.Is ("ObjCRuntime", "BindAsAttribute"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (ca.ConstructorArguments.Count != 1) {
|
if (ca.ConstructorArguments.Count != 1) {
|
||||||
|
@ -110,13 +110,13 @@ namespace Xamarin.Linker.Steps
|
||||||
if (!method.HasParameters || method.Parameters.Count != 1)
|
if (!method.HasParameters || method.Parameters.Count != 1)
|
||||||
continue;
|
continue;
|
||||||
if (method.Name == "GetConstant") {
|
if (method.Name == "GetConstant") {
|
||||||
if (!method.ReturnType.IsPlatformType ("Foundation", "NSString"))
|
if (!method.ReturnType.Is ("Foundation", "NSString"))
|
||||||
continue;
|
continue;
|
||||||
if (method.Parameters [0].ParameterType != managedEnumType)
|
if (method.Parameters [0].ParameterType != managedEnumType)
|
||||||
continue;
|
continue;
|
||||||
getConstant = method;
|
getConstant = method;
|
||||||
} else if (method.Name == "GetValue") {
|
} else if (method.Name == "GetValue") {
|
||||||
if (!method.Parameters [0].ParameterType.IsPlatformType ("Foundation", "NSString"))
|
if (!method.Parameters [0].ParameterType.Is ("Foundation", "NSString"))
|
||||||
continue;
|
continue;
|
||||||
if (method.ReturnType != managedEnumType)
|
if (method.ReturnType != managedEnumType)
|
||||||
continue;
|
continue;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче