Skip to content

Commit 9e91a73

Browse files
committed
Restore Xamarin build settings.
.NET Standard 2.0 caused some dependency related error when we built iOS project. This commit also refactor build script to use feature flags in build script too.
1 parent b53290e commit 9e91a73

13 files changed

Lines changed: 150 additions & 110 deletions

MsgPack.Common.props

Lines changed: 50 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -36,61 +36,73 @@
3636
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
3737
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
3838
</PropertyGroup>
39-
<PropertyGroup Condition="'$(TargetFramework)' == 'MonoAndroid10' or '$(TargetFramework)' == 'Xamarin.iOS10'">
39+
40+
<!-- Extra base properties for targets -->
41+
<PropertyGroup Condition="'$(TargetFramework)' == 'monoandroid10' or '$(TargetFramework)' == 'xamarin.ios10'">
42+
<DefineConstants>$(DefineConstants);__MOBILE__;AOT;XAMARIN</DefineConstants>
43+
<TargetFrameworkRootPath Condition="'$(VsInstallRoot)' != ''">$(VsInstallRoot)\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\</TargetFrameworkRootPath>
44+
<ImplicitlyExpandDesignTimeFacades>true</ImplicitlyExpandDesignTimeFacades>
4045
<SignAssembly>false</SignAssembly>
46+
<IsXamarin>true</IsXamarin>
4147
</PropertyGroup>
42-
<PropertyGroup Condition="'$(OutputPath)' == '' and '$(TargetFramework)' == ''">
43-
<DocumentationFile>$(AssemblyName).XML</DocumentationFile>
48+
<PropertyGroup Condition="$(TargetFramework.StartsWith('net3')) or $(TargetFramework.StartsWith('net4'))">
49+
<IsNetFramework>true</IsNetFramework>
4450
</PropertyGroup>
45-
<PropertyGroup Condition="'$(OutputPath)' != '' or '$(TargetFramework)' != ''">
46-
<DocumentationFile>$(OutputPath)\$(TargetFramework)\$(AssemblyName).XML</DocumentationFile>
51+
<PropertyGroup Condition="'$(TargetFramework)' == 'monoandroid10'">
52+
<DefineConstants>$(DefineConstants);__ANDROID__</DefineConstants>
53+
<TargetFrameworkIdentifier>MonoAndroid</TargetFrameworkIdentifier>
54+
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
4755
</PropertyGroup>
48-
<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0'">
49-
<DebugType>pdbonly</DebugType>
50-
<DefineConstants>$(DefineConstants);FEATURE_TAP;FEATURE_CONCURRENT</DefineConstants>
56+
<PropertyGroup Condition="'$(TargetFramework)' == 'xamarin.ios10'">
57+
<DefineConstants>$(DefineConstants);__IOS__</DefineConstants>
58+
<TargetFrameworkIdentifier>Xamarin.iOS</TargetFrameworkIdentifier>
59+
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
5160
</PropertyGroup>
52-
<PropertyGroup Condition="'$(TargetFramework)' == 'net35'">
53-
<DebugType>pdbonly</DebugType>
54-
<DefineConstants>$(DefineConstants);FEATURE_POINTER_CONVERSION</DefineConstants>
61+
<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0'">
62+
<DefineConstants>$(DefineConstants);NETFX_CORE;WINDOWS_UWP;NETSTANDARD1_3;AOT</DefineConstants>
5563
</PropertyGroup>
56-
<PropertyGroup Condition="'$(TargetFramework)' == 'net45'">
57-
<DebugType>pdbonly</DebugType>
58-
<DefineConstants>$(DefineConstants);FEATURE_TAP;FEATURE_CONCURRENT;FEATURE_POINTER_CONVERSION</DefineConstants>
64+
65+
<!-- Document XML -->
66+
<PropertyGroup Condition="'$(OutputPath)' == '' and '$(TargetFramework)' == ''">
67+
<DocumentationFile>$(AssemblyName).XML</DocumentationFile>
5968
</PropertyGroup>
60-
<PropertyGroup Condition="'$(TargetFramework)' == 'net46'">
61-
<DebugType>pdbonly</DebugType>
62-
<DefineConstants>$(DefineConstants);FEATURE_TAP;FEATURE_CONCURRENT;FEATURE_POINTER_CONVERSION;FEATURE_MEMCOPY</DefineConstants>
69+
<PropertyGroup Condition="'$(OutputPath)' != '' or '$(TargetFramework)' != ''">
70+
<DocumentationFile>$(OutputPath)\$(TargetFramework)\$(AssemblyName).XML</DocumentationFile>
6371
</PropertyGroup>
64-
<PropertyGroup Condition="'$(TargetFramework)' == 'net47'">
72+
73+
<!-- Debug settings -->
74+
<PropertyGroup Condition="'$(IsNetFramework)' == 'true' or '$(TargetFramework)' == 'uap10.0'">
6575
<DebugType>pdbonly</DebugType>
66-
<DefineConstants>$(DefineConstants);FEATURE_TAP;FEATURE_CONCURRENT;FEATURE_POINTER_CONVERSION;FEATURE_MEMCOPY</DefineConstants>
6776
</PropertyGroup>
68-
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard1.1'">
69-
<DefineConstants>$(DefineConstants);FEATURE_TAP;FEATURE_CONCURRENT</DefineConstants>
77+
78+
<!-- Feature Flags -->
79+
<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0' or $(TargetFramework.StartsWith('net4')) or $(TargetFramework.StartsWith('netcoreapp')) or $(TargetFramework.StartsWith('netstandard')) or '$(IsXamarin)' == 'true'">
80+
<DefineConstants>$(DefineConstants);FEATURE_TAP</DefineConstants>
81+
<FeatureTap>true</FeatureTap>
7082
</PropertyGroup>
71-
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard1.3' or '$(TargetFramework)' == 'netcoreapp1.0'">
72-
<DefineConstants>$(DefineConstants);FEATURE_TAP;FEATURE_CONCURRENT;FEATURE_MEMCOPY</DefineConstants>
83+
<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0' or $(TargetFramework.StartsWith('net4')) or $(TargetFramework.StartsWith('netstandard')) or $(TargetFramework.StartsWith('netcoreapp')) or '$(IsXamarin)' == 'true'">
84+
<DefineConstants>$(DefineConstants);FEATURE_CONCURRENT</DefineConstants>
7385
</PropertyGroup>
74-
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp2.0'">
75-
<DefineConstants>$(DefineConstants);FEATURE_TAP;FEATURE_CONCURRENT;FEATURE_POINTER_CONVERSION;FEATURE_MEMCOPY</DefineConstants>
86+
<PropertyGroup Condition="'$(IsNetFramework)' == 'true' or '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp2.0' or '$(IsXamarin)' == 'true'">
87+
<DefineConstants>$(DefineConstants);FEATURE_POINTER_CONVERSION</DefineConstants>
7688
</PropertyGroup>
77-
<PropertyGroup Condition="'$(TargetFramework)' == 'MonoAndroid10' or '$(TargetFramework)' == 'Xamarin.iOS10'">
78-
<DefineConstants>$(DefineConstants);__MOBILE__;AOT;XAMARIN;FEATURE_TAP;FEATURE_CONCURRENT;FEATURE_POINTER_CONVERSION;FEATURE_MEMCOPY</DefineConstants>
89+
<PropertyGroup Condition="'$(IsNetFramework)' == 'true' or '$(TargetFramework)' == 'netstandard1.3' or '$(TargetFramework)' == 'netstandard2.0' or $(TargetFramework.StartsWith('netcoreapp'))">
90+
<DefineConstants>$(DefineConstants);FEATURE_EMIT</DefineConstants>
91+
<FeatureEmit>true</FeatureEmit>
7992
</PropertyGroup>
80-
<PropertyGroup Condition="'$(TargetFramework)' == 'MonoAndroid10'">
81-
<DefineConstants>$(DefineConstants);__ANDROID__</DefineConstants>
82-
<TargetFrameworkRootPath Condition="'$(VsInstallRoot)' != ''">$(VsInstallRoot)\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\</TargetFrameworkRootPath>
83-
<ImplicitlyExpandDesignTimeFacades>true</ImplicitlyExpandDesignTimeFacades>
93+
<PropertyGroup Condition="'$(IsNetFramework)' == 'true' or '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp2.0'">
94+
<DefineConstants>$(DefineConstants);FEATURE_CODEGEN</DefineConstants>
95+
<FeatureCodeGen>true</FeatureCodeGen>
8496
</PropertyGroup>
85-
<PropertyGroup Condition="'$(TargetFramework)' == 'Xamarin.iOS10'">
86-
<DefineConstants>$(DefineConstants);__IOS__</DefineConstants>
87-
<TargetFrameworkRootPath Condition="'$(VsInstallRoot)' != ''">$(VsInstallRoot)\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\</TargetFrameworkRootPath>
88-
<ImplicitlyExpandDesignTimeFacades>true</ImplicitlyExpandDesignTimeFacades>
97+
<PropertyGroup Condition="'$(IsNetFramework)' == 'true'">
98+
<DefineConstants>$(DefineConstants);FEATURE_ASMGEN</DefineConstants>
99+
<FeatureAsmGen>true</FeatureAsmGen>
89100
</PropertyGroup>
90-
<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0'">
91-
<DefineConstants>$(DefineConstants);NETFX_CORE;WINDOWS_UWP;NETSTANDARD1_3;AOT</DefineConstants>
101+
<PropertyGroup Condition="'$(TargetFramework)' == 'net46' or '$(TargetFramework)' == 'net47' or '$(TargetFramework)' == 'netstandard1.3' or '$(TargetFramework)' == 'netstandard2.0' or $(TargetFramework.StartsWith('netcoreapp')) or '$(IsXamarin)' == 'true'">
102+
<DefineConstants>$(DefineConstants);FEATURE_MEMCOPY</DefineConstants>
92103
</PropertyGroup>
104+
93105
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
94106
<DebugType>full</DebugType>
95107
</PropertyGroup>
96-
</Project>
108+
</Project>

