add support for csharp net40 (#6792)

This commit is contained in:
wing328
2017-10-27 22:47:02 +08:00
committed by GitHub
parent fe2ed67f20
commit cab4fc0fed
162 changed files with 18297 additions and 8 deletions

View File

@@ -15,6 +15,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
@SuppressWarnings({"hiding"})
private static final Logger LOGGER = LoggerFactory.getLogger(CSharpClientCodegen.class);
private static final String NET45 = "v4.5";
private static final String NET40 = "v4.0";
private static final String NET35 = "v3.5";
private static final String NETSTANDARD = "v5.0";
private static final String UWP = "uwp";
@@ -75,6 +76,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
);
frameworks = new ImmutableMap.Builder<String, String>()
.put(NET35, ".NET Framework 3.5 compatible")
.put(NET40, ".NET Framework 4.0 compatible")
.put(NET45, ".NET Framework 4.5+ compatible")
.put(NETSTANDARD, ".NET Standard 1.3 compatible")
.put(UWP, "Universal Windows Platform (IMPORTANT: this will be decommissioned and replaced by v5.0)")
@@ -227,7 +229,13 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
setSupportsUWP(Boolean.TRUE);
additionalProperties.put("supportsAsync", this.supportsAsync);
additionalProperties.put("supportsUWP", this.supportsUWP);
} else if (NET40.equals(this.targetFramework)) {
setTargetFrameworkNuget("net40");
setSupportsAsync(Boolean.FALSE);
if (additionalProperties.containsKey("supportsAsync")) {
additionalProperties.remove("supportsAsync");
}
additionalProperties.put("isNet40", true);
} else {
setTargetFrameworkNuget("net45");
setSupportsAsync(Boolean.TRUE);