[csharp] Rename netstandard to netstandard1.3 (#6460)

This commit is contained in:
Jim Schubert 2020-05-29 05:32:52 -04:00 committed by GitHub
parent a64f547c2a
commit cc59367909
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 11 deletions

View File

@ -6,7 +6,7 @@
# C# Petstore API client with PropertyChanged
./bin/csharp-property-changed-petstore.sh
# C# Petstore API client (v5.0 for .net standarnd 1.3+)
# C# Petstore API client (.net standarnd 1.3+)
./bin/csharp-petstore-net-standard.sh
# C# Petstore API client (.NET 4.0)

View File

@ -1,3 +1,3 @@
{
"targetFramework": "v5.0"
"targetFramework": "netstandard1.3"
}

View File

@ -4,7 +4,7 @@ call .\bin\windows\csharp-petstore.bat
REM C# Petstore API client with PropertyChanged
call .\bin\windows\csharp-property-changed-petstore.bat
REM C# Petstore API client (v5.0 for .net standarnd 1.3+)
REM C# Petstore API client (.net standarnd 1.3+)
call .\bin\windows\csharp-petstore-netstandard.bat
call .\bin\windows\csharp-dotnet2-petstore.bat

View File

@ -5,6 +5,6 @@ If Not Exist %executable% (
)
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples\client\petstore\csharp\OpenApiClientNetCoreProject --additional-properties targetFramework=v5.0,packageGuid={67035b31-f8e5-41a4-9673-954035084f7d},netCoreProjectFile=true
set ags=generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples\client\petstore\csharp\OpenApiClientNetCoreProject --additional-properties targetFramework=netstandard1.3,packageGuid={67035b31-f8e5-41a4-9673-954035084f7d},netCoreProjectFile=true
java %JAVA_OPTS% -jar %executable% %ags%

View File

@ -5,6 +5,6 @@ If Not Exist %executable% (
)
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples\client\petstore\csharp\OpenApiClientNetStandard --additional-properties targetFramework=v5.0,packageGuid={3AB1F259-1769-484B-9411-84505FCCBD55}
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples\client\petstore\csharp\OpenApiClientNetStandard --additional-properties targetFramework=netstandard1.3,packageGuid={3AB1F259-1769-484B-9411-84505FCCBD55}
java %JAVA_OPTS% -jar %executable% %ags%

View File

@ -47,10 +47,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
private static final String NET45 = "v4.5";
private static final String NET40 = "v4.0";
private static final String NET35 = "v3.5";
// TODO: v5.0 is PCL, not netstandard version 1.3, and not a specific .NET Framework. This needs to be updated,
// especially because it will conflict with .NET Framework 5.0 when released, and PCL 5 refers to Framework 4.0.
// We should support either NETSTANDARD, PCL, or Both but the concepts shouldn't be mixed.
private static final String NETSTANDARD = "v5.0";
private static final String NETSTANDARD = "netstandard1.3";
private static final String UWP = "uwp";
// Defines the sdk option for targeted frameworks, which differs from targetFramework and targetFrameworkNuget
@ -312,14 +309,12 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
setSupportsAsync(Boolean.FALSE);
} else if (NETSTANDARD.equals(this.targetFramework)) {
LOGGER.warn(".NET Standard 1.3 support has been DEPRECATED in this generator. Please use `csharp-netcore` generator instead.");
// TODO: NETSTANDARD here is misrepresenting a PCL v5.0 which supports .NET Framework 4.6+, .NET Core 1.0, and Windows Universal 10.0
additionalProperties.put(MCS_NET_VERSION_KEY, "4.6-api");
if (additionalProperties.containsKey("supportsUWP")) {
LOGGER.warn(".NET " + NETSTANDARD + " generator does not support UWP.");
additionalProperties.remove("supportsUWP");
}
// TODO: NETSTANDARD=v5.0 and targetFrameworkNuget=netstandard1.3. These need to sync.
setTargetFrameworkNuget("netstandard1.3");
setSupportsAsync(Boolean.TRUE);
setSupportsUWP(Boolean.FALSE);