diff --git a/.gitignore b/.gitignore index 0bc1e9f..615ee80 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ docs/api docs/_site coverage.cobertura.xml pkg/ -artifacts/ \ No newline at end of file +artifacts/ +*.bak \ No newline at end of file diff --git a/src/JD.Efcpt.Build.Tasks/packages.lock.json b/src/JD.Efcpt.Build.Tasks/packages.lock.json index 8afd5aa..3b14daf 100644 --- a/src/JD.Efcpt.Build.Tasks/packages.lock.json +++ b/src/JD.Efcpt.Build.Tasks/packages.lock.json @@ -73,6 +73,15 @@ "SQLitePCLRaw.core": "2.1.10" } }, + "Microsoft.NETFramework.ReferenceAssemblies": { + "type": "Direct", + "requested": "[1.0.3, )", + "resolved": "1.0.3", + "contentHash": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==", + "dependencies": { + "Microsoft.NETFramework.ReferenceAssemblies.net472": "1.0.3" + } + }, "MySqlConnector": { "type": "Direct", "requested": "[2.4.0, )", @@ -494,6 +503,11 @@ "System.Runtime.CompilerServices.Unsafe": "6.1.0" } }, + "Microsoft.NETFramework.ReferenceAssemblies.net472": { + "type": "Transitive", + "resolved": "1.0.3", + "contentHash": "0E7evZXHXaDYYiLRfpyXvCh+yzM2rNTyuZDI+ZO7UUqSc6GfjePiXTdqJGtgIKUwdI81tzQKmaWprnUiPj9hAw==" + }, "Mono.Unix": { "type": "Transitive", "resolved": "7.1.0-final.1.21458.1", diff --git a/src/JD.Efcpt.Build.Templates/JD.Efcpt.Build.Templates.csproj b/src/JD.Efcpt.Build.Templates/JD.Efcpt.Build.Templates.csproj index 6f26492..1a02a0f 100644 --- a/src/JD.Efcpt.Build.Templates/JD.Efcpt.Build.Templates.csproj +++ b/src/JD.Efcpt.Build.Templates/JD.Efcpt.Build.Templates.csproj @@ -35,4 +35,130 @@ + + + + + + + + + + + + + + + + + + + + + <_TemplateJsonPath>$(MSBuildProjectDirectory)/templates/efcptbuild/.template.config/template.json + <_TemplateJsonBackupPath>$(MSBuildProjectDirectory)/templates/efcptbuild/.template.config/template.json.bak + + + + + + + + + + + <_TemplateJsonPath>$(MSBuildProjectDirectory)/templates/efcptbuild/.template.config/template.json + <_TemplateJsonBackupPath>$(MSBuildProjectDirectory)/templates/efcptbuild/.template.config/template.json.bak + + + + + + + + + + + + + + + <_TemplateJsonPath>$(MSBuildProjectDirectory)/templates/efcptbuild/.template.config/template.json + <_TemplateJsonBackupPath>$(MSBuildProjectDirectory)/templates/efcptbuild/.template.config/template.json.bak + + + + + + + + + + + + + + + + + + <_TemplateJsonPath>$(MSBuildProjectDirectory)/templates/efcptbuild/.template.config/template.json + <_TemplateJsonBackupPath>$(MSBuildProjectDirectory)/templates/efcptbuild/.template.config/template.json.bak + + + + + + + diff --git a/src/JD.Efcpt.Build.Templates/templates/efcptbuild/.template.config/template.json b/src/JD.Efcpt.Build.Templates/templates/efcptbuild/.template.config/template.json index b583b73..f7e7a19 100644 --- a/src/JD.Efcpt.Build.Templates/templates/efcptbuild/.template.config/template.json +++ b/src/JD.Efcpt.Build.Templates/templates/efcptbuild/.template.config/template.json @@ -100,6 +100,12 @@ "IsNet8OrNet9": { "type": "computed", "value": "(Framework == \"net8.0\" || Framework == \"net9.0\")" + }, + "SdkVersion": { + "type": "parameter", + "datatype": "string", + "replaces": "SDKVERSION_PLACEHOLDER", + "defaultValue": "1.0.0" } }, "primaryOutputs": [ diff --git a/src/JD.Efcpt.Build.Templates/templates/efcptbuild/EfcptProject.csproj b/src/JD.Efcpt.Build.Templates/templates/efcptbuild/EfcptProject.csproj index 00c38b3..0e7799f 100644 --- a/src/JD.Efcpt.Build.Templates/templates/efcptbuild/EfcptProject.csproj +++ b/src/JD.Efcpt.Build.Templates/templates/efcptbuild/EfcptProject.csproj @@ -10,7 +10,7 @@ No JD.Efcpt.Build PackageReference needed - the SDK handles everything! --> - + net8.0 enable diff --git a/tests/JD.Efcpt.Sdk.IntegrationTests/TemplateTests.cs b/tests/JD.Efcpt.Sdk.IntegrationTests/TemplateTests.cs index 4d172d4..0285ff4 100644 --- a/tests/JD.Efcpt.Sdk.IntegrationTests/TemplateTests.cs +++ b/tests/JD.Efcpt.Sdk.IntegrationTests/TemplateTests.cs @@ -77,8 +77,8 @@ public async Task Template_CreatesProjectUsingSdkApproach() var projectContent = await File.ReadAllTextAsync(projectFile); // Assert - projectContent.Should().Contain("", - "Project should use JD.Efcpt.Sdk"); + projectContent.Should().Match("**", + "Project should use JD.Efcpt.Sdk with version"); projectContent.Should().NotMatch("*", - $"{framework} project should use JD.Efcpt.Sdk"); + projectContent.Should().Match("**", + $"{framework} project should use JD.Efcpt.Sdk with version"); projectContent.Should().NotContain("PackageReference Include=\"JD.Efcpt.Build\"", $"{framework} project should not have JD.Efcpt.Build package reference"); }