src/MsgPack/MsgPack.csproj

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
44
<ProjectGuid>{5BCEC32E-990E-4DE5-945F-BD27326A7418}</ProjectGuid>
55
<OutputType>Library</OutputType>
66
<AssemblyName>MsgPack</AssemblyName>
7-
<TargetFrameworks>net46;net35;net45;netstandard1.1;netstandard1.3;netstandard2.0;</TargetFrameworks>
7+
<TargetFrameworks>net46;net35;net45;netstandard1.1;netstandard1.3;netstandard2.0;MonoAndroid10;Xamarin.iOS10;</TargetFrameworks>
88
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
99
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
1010
<NuspecFile>$(SolutionDir)/msgpack.nuspec</NuspecFile>
@@ -62,6 +62,10 @@
6262
<PackageReference Include="System.Reflection.Emit" Version="4.3.0" />
6363
<PackageReference Include="System.Reflection.Emit.LightWeight" Version="4.3.0" />
6464
</ItemGroup>
65+
<ItemGroup Condition="'$(IsXamarin)' == 'true'">
66+
<PackageReference Include="NETStandard.Library" Version="2.0.0" />
67+
<PackageReference Include="System.Numerics.Vectors" Version="4.3.0" />
68+
</ItemGroup>
6569
<ItemGroup>
6670
<Compile Include="..\CommonAssemblyInfo.cs">
6771
<Link>Properties\CommonAssemblyInfo.cs</Link>
@@ -417,31 +421,18 @@
417421
</ItemGroup>
418422
<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
419423
<Compile Remove="Serialization\DefaultSerializers\SimdTypeSerializers.cs" />
424+
</ItemGroup>
425+
<ItemGroup Condition="'$(TargetFramework)' == 'net45' or '$(TargetFramework)' == 'netstandard1.1' or '$(TargetFramework)' == 'netstandard1.3'">
420426
<Compile Remove="Serialization\DefaultSerializers\System_Security_Cryptography_HashAlgorithmNameMessagePackSerializer.cs" />
421427
</ItemGroup>
422-
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.1' or '$(TargetFramework)' == 'netstandard1.3' or '$(TargetFramework)' == 'uap10.0'">
423-
<Compile Remove="Serialization\CodeDomSerializers\*.*" />
424-
<Compile Remove="Serialization\CodeGenerationSink.cs" />
425-
<Compile Remove="Serialization\DependentAssemblyManager.cs" />
426-
<Compile Remove="Serialization\IndividualFileCodeGenerationSink.cs" />
427-
<Compile Remove="Serialization\ISerializerGeneratorConfiguration.cs" />
428-
<Compile Remove="Serialization\SerializerAssemblyGenerationConfiguration.cs" />
429-
<Compile Remove="Serialization\SerializerCodeGenerationConfiguration.cs" />
430-
<Compile Remove="Serialization\SerializerCodeInformation.cs" />
431-
<Compile Remove="Serialization\SerializerCodeGenerationContext.cs" />
432-
<Compile Remove="Serialization\SerializerCodeGenerationResult.cs" />
433-
<Compile Remove="Serialization\SerializerGenerator.cs" />
434-
<Compile Remove="Serialization\SingleTextWriterCodeGenerationSink.cs" />
435-
<Compile Remove="Serialization\TeeTextWriter.cs" />
428+
<ItemGroup Condition="'$(TargetFramework)' == 'uap10.0'">
429+
<Compile Remove="UnsafeNativeMethods.cs" />
436430
</ItemGroup>
437431
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.1' or '$(TargetFramework)' == 'netstandard1.3' or '$(TargetFramework)' == 'uap10.0'">
438432
<Compile Include="BufferedStream.cs" />
439433
<Compile Include="NetStandardCompatibility.cs" />
440434
</ItemGroup>
441-
<ItemGroup Condition="'$(TargetFramework)' == 'uap10.0'">
442-
<Compile Remove="UnsafeNativeMethods.cs" />
443-
</ItemGroup>
444-
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.1' or '$(TargetFramework)' == 'uap10.0'">
435+
<ItemGroup Condition="'$(FeatureEmit)' != 'true'">
445436
<Compile Remove="Serialization\AbstractSerializers\**\*.*" />
446437
<Compile Remove="Serialization\DefaultSerializers\System_Security_Cryptography_HashAlgorithmNameMessagePackSerializer.cs" />
447438
<Compile Remove="Serialization\EmittingSerializers\**\*.*" />
@@ -466,13 +457,27 @@
466457
<Compile Remove="Serialization\ReflectionExtensions.ConstructorDelegate.cs" />
467458
<Compile Remove="Serialization\NullTextWriter.cs" />
468459
</ItemGroup>
469-
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
460+
<ItemGroup Condition="'$(FeatureCodeGen)' != 'true'">
470461
<Compile Remove="Serialization\AbstractSerializers\ISerializerCodeGenerator.cs" />
471462
<Compile Remove="Serialization\AbstractSerializers\ISerializerCodeGenerationContext.cs" />
463+
<Compile Remove="Serialization\CodeDomSerializers\*.*" />
464+
<Compile Remove="Serialization\CodeGenerationSink.cs" />
465+
<Compile Remove="Serialization\DependentAssemblyManager.cs" />
466+
<Compile Remove="Serialization\IndividualFileCodeGenerationSink.cs" />
467+
<Compile Remove="Serialization\ISerializerGeneratorConfiguration.cs" />
468+
<Compile Remove="Serialization\SerializerAssemblyGenerationConfiguration.cs" />
469+
<Compile Remove="Serialization\SerializerCodeGenerationConfiguration.cs" />
470+
<Compile Remove="Serialization\SerializerCodeInformation.cs" />
471+
<Compile Remove="Serialization\SerializerCodeGenerationContext.cs" />
472+
<Compile Remove="Serialization\SerializerCodeGenerationResult.cs" />
473+
<Compile Remove="Serialization\SerializerGenerator.cs" />
474+
<Compile Remove="Serialization\SingleTextWriterCodeGenerationSink.cs" />
475+
<Compile Remove="Serialization\TeeTextWriter.cs" />
476+
</ItemGroup>
477+
<ItemGroup Condition="'$(FeatureAsmGen)' != 'true'">
472478
<Compile Remove="Serialization\EmittingSerializers\AssemblyBuilderCodeGenerationContext.cs" />
473-
<Compile Remove="Serialization\DefaultSerializers\System_Security_Cryptography_HashAlgorithmNameMessagePackSerializer.cs" />
474479
</ItemGroup>
475-
<ItemGroup Condition="'$(TargetFramework)' == 'net45' or '$(TargetFramework)' == 'net46' or '$(TargetFramework)' == 'netstandard1.1' or '$(TargetFramework)' == 'netstandard1.3' or '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'uap10.0'">
480+
<ItemGroup Condition="'$(FeatureTap)' == 'true'">
476481
<Compile Include="AsyncReadResult.cs" />
477482
<Compile Include="AsyncReadResult`1.cs" />
478483
<Compile Include="TaskAugument.cs" />
@@ -485,4 +490,4 @@
485490
<!-- For VS, use $(MSBuildExtensionsPath) -->
486491
<VSMSBuildExtensionsPath>$(MSBuildExtensionsPath)</VSMSBuildExtensionsPath>
487492
</PropertyGroup>
488-
</Project>
493+
</Project>

