diff --git a/src/ClientApp/src/components/Home.js b/src/ClientApp/src/components/Home.js index e2d3651..7cb6936 100644 --- a/src/ClientApp/src/components/Home.js +++ b/src/ClientApp/src/components/Home.js @@ -68,7 +68,7 @@ export class Home extends Component { //if (name === "templateType") { // this.setState({ level2SelectorType: selectedValue === ".NET Templates" ? "net" : "steeltoe"}) //} - if (name == "targetFrameworkVersion" && selectedValue == "netcoreapp3.0" && this.state.steeltoeVersion == "2.3.0") { + if (name == "targetFrameworkVersion" && selectedValue == "netcoreapp3.1" && this.state.steeltoeVersion == "2.3.0") { this.setState({ "steeltoeVersion": "2.4.0", [name]: selectedValue @@ -98,7 +98,7 @@ export class Home extends Component { e.target.setCustomValidity("")} onInvalid={(e) => e.target.setCustomValidity("ProjectName must be a valid C# Identifier: ex. MyCompany.MyProject")} />
- +
diff --git a/src/Models/GeneratorModel.cs b/src/Models/GeneratorModel.cs index 00e0fca..5c32b3e 100644 --- a/src/Models/GeneratorModel.cs +++ b/src/Models/GeneratorModel.cs @@ -51,7 +51,7 @@ namespace Steeltoe.Initializr.Models { if (_templateVersion == null) { - return TargetFrameworkVersion == "netcoreapp3.0" ? TemplateVersion.V3 : TemplateVersion.V2; + return TargetFrameworkVersion == "netcoreapp3.1" ? TemplateVersion.V3 : TemplateVersion.V2; } return _templateVersion.Value; diff --git a/templates/DotNetTemplating/2.x/CSharp-React/.template.config/template.json b/templates/DotNetTemplating/2.x/CSharp-React/.template.config/template.json index 95e951f..d307a1a 100644 --- a/templates/DotNetTemplating/2.x/CSharp-React/.template.config/template.json +++ b/templates/DotNetTemplating/2.x/CSharp-React/.template.config/template.json @@ -124,7 +124,7 @@ "description": "Target netcoreapp2.1" } ], - "replaces": "netcoreapp2.2", + "replaces": "targetframeworkversion", "defaultValue": "netcoreapp2.2" }, "AspNetCoreVersion": { diff --git a/templates/DotNetTemplating/2.x/CSharp-React/Company.WebApplication1.csproj b/templates/DotNetTemplating/2.x/CSharp-React/Company.WebApplication1.csproj index 957658c..9f74176 100644 --- a/templates/DotNetTemplating/2.x/CSharp-React/Company.WebApplication1.csproj +++ b/templates/DotNetTemplating/2.x/CSharp-React/Company.WebApplication1.csproj @@ -1,7 +1,7 @@ - netcoreapp2.2 + targetframeworkversion TargetFrameworkOverride true Latest diff --git a/templates/DotNetTemplating/2.x/CSharp-WebApi/.template.config/template.json b/templates/DotNetTemplating/2.x/CSharp-WebApi/.template.config/template.json index 3dc2c49..0ad9fe0 100644 --- a/templates/DotNetTemplating/2.x/CSharp-WebApi/.template.config/template.json +++ b/templates/DotNetTemplating/2.x/CSharp-WebApi/.template.config/template.json @@ -248,7 +248,7 @@ "description": "Target netcoreapp2.1" } ], - "replaces": "netcoreapp2.2", + "replaces": "targetframeworkversion", "defaultValue": "netcoreapp2.2" }, "AspNetCoreVersion": { diff --git a/templates/DotNetTemplating/2.x/CSharp-WebApi/Company.WebApplication1.csproj b/templates/DotNetTemplating/2.x/CSharp-WebApi/Company.WebApplication1.csproj index 60698ea..f1ee8b8 100644 --- a/templates/DotNetTemplating/2.x/CSharp-WebApi/Company.WebApplication1.csproj +++ b/templates/DotNetTemplating/2.x/CSharp-WebApi/Company.WebApplication1.csproj @@ -1,7 +1,7 @@ - netcoreapp2.2 + targetframeworkversion aspnet-Company.WebApplication1-53bc9b9d-9d6a-45d4-8429-2a2761773502 0 1 diff --git a/templates/DotNetTemplating/3.0/CSharp-React/.template.config/template.json b/templates/DotNetTemplating/3.0/CSharp-React/.template.config/template.json index dbae431..662edd3 100644 --- a/templates/DotNetTemplating/3.0/CSharp-React/.template.config/template.json +++ b/templates/DotNetTemplating/3.0/CSharp-React/.template.config/template.json @@ -115,13 +115,17 @@ "description": "The target framework for the project.", "datatype": "choice", "choices": [ + { + "choice": "netcoreapp3.1", + "description": "Target netcoreapp3.1" + }, { "choice": "netcoreapp3.0", "description": "Target netcoreapp3.0" } ], - "replaces": "netcoreapp3.0", - "defaultValue": "netcoreapp3.0" + "replaces": "targetframeworkversion", + "defaultValue": "netcoreapp3.1" }, "AspNetCoreVersion": { "type": "generated", @@ -131,9 +135,13 @@ "evaluator": "C++", "datatype": "string", "cases": [ + { + "condition": "(Framework == 'netcoreapp3.1')", + "value": "3.1.0" + }, { "condition": "(Framework == 'netcoreapp3.0')", - "value": "3.0.0-preview8.19405.11" + "value": "3.1.0" } ] } diff --git a/templates/DotNetTemplating/3.0/CSharp-React/Company.WebApplication1.csproj b/templates/DotNetTemplating/3.0/CSharp-React/Company.WebApplication1.csproj index 437a8f8..d2ee404 100644 --- a/templates/DotNetTemplating/3.0/CSharp-React/Company.WebApplication1.csproj +++ b/templates/DotNetTemplating/3.0/CSharp-React/Company.WebApplication1.csproj @@ -1,7 +1,7 @@ - netcoreapp3.0 + targetframeworkversion TargetFrameworkOverride true Latest diff --git a/templates/DotNetTemplating/3.0/CSharp-WebApi/.template.config/template.json b/templates/DotNetTemplating/3.0/CSharp-WebApi/.template.config/template.json index 843637e..72741cb 100644 --- a/templates/DotNetTemplating/3.0/CSharp-WebApi/.template.config/template.json +++ b/templates/DotNetTemplating/3.0/CSharp-WebApi/.template.config/template.json @@ -233,13 +233,17 @@ "description": "The target framework for the project.", "datatype": "choice", "choices": [ + { + "choice": "netcoreapp3.1", + "description": "Target netcoreapp3.1" + }, { "choice": "netcoreapp3.0", "description": "Target netcoreapp3.0" } ], - "replaces": "netcoreapp3.0", - "defaultValue": "netcoreapp3.0" + "replaces": "targetframeworkversion", + "defaultValue": "netcoreapp3.1" }, "AspNetCoreVersion": { "type": "generated", @@ -249,9 +253,13 @@ "evaluator": "C++", "datatype": "string", "cases": [ + { + "condition": "(Framework == 'netcoreapp3.1')", + "value": "3.1.0" + }, { "condition": "(Framework == 'netcoreapp3.0')", - "value": "3.0.0-preview8.19405.11" + "value": "3.1.0" } ] } diff --git a/templates/DotNetTemplating/3.0/CSharp-WebApi/Company.WebApplication1.csproj b/templates/DotNetTemplating/3.0/CSharp-WebApi/Company.WebApplication1.csproj index ec29da4..8125469 100644 --- a/templates/DotNetTemplating/3.0/CSharp-WebApi/Company.WebApplication1.csproj +++ b/templates/DotNetTemplating/3.0/CSharp-WebApi/Company.WebApplication1.csproj @@ -1,7 +1,7 @@ - netcoreapp3.0 + targetframeworkversion TargetFrameworkOverride aspnet-Company.WebApplication1-53bc9b9d-9d6a-45d4-8429-2a2761773502 0 diff --git a/templates/Mustache/3.0/Steeltoe-React/global.json b/templates/Mustache/3.0/Steeltoe-React/global.json index e49fe78..e9aac8c 100644 --- a/templates/Mustache/3.0/Steeltoe-React/global.json +++ b/templates/Mustache/3.0/Steeltoe-React/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "3.0.100-preview7-012821" + "version": "3.1.100" } } diff --git a/templates/Mustache/3.0/Steeltoe-React/mustache.json b/templates/Mustache/3.0/Steeltoe-React/mustache.json index 0e0cc99..593387e 100644 --- a/templates/Mustache/3.0/Steeltoe-React/mustache.json +++ b/templates/Mustache/3.0/Steeltoe-React/mustache.json @@ -146,7 +146,7 @@ }, { "Name": "AspNetCoreVersion", - "Expression": "TargetFrameworkVersion,netcoreapp3.0=3.1.0,default=False", + "Expression": "TargetFrameworkVersion,netcoreapp3.1=3.1.0,default=3.1.0", "ExpressionType": "Case" }, { @@ -188,12 +188,16 @@ }, { "Name": "TargetFrameworkVersion", - "DefaultValue": "netcoreapp3.0", + "DefaultValue": "netcoreapp3.1", "Description": "Target the appropriate Dotnet framework version", "choices": [ { - "Choice": "netcoreapp2.2", - "Description": "Target SDotnet framework version 2.2" + "Choice": "netcoreapp3.0", + "Description": "Target SDotnet framework version 3.0" + }, + { + "Choice": "netcoreapp3.1", + "Description": "Target SDotnet framework version 3.1" } ] }, diff --git a/templates/Mustache/3.0/Steeltoe-WebApi/global.json b/templates/Mustache/3.0/Steeltoe-WebApi/global.json index e49fe78..e9aac8c 100644 --- a/templates/Mustache/3.0/Steeltoe-WebApi/global.json +++ b/templates/Mustache/3.0/Steeltoe-WebApi/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "3.0.100-preview7-012821" + "version": "3.1.100" } } diff --git a/templates/Mustache/3.0/Steeltoe-WebApi/mustache.json b/templates/Mustache/3.0/Steeltoe-WebApi/mustache.json index 52523be..475e52d 100644 --- a/templates/Mustache/3.0/Steeltoe-WebApi/mustache.json +++ b/templates/Mustache/3.0/Steeltoe-WebApi/mustache.json @@ -151,7 +151,7 @@ }, { "Name": "AspNetCoreVersion", - "Expression": "TargetFrameworkVersion,netcoreapp3.0=3.1.0,default=False", + "Expression": "TargetFrameworkVersion,netcoreapp3.1=3.1.0,default=3.1.0", "ExpressionType": "Case" } ], @@ -187,12 +187,16 @@ }, { "Name": "TargetFrameworkVersion", - "DefaultValue": "netcoreapp3.0", + "DefaultValue": "netcoreapp3.1", "Description": "Target the appropriate Dotnet framework version", "choices": [ { "Choice": "netcoreapp3.0", "Description": "Target Dotnet framework version 3.0" + }, + { + "Choice": "netcoreapp3.1", + "Description": "Target Dotnet framework version 3.1" } ] }, diff --git a/tests/TemplateServiceTests.cs b/tests/TemplateServiceTests.cs index c84c846..732f78b 100644 --- a/tests/TemplateServiceTests.cs +++ b/tests/TemplateServiceTests.cs @@ -452,7 +452,7 @@ using System.Threading;", valuesController); }); var fileContents = files.Find(x => x.Key == "testProject.csproj").Value; - var aspnetCoreVersion = version == TemplateVersion.V3 ? "3.0.0-preview8.19405.11" : "2.2.0"; + var aspnetCoreVersion = version == TemplateVersion.V3 ? "3.1.0" : "2.2.0"; Assert.Contains($@"", fileContents); @@ -594,7 +594,7 @@ using System.Threading;", valuesController); Assert.DoesNotContain("AddCloudFoundryActuators", startUpContents); var projectFile = files.Find(x => x.Key == "Foo.Bar.csproj").Value; - var targetFramework = version == TemplateVersion.V3 ? "netcoreapp3.0" : "netcoreapp2.2"; + var targetFramework = version == TemplateVersion.V3 ? "netcoreapp3.1" : "netcoreapp2.2"; Assert.Contains($"{targetFramework}", projectFile); }