protobuf-net.csproj 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <Project Sdk="MSBuild.Sdk.Extras">
  2. <PropertyGroup>
  3. <AssemblyName>protobuf-net</AssemblyName>
  4. <Title>protobuf-net</Title>
  5. <Description>Provides simple access to fast and efficient "Protocol Buffers" serialization from .NET applications</Description>
  6. <TargetFrameworks>net20;net35;net452;netstandard2.0;netcoreapp3.1</TargetFrameworks>
  7. <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
  8. <DefineConstants>EMIT_ASSEMBLY_INFO</DefineConstants>
  9. <!-- new build tools spit these out -->
  10. <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
  11. <!-- this is how we will configure the builds relatively cleanly -->
  12. <ImportLibs>net</ImportLibs>
  13. <FeatureCompiler>true</FeatureCompiler>
  14. <FeatureServiceModel>true</FeatureServiceModel>
  15. <FeatureServiceModelConfiguration>true</FeatureServiceModelConfiguration>
  16. <PlatformXmlSerializer>true</PlatformXmlSerializer>
  17. <PlatformBinaryFormatter>true</PlatformBinaryFormatter>
  18. <Configurations>Debug;Release;VS</Configurations>
  19. </PropertyGroup>
  20. <!-- define configuration per-platform -->
  21. <PropertyGroup Condition="'$(TargetFramework)' == 'net20'">
  22. <FeatureServiceModel>false</FeatureServiceModel>
  23. </PropertyGroup>
  24. <PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0'">
  25. <FeatureServiceModel>false</FeatureServiceModel>
  26. <FeatureServiceModelConfiguration>false</FeatureServiceModelConfiguration>
  27. <FeatureCompiler>false</FeatureCompiler>
  28. <PlatformBinaryFormatter>false</PlatformBinaryFormatter>
  29. <DefineConstants>$(DefineConstants);COREFX;UAP</DefineConstants>
  30. </PropertyGroup>
  31. <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
  32. <DefineConstants>$(DefineConstants);COREFX</DefineConstants>
  33. <ImportLibs>standard</ImportLibs>
  34. <FeatureServiceModel>true</FeatureServiceModel>
  35. <FeatureServiceModelConfiguration>false</FeatureServiceModelConfiguration>
  36. </PropertyGroup>
  37. <PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
  38. <DefineConstants>$(DefineConstants);COREFX</DefineConstants>
  39. <ImportLibs>none</ImportLibs>
  40. <FeatureServiceModel>true</FeatureServiceModel>
  41. <FeatureServiceModelConfiguration>false</FeatureServiceModelConfiguration>
  42. </PropertyGroup>
  43. <!-- apply the configuration options (typical via defines that switch code flows) -->
  44. <PropertyGroup Condition="'$(FeatureCompiler)' == 'true'">
  45. <DefineConstants>$(DefineConstants);FEAT_COMPILER</DefineConstants>
  46. </PropertyGroup>
  47. <PropertyGroup Condition="'$(FeatureServiceModel)' == 'true'">
  48. <DefineConstants>$(DefineConstants);FEAT_SERVICEMODEL</DefineConstants>
  49. </PropertyGroup>
  50. <PropertyGroup Condition="'$(FeatureServiceModelConfiguration)' == 'true'">
  51. <DefineConstants>$(DefineConstants);FEAT_SERVICECONFIGMODEL</DefineConstants>
  52. </PropertyGroup>
  53. <PropertyGroup Condition="'$(PlatformXmlSerializer)' == 'true'">
  54. <DefineConstants>$(DefineConstants);PLAT_XMLSERIALIZER</DefineConstants>
  55. </PropertyGroup>
  56. <PropertyGroup Condition="'$(PlatformBinaryFormatter)' == 'true'">
  57. <DefineConstants>$(DefineConstants);PLAT_BINARYFORMATTER</DefineConstants>
  58. </PropertyGroup>
  59. <ItemGroup Condition="'$(ImportLibs)|$(FeatureServiceModel)' == 'net|true'">
  60. <Reference Include="System.ServiceModel" />
  61. <Reference Include="System.Configuration" />
  62. <Reference Include="System.Runtime.Serialization" />
  63. </ItemGroup>
  64. <ItemGroup Condition="'$(ImportLibs)' == 'standard' and '$(FeatureCompiler)' == 'true'">
  65. <PackageReference Include="System.Reflection.Emit" Version="4.3.0" />
  66. <PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.3.0" />
  67. </ItemGroup>
  68. <ItemGroup Condition="'$(ImportLibs)' == 'none' and '$(FeatureServiceModel)' == 'true'">
  69. <PackageReference Include="System.ServiceModel.Primitives" Version="4.5.3" />
  70. </ItemGroup>
  71. <ItemGroup Condition="'$(ImportLibs)' == 'standard' and '$(FeatureServiceModel)' == 'true'">
  72. <PackageReference Include="System.ServiceModel.Primitives" Version="4.5.3" />
  73. </ItemGroup>
  74. <ItemGroup Condition="'$(ImportLibs)' == 'standard'">
  75. <PackageReference Include="System.Reflection.TypeExtensions" Version="4.4.0" />
  76. <PackageReference Include="System.Xml.XmlSerializer" Version="4.3.0" />
  77. </ItemGroup>
  78. <ItemGroup>
  79. <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2">
  80. <PrivateAssets>all</PrivateAssets>
  81. <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
  82. </PackageReference>
  83. </ItemGroup>
  84. </Project>