Browse Source

add support for C# 8 build

Oren Novotny 6 years ago
parent
commit
71c561f165
2 changed files with 5 additions and 0 deletions
  1. 1 0
      Ix.NET/Source/Directory.build.props
  2. 4 0
      Ix.NET/Source/Directory.build.targets

+ 1 - 0
Ix.NET/Source/Directory.build.props

@@ -17,6 +17,7 @@
     <EmbedUntrackedSources>true</EmbedUntrackedSources>
     <PublishRepositoryUrl>true</PublishRepositoryUrl>
     <LangVersion>latest</LangVersion>
+    <BuildForCSharp8 Condition="'$(BuildForCSharp8)' == ''">true</BuildForCSharp8>
   </PropertyGroup>
 
   <!-- Hack needed to make code coverage work. See https://github.com/Microsoft/vstest/issues/1748. -->

+ 4 - 0
Ix.NET/Source/Directory.build.targets

@@ -11,6 +11,10 @@
     <DefineConstants>$(DefineConstants);NO_ARRAY_EMPTY;NO_TASK_FROMEXCEPTION</DefineConstants>
   </PropertyGroup>
 
+  <PropertyGroup Condition="'$(BuildForCSharp8)' == 'true'">
+    <DefineConstants>$(DefineConstants);CSHARP8</DefineConstants>
+  </PropertyGroup>
+  
   <PropertyGroup>
     <Product>$(AssemblyName) ($(TargetFramework))</Product>
   </PropertyGroup>