src/MsgPack/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
[assembly: InternalsVisibleTo( "MsgPack.UnitTest.CodeDom.Net35, PublicKey=0024000004800000940000000602000000240000525341310004000001000100a967de8de9d45380b93a6aa56f64fc2cb2d3c9d4b400e00de01f31ba9e15cf5ca95926dbf8760cce413eabd711e23df0c133193a570da8a3bb1bdc00ef170fccb2bc033266fa5346442c9cf0b071133d5b484845eab17095652aeafeeb71193506b8294d9c8c91e3fd01cc50bdbc2d0eb78dd655bb8cd0bd3cdbbcb192549cb4" )]
5959
#endif // NET35
6060
[assembly: InternalsVisibleTo( "MsgPack.UnitTest.BclExtensions, PublicKey=0024000004800000940000000602000000240000525341310004000001000100a967de8de9d45380b93a6aa56f64fc2cb2d3c9d4b400e00de01f31ba9e15cf5ca95926dbf8760cce413eabd711e23df0c133193a570da8a3bb1bdc00ef170fccb2bc033266fa5346442c9cf0b071133d5b484845eab17095652aeafeeb71193506b8294d9c8c91e3fd01cc50bdbc2d0eb78dd655bb8cd0bd3cdbbcb192549cb4" )]
61-
#if NETSTANDARD1_3 || NETSTANDARD2_0
61+
#if NETSTANDARD1_3 || NETSTANDARD2_0 || XAMARIN
6262
[assembly:InternalsVisibleTo( "MsgPack.UnitTest.Xamarin.Android, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100a967de8de9d45380b93a6aa56f64fc2cb2d3c9d4b400e00de01f31ba9e15cf5ca95926dbf8760cce413eabd711e23df0c133193a570da8a3bb1bdc00ef170fccb2bc033266fa5346442c9cf0b071133d5b484845eab17095652aeafeeb71193506b8294d9c8c91e3fd01cc50bdbc2d0eb78dd655bb8cd0bd3cdbbcb192549cb4" )]
6363
[assembly:InternalsVisibleTo( "MsgPackUnitTestXamariniOS, PublicKey=0024000004800000940000000602000000240000525341310004000001000100a967de8de9d45380b93a6aa56f64fc2cb2d3c9d4b400e00de01f31ba9e15cf5ca95926dbf8760cce413eabd711e23df0c133193a570da8a3bb1bdc00ef170fccb2bc033266fa5346442c9cf0b071133d5b484845eab17095652aeafeeb71193506b8294d9c8c91e3fd01cc50bdbc2d0eb78dd655bb8cd0bd3cdbbcb192549cb4" )]
6464
#endif // NETSTANDARD1_3 || NETSTANDARD2_0

