Commit 28284b24 authored by Vinicius Jarina's avatar Vinicius Jarina
Browse files

Enable `Reflection.Emit` on iOS

parent 593081fc
...@@ -13,7 +13,7 @@ namespace NLua ...@@ -13,7 +13,7 @@ namespace NLua
private readonly Dictionary<Type, LuaClassType> _classCollection = new Dictionary<Type, LuaClassType>(); private readonly Dictionary<Type, LuaClassType> _classCollection = new Dictionary<Type, LuaClassType>();
private readonly Dictionary<Type, Type> _delegateCollection = new Dictionary<Type, Type>(); private readonly Dictionary<Type, Type> _delegateCollection = new Dictionary<Type, Type>();
#if !(__IOS__ || __TVOS__ || __WATCHOS__) && !NETSTANDARD #if !NETSTANDARD
private Dictionary<Type, Type> eventHandlerCollection = new Dictionary<Type, Type>(); private Dictionary<Type, Type> eventHandlerCollection = new Dictionary<Type, Type>();
private Type eventHandlerParent = typeof(LuaEventHandler); private Type eventHandlerParent = typeof(LuaEventHandler);
private Type delegateParent = typeof(LuaDelegate); private Type delegateParent = typeof(LuaDelegate);
...@@ -36,7 +36,7 @@ namespace NLua ...@@ -36,7 +36,7 @@ namespace NLua
#if NETCOREAPP #if NETCOREAPP
newAssembly = AssemblyBuilder.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run); newAssembly = AssemblyBuilder.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run);
newModule = newAssembly.DefineDynamicModule("NLua_generatedcode"); newModule = newAssembly.DefineDynamicModule("NLua_generatedcode");
#elif !(__IOS__ || __TVOS__ || __WATCHOS__) && !NETSTANDARD #elif !NETSTANDARD
newAssembly = Thread.GetDomain().DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run); newAssembly = Thread.GetDomain().DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run);
newModule = newAssembly.DefineDynamicModule("NLua_generatedcode"); newModule = newAssembly.DefineDynamicModule("NLua_generatedcode");
#endif #endif
...@@ -52,9 +52,7 @@ namespace NLua ...@@ -52,9 +52,7 @@ namespace NLua
*/ */
private Type GenerateEvent(Type eventHandlerType) private Type GenerateEvent(Type eventHandlerType)
{ {
#if __IOS__ || __TVOS__ || __WATCHOS__ #if NETSTANDARD
throw new NotImplementedException (" Emit not available on Xamarin.iOS ");
#elif NETSTANDARD
throw new NotImplementedException(" Emit not available on .NET Standard "); throw new NotImplementedException(" Emit not available on .NET Standard ");
#else #else
string typeName; string typeName;
...@@ -95,9 +93,7 @@ namespace NLua ...@@ -95,9 +93,7 @@ namespace NLua
*/ */
private Type GenerateDelegate(Type delegateType) private Type GenerateDelegate(Type delegateType)
{ {
#if __IOS__ || __TVOS__ || __WATCHOS__ #if NETSTANDARD
throw new NotImplementedException ("GenerateDelegate is not available on iOS, please register your LuaDelegate type with Lua.RegisterLuaDelegateType( yourDelegate, theLuaDelegateHandler) ");
#elif NETSTANDARD
throw new NotImplementedException("GenerateDelegate is not available on Windows Store, please register your LuaDelegate type with Lua.RegisterLuaDelegateType( yourDelegate, theLuaDelegateHandler) "); throw new NotImplementedException("GenerateDelegate is not available on Windows Store, please register your LuaDelegate type with Lua.RegisterLuaDelegateType( yourDelegate, theLuaDelegateHandler) ");
#else #else
string typeName; string typeName;
...@@ -301,9 +297,8 @@ namespace NLua ...@@ -301,9 +297,8 @@ namespace NLua
*/ */
public void GenerateClass(Type klass, out Type newType, out Type[][] returnTypes) public void GenerateClass(Type klass, out Type newType, out Type[][] returnTypes)
{ {
#if __IOS__ || __TVOS__ || __WATCHOS__
throw new NotImplementedException (" Emit not available on Xamarin.iOS "); #if NETSTANDARD
#elif NETSTANDARD
throw new NotImplementedException (" Emit not available on .NET Standard "); throw new NotImplementedException (" Emit not available on .NET Standard ");
#else #else
string typeName; string typeName;
...@@ -415,7 +410,7 @@ namespace NLua ...@@ -415,7 +410,7 @@ namespace NLua
returnTypes = returnTypesList.ToArray(); returnTypes = returnTypesList.ToArray();
} }
#if !(__IOS__ || __TVOS__ || __WATCHOS__) && !NETSTANDARD #if !NETSTANDARD
/* /*
* Generates an overriden implementation of method inside myType that delegates * Generates an overriden implementation of method inside myType that delegates
...@@ -664,9 +659,7 @@ namespace NLua ...@@ -664,9 +659,7 @@ namespace NLua
*/ */
public LuaEventHandler GetEvent(Type eventHandlerType, LuaFunction eventHandler) public LuaEventHandler GetEvent(Type eventHandlerType, LuaFunction eventHandler)
{ {
#if __IOS__ || __TVOS__ || __WATCHOS__ #if NETSTANDARD
throw new NotImplementedException (" Emit not available on Xamarin.iOS ");
#elif NETSTANDARD
throw new NotImplementedException (" Emit not available on .NET Standard "); throw new NotImplementedException (" Emit not available on .NET Standard ");
#else #else
Type eventConsumerType; Type eventConsumerType;
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<DeviceSpecificBuild>false</DeviceSpecificBuild> <DeviceSpecificBuild>false</DeviceSpecificBuild>
<MtouchVerbosity> <MtouchVerbosity>
</MtouchVerbosity> </MtouchVerbosity>
<MtouchExtraArgs>--setenv=NUNIT_ENABLE_XML_OUTPUT=true --setenv=NUNIT_SKIP_LOG_HEADER=true</MtouchExtraArgs> <MtouchExtraArgs>--setenv=NUNIT_ENABLE_XML_OUTPUT=true --setenv=NUNIT_SKIP_LOG_HEADER=true --enable-repl --nolink</MtouchExtraArgs>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler> <MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
<MtouchVerbosity> <MtouchVerbosity>
</MtouchVerbosity> </MtouchVerbosity>
<MtouchExtraArgs>--setenv=NUNIT_ENABLE_XML_OUTPUT=true --setenv=NUNIT_SKIP_LOG_HEADER=true</MtouchExtraArgs> <MtouchExtraArgs>--setenv=NUNIT_ENABLE_XML_OUTPUT=true --setenv=NUNIT_SKIP_LOG_HEADER=true --interpreter</MtouchExtraArgs>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment