ソースを参照

Add comment to summarize project
Set lang version to C# 3.0
Add .NET Standard 2.0 target
Fix partial diagnostic string since it requires C# 6

Sydney Acksman 6 年 前
コミット
2bb49712aa

+ 1 - 1
csharp/src/Google.Protobuf.Test.CodeGen/ForeignMessagePartial.cs

@@ -39,7 +39,7 @@ namespace Google.Protobuf.TestProtos
     {
         public string ToDiagnosticString()
         {
-            return $"{{ \"c\": {C}, \"@cInHex\": \"{C:x}\" }}";
+            return string.Format("{{ \"c\": {0}, \"@cInHex\": \"{0:x}\" }}", C);
         }
     }
 }

+ 7 - 1
csharp/src/Google.Protobuf.Test.CodeGen/Google.Protobuf.Test.CodeGen.csproj

@@ -1,7 +1,13 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
+  <!--
+    This CodeGen project is kept seperate from the original test project for many reasons.
+    It allows us to make sure code can compile on a seperate compiler version, different frameworks,
+    and without the internal visibility from the test project (all of which have caused issues in the past).
+  -->
   <PropertyGroup>
-    <TargetFrameworks>net451;netstandard1.0</TargetFrameworks>
+    <TargetFrameworks>net451;netstandard1.0;netstandard2.0</TargetFrameworks>
+    <LangVersion>3.0</LangVersion>
     <AssemblyOriginatorKeyFile>../../keys/Google.Protobuf.snk</AssemblyOriginatorKeyFile>
     <SignAssembly>true</SignAssembly>
     <PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>