src/MsgPack/Serialization/AbstractSerializers/SerializerBuilder`2.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#region -- License Terms --
1+
#region -- License Terms --
22
//
33
// MessagePack for CLI
44
//
@@ -35,9 +35,9 @@ namespace MsgPack.Serialization.AbstractSerializers
3535
/// <typeparam name="TContext">The type of the context which holds global information for generating serializer.</typeparam>
3636
/// <typeparam name="TConstruct">The type of the construct which abstracts code constructs.</typeparam>
3737
internal abstract partial class SerializerBuilder<TContext, TConstruct> :
38-
#if !SILVERLIGHT && !NETSTANDARD1_1 && !NETSTANDARD1_3
38+
#if FEATURE_CODEGEN
3939
ISerializerCodeGenerator,
40-
#endif // !SILVERLIGHT && !NETSTANDARD1_1 && !NETSTANDARD1_3
40+
#endif // FEATURE_CODEGEN
4141
ISerializerBuilder
4242
where TContext : SerializerGenerationContext<TConstruct>
4343
where TConstruct : class, ICodeConstruct
@@ -319,7 +319,7 @@ TContext codeGenerationContext
319319
);
320320

321321

322-
#if !SILVERLIGHT && !NETSTANDARD1_1 && !NETSTANDARD1_3
322+
#if FEATURE_CODEGEN
323323
/// <summary>
324324
/// Builds the serializer code using specified code generation context.
325325
/// </summary>
@@ -361,7 +361,7 @@ protected virtual void BuildSerializerCodeCore( ISerializerCodeGenerationContext
361361
throw new NotSupportedException();
362362
}
363363

364-
#endif // !SILVERLIGHT && !NETSTANDARD1_1 && !NETSTANDARD1_3
364+
#endif // FEATURE_CODEGEN
365365

366366
internal class SerializerBuilderNilImplicationHandler :
367367
NilImplicationHandler<TConstruct, TConstruct, SerializerBuilderOnPackingParameter, SerializerBuilderOnUnpacedParameter>
@@ -532,4 +532,4 @@ TConstruct store
532532
}
533533
}
534534
}
535-
}
535+
}

src/MsgPack/Serialization/EmittingSerializers/AssemblyBuilderSerializerBuilder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,7 @@ out serializerTypeNamespace
11441144
);
11451145
}
11461146

1147-
#if !SILVERLIGHT && !NETSTANDARD1_1 && !NETSTANDARD1_3
1147+
#if FEATURE_ASMGEN
11481148

11491149
protected override void BuildSerializerCodeCore( ISerializerCodeGenerationContext context, Type concreteType, PolymorphismSchema itemSchema )
11501150
{
@@ -1179,7 +1179,7 @@ protected override void BuildSerializerCodeCore( ISerializerCodeGenerationContex
11791179
}
11801180
}
11811181

1182-
#endif // !SILVERLIGHT && !NETSTANDARD1_1 && !NETSTANDARD1_3
1182+
#endif // FEATURE_ASMGEN
11831183

11841184
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Design", "CA1062:ValidateArgumentsOfPublicMethods", MessageId = "1", Justification = "Validated internally" )]
11851185
protected override ILConstruct EmitNewPrivateMethodDelegateExpression( AssemblyBuilderEmittingContext context, MethodDefinition method )
@@ -1209,4 +1209,4 @@ protected override ILConstruct EmitNewPrivateMethodDelegateExpression( AssemblyB
12091209
);
12101210
}
12111211
}
1212-
}
1212+
}

src/MsgPack/Serialization/MessagePackSerializer.Factories.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@
2525
#define UNITY
2626
#endif
2727

28-
#if !UNITY && !SILVERLIGHT && !NETSTANDARD1_1 && !WINDOWS_PHONE && !WINDOWS_UWP
29-
#define FEATURE_EMIT
30-
#endif // !UNITY && !SILVERLIGHT && !NETSTANDARD1_1 && !WINDOWS_PHONE && !WINDOWS_UWP
31-
3228
using System;
3329
using System.IO;
3430
using System.Globalization;
@@ -215,15 +211,15 @@ internal static MessagePackSerializer<T> CreateInternal<T>( SerializationContext
215211
Contract.Ensures( Contract.Result<MessagePackSerializer<T>>() != null );
216212
#endif // DEBUG
217213

218-
#if DEBUG && !UNITY && !SILVERLIGHT && !NETSTANDARD1_1 && !WINDOWS_UWP
214+
#if DEBUG && FEATURE_EMIT
219215
SerializerDebugging.TraceEmitEvent(
220216
"SerializationContext::CreateInternal<{0}>(@{1}, {2})",
221217
typeof( T ),
222218
context.GetHashCode(),
223219
schema == null ? "null" : schema.DebugString
224220
);
225221

226-
#endif // DEBUG && !UNITY && !SILVERLIGHT && !NETSTANDARD1_1 && !WINDOWS_UWP
222+
#endif // DEBUG && FEATURE_EMIT
227223
Type concreteType = null;
228224
CollectionTraits collectionTraits =
229225
#if UNITY

src/MsgPack/Serialization/SerializationTarget.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -815,12 +815,12 @@ public static string GetTupleItemNameFromIndex( int i )
815815
}
816816
#endif // !NET35
817817

818-
#if !SILVERLIGHT && !UNITY && !NETSTANDARD1_1 && !NETSTANDARD1_3
818+
#if FEATURE_CODEGEN
819819
public static bool BuiltInSerializerExists( ISerializerGeneratorConfiguration configuration, Type type, CollectionTraits traits )
820820
{
821821
return GenericSerializer.IsSupported( type, traits, configuration.PreferReflectionBasedSerializer ) || SerializerRepository.InternalDefault.ContainsFor( type );
822822
}
823-
#endif // !SILVERLIGHT && !UNITY && !NETSTANDARD1_1 && !NETSTANDARD1_3
823+
#endif // FEATURE_CODEGEN
824824

825825
private sealed class MemberConstructorParameterEqualityComparer : EqualityComparer<KeyValuePair<string, Type>>
826826
{

0 commit comments

Comments
 (0)