Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add templates for 9.0 #6058

Merged
merged 25 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
16d1b7b
Rename Aspire.ProjectTemplates to Aspire.ProjectTemplates.9.0.net8
radical Oct 1, 2024
10d0a5b
Add Aspire.ProjectTemplates.9.0.net8
radical Oct 1, 2024
bfbfa37
Update Aspire.sln, and Build.props
radical Oct 1, 2024
d4c36a6
Update property names for previous runtime versions used for testing
radical Oct 1, 2024
2acf79c
Use dotnet-tests instead of dotnet-latest
radical Oct 1, 2024
6074c51
build changes - FIXME: elaborate
radical Oct 1, 2024
3be33b4
Add new new-and-build template tests
radical Oct 1, 2024
13d1e42
update workload tests
radical Oct 1, 2024
f89a403
re-enable workload tests on windows
radical Oct 1, 2024
f432076
cleanup
radical Oct 1, 2024
d5642aa
remove -net8 run of the workload tests
radical Oct 1, 2024
b52cd28
rename TemplateTests.cs to BuildAndRunTemplateTests.cs
radical Oct 1, 2024
43f69af
remove unused targets
radical Oct 1, 2024
c89fc40
Fix windows build
radical Oct 2, 2024
b504b3a
fix
radical Oct 2, 2024
9ef8554
correctly exclude projecttemplate projects
radical Oct 2, 2024
b31c32c
fix sdk install
radical Oct 2, 2024
18b6bb0
Add the ProjectTemplates projects to Hosting
radical Oct 2, 2024
af26f1d
Fix tests
radical Oct 2, 2024
fc17f09
Show test output by default for tests running from the assembly
radical Oct 2, 2024
2cfd0b5
Merge remote-tracking branch 'origin/main' into templates-9-with-tests
radical Oct 2, 2024
c2519c0
Use net9.0 natively in the 9.0.net9 templates
radical Oct 2, 2024
0a2fe6f
Use separate replacement tokens for extensions version for 8.x vs 9.x…
radical Oct 2, 2024
5579816
Update src/Aspire.ProjectTemplates.9.0.net9/templates/aspire-empty/.t…
radical Oct 2, 2024
9975d3c
Merge remote-tracking branch 'upstream/main' into templates-9-with-tests
DamianEdwards Oct 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 13 additions & 7 deletions Aspire.sln
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Servic
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.ServiceDiscovery.Dns.Tests", "tests\Microsoft.Extensions.ServiceDiscovery.Dns.Tests\Microsoft.Extensions.ServiceDiscovery.Dns.Tests.csproj", "{845B39FE-A982-44EB-A4DB-CCCD93CBF261}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.ProjectTemplates", "src\Aspire.ProjectTemplates\Aspire.ProjectTemplates.csproj", "{29012D95-AA39-4DC9-AFAA-2FC3A8CDEF33}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Npgsql", "src\Components\Aspire.Npgsql\Aspire.Npgsql.csproj", "{AC5970BF-7A71-4CFE-BC21-8E597ECD347C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Dashboard", "src\Aspire.Dashboard\Aspire.Dashboard.csproj", "{D403DB4A-ABFC-4B13-A920-C6AC9B3EEE0B}"
Expand Down Expand Up @@ -634,6 +632,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AzureContainerApps.AppHost"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AzureContainerApps.ApiService", "playground\AzureContainerApps\AzureContainerApps.ApiService\AzureContainerApps.ApiService.csproj", "{683D8264-2755-4455-A6D4-14F7A6AC7B54}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.ProjectTemplates.9.0.net9", "src\Aspire.ProjectTemplates.9.0.net9\Aspire.ProjectTemplates.9.0.net9.csproj", "{D07A8344-C61A-478A-92F0-E9B2DA00D647}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.ProjectTemplates.9.0.net8", "src\Aspire.ProjectTemplates.9.0.net8\Aspire.ProjectTemplates.9.0.net8.csproj", "{C75E1CE5-58E6-4D21-9422-7C9E17D71D67}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WaitFor.Frontend", "playground\waitfor\WaitFor.Frontend\WaitFor.Frontend.csproj", "{C88BBF0B-7566-48BD-A2BC-05374B1A2B22}"
EndProject
Global
Expand Down Expand Up @@ -738,10 +739,6 @@ Global
{845B39FE-A982-44EB-A4DB-CCCD93CBF261}.Debug|Any CPU.Build.0 = Debug|Any CPU
{845B39FE-A982-44EB-A4DB-CCCD93CBF261}.Release|Any CPU.ActiveCfg = Release|Any CPU
{845B39FE-A982-44EB-A4DB-CCCD93CBF261}.Release|Any CPU.Build.0 = Release|Any CPU
{29012D95-AA39-4DC9-AFAA-2FC3A8CDEF33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{29012D95-AA39-4DC9-AFAA-2FC3A8CDEF33}.Debug|Any CPU.Build.0 = Debug|Any CPU
{29012D95-AA39-4DC9-AFAA-2FC3A8CDEF33}.Release|Any CPU.ActiveCfg = Release|Any CPU
{29012D95-AA39-4DC9-AFAA-2FC3A8CDEF33}.Release|Any CPU.Build.0 = Release|Any CPU
{AC5970BF-7A71-4CFE-BC21-8E597ECD347C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AC5970BF-7A71-4CFE-BC21-8E597ECD347C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AC5970BF-7A71-4CFE-BC21-8E597ECD347C}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -1670,6 +1667,14 @@ Global
{683D8264-2755-4455-A6D4-14F7A6AC7B54}.Debug|Any CPU.Build.0 = Debug|Any CPU
{683D8264-2755-4455-A6D4-14F7A6AC7B54}.Release|Any CPU.ActiveCfg = Release|Any CPU
{683D8264-2755-4455-A6D4-14F7A6AC7B54}.Release|Any CPU.Build.0 = Release|Any CPU
{D07A8344-C61A-478A-92F0-E9B2DA00D647}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D07A8344-C61A-478A-92F0-E9B2DA00D647}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D07A8344-C61A-478A-92F0-E9B2DA00D647}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D07A8344-C61A-478A-92F0-E9B2DA00D647}.Release|Any CPU.Build.0 = Release|Any CPU
{C75E1CE5-58E6-4D21-9422-7C9E17D71D67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C75E1CE5-58E6-4D21-9422-7C9E17D71D67}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C75E1CE5-58E6-4D21-9422-7C9E17D71D67}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C75E1CE5-58E6-4D21-9422-7C9E17D71D67}.Release|Any CPU.Build.0 = Release|Any CPU
{C88BBF0B-7566-48BD-A2BC-05374B1A2B22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C88BBF0B-7566-48BD-A2BC-05374B1A2B22}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C88BBF0B-7566-48BD-A2BC-05374B1A2B22}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -1704,7 +1709,6 @@ Global
{7C4F0F84-BAEC-469D-A3BC-28209B2C11AC} = {4981B3A5-4AFD-4191-BF7D-8692D9783D60}
{CD7BF1EC-ABF9-48DE-8683-353216DB4958} = {7C4F0F84-BAEC-469D-A3BC-28209B2C11AC}
{845B39FE-A982-44EB-A4DB-CCCD93CBF261} = {7C4F0F84-BAEC-469D-A3BC-28209B2C11AC}
{29012D95-AA39-4DC9-AFAA-2FC3A8CDEF33} = {B80354C7-BE58-43F6-8928-9F3A74AB7F47}
{AC5970BF-7A71-4CFE-BC21-8E597ECD347C} = {27381127-6C45-4B4C-8F18-41FF48DFE4B2}
{D403DB4A-ABFC-4B13-A920-C6AC9B3EEE0B} = {B80354C7-BE58-43F6-8928-9F3A74AB7F47}
{88A89C15-11DF-4F32-AA61-6896AF09F470} = {27381127-6C45-4B4C-8F18-41FF48DFE4B2}
Expand Down Expand Up @@ -1979,6 +1983,8 @@ Global
{D47C77F3-49F4-4741-9786-6F68FC50587E} = {D173887B-AF42-4576-B9C1-96B9E9B3D9C0}
{96A5B854-2C72-49C8-A91B-2643B814DB2A} = {D47C77F3-49F4-4741-9786-6F68FC50587E}
{683D8264-2755-4455-A6D4-14F7A6AC7B54} = {D47C77F3-49F4-4741-9786-6F68FC50587E}
{D07A8344-C61A-478A-92F0-E9B2DA00D647} = {B80354C7-BE58-43F6-8928-9F3A74AB7F47}
{C75E1CE5-58E6-4D21-9422-7C9E17D71D67} = {B80354C7-BE58-43F6-8928-9F3A74AB7F47}
{C88BBF0B-7566-48BD-A2BC-05374B1A2B22} = {3FF3F00C-95C0-46FC-B2BE-A3920C71E393}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
Expand Down
2 changes: 1 addition & 1 deletion dogfood.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ else
fi

REPO_ROOT=$(cd "${scriptroot}";pwd)
SDK_PATH=$REPO_ROOT/artifacts/bin/dotnet-latest
SDK_PATH=$REPO_ROOT/artifacts/bin/dotnet-tests
if [ ! -x "$SDK_PATH/dotnet" ]; then
echo "Error: Could not find dotnet at $SDK_PATH/dotnet"
return
Expand Down
2 changes: 1 addition & 1 deletion eng/Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<ItemGroup Condition="'$(DotNetBuildFromSource)' != 'true' and '$(DotNetBuild)' != 'true'">
<ProjectToBuild Include="$(RepoRoot)src\**\*.csproj" Exclude="$(RepoRoot)src\Aspire.ProjectTemplates\templates\**\*.csproj" />
<ProjectToBuild Include="$(RepoRoot)src\**\*.csproj" Exclude="$(RepoRoot)src\Aspire.ProjectTemplates.9.0.net8\templates\**\*.csproj;$(RepoRoot)src\Aspire.ProjectTemplates.9.0.net9\templates\**\*.csproj" />
<ProjectToBuild Include="$(RepoRoot)eng\dcppack\**\*.csproj" />
<ProjectToBuild Include="$(RepoRoot)eng\dashboardpack\**\*.csproj" />
<ProjectToBuild Include="$(RepoRoot)playground\**\*.csproj" />
Expand Down
7 changes: 5 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
<BaselineVersionForPackageValidation>8.0.1</BaselineVersionForPackageValidation>
<DefaultTargetFramework>net8.0</DefaultTargetFramework>
<!-- dotnet 8.0 versions for running tests -->
<DotNetRuntimeVersionForTesting>8.0.8</DotNetRuntimeVersionForTesting>
<DotNetRuntimePreviousVersionForTesting>8.0.8</DotNetRuntimePreviousVersionForTesting>
<!-- dotnet 8.0 versions for running tests - used for workload tests -->
<DotNetSdkVersionForTesting>8.0.401</DotNetSdkVersionForTesting>
<DotNetSdkPreviousVersionForTesting>8.0.401</DotNetSdkPreviousVersionForTesting>
<UseVSTestRunner>true</UseVSTestRunner>
<!-- Enable to remove prerelease label. -->
<StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">false</StabilizePackageVersion>
Expand Down Expand Up @@ -66,5 +66,8 @@
<MicrosoftEntityFrameworkCoreSqlServerPackageVersion>8.0.8</MicrosoftEntityFrameworkCoreSqlServerPackageVersion>
<MicrosoftEntityFrameworkCoreToolsPackageVersion>8.0.8</MicrosoftEntityFrameworkCoreToolsPackageVersion>
<MicrosoftNETRuntimeWorkloadTestingInternalVersion>9.0.0-preview.5.24272.3</MicrosoftNETRuntimeWorkloadTestingInternalVersion>
<!-- for templates -->
<MicrosoftExtensionsHttpResiliencePackageVersionForNet8>$(MicrosoftExtensionsHttpResiliencePackageVersion)</MicrosoftExtensionsHttpResiliencePackageVersionForNet8>
<MicrosoftExtensionsHttpResiliencePackageVersionForNet9>$(MicrosoftExtensionsHttpResiliencePackageVersion)</MicrosoftExtensionsHttpResiliencePackageVersionForNet9>
DamianEdwards marked this conversation as resolved.
Show resolved Hide resolved
</PropertyGroup>
</Project>
7 changes: 7 additions & 0 deletions eng/pipelines/templates/BuildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ steps:
displayName: Run non-helix tests

- ${{ if or(ne(parameters.runAsPublic, 'true'), eq(parameters.runHelixTests, 'true')) }}:
- script: ${{ parameters.buildScript }}
/p:Configuration=${{ parameters.buildConfig }}
$(_OfficialBuildIdArgs)
/bl:${{ parameters.repoLogPath }}/InstallSdksForTesting.binlog
-projects $(Build.SourcesDirectory)/tests/workloads.proj
displayName: Install sdk for testing

# Helix captures code coverage information and, once tests are complete, the code coverage information is
# downloaded to <repo root>/artifacts/helixresults folder.
- template: /eng/pipelines/templates/send-to-helix.yml
Expand Down
8 changes: 4 additions & 4 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
"dotnet": "9.0.100-rc.1.24452.12",
"runtimes": {
"dotnet/x64": [
"$(DotNetRuntimeVersionForTesting)"
"$(DotNetRuntimePreviousVersionForTesting)"
],
"dotnet/arm64": [
"$(DotNetRuntimeVersionForTesting)"
"$(DotNetRuntimePreviousVersionForTesting)"
],
"aspnetcore/x64": [
"$(DotNetRuntimeVersionForTesting)"
"$(DotNetRuntimePreviousVersionForTesting)"
],
"aspnetcore/arm64": [
"$(DotNetRuntimeVersionForTesting)"
"$(DotNetRuntimePreviousVersionForTesting)"
]
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<WriteLinesToFile File="%(TemplateProjectFiles.DestinationFile)"
Lines="$([System.IO.File]::ReadAllText('%(TemplateProjectFiles.FullPath)')
.Replace('!!REPLACE_WITH_LATEST_VERSION!!', '$(PackageVersion)')
.Replace('!!REPLACE_WITH_EXTENSIONS_VERSION!!', '$(MicrosoftExtensionsHttpResiliencePackageVersion)'))"
.Replace('!!REPLACE_WITH_EXTENSIONS_8_VERSION!!', '$(MicrosoftExtensionsHttpResiliencePackageVersionForNet8)'))"
Overwrite="true" />
</Target>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"type": "project"
},
"precedence": "8000",
"identity": "Aspire.AppHost.CSharp.8.0",
"identity": "Aspire.AppHost.CSharp.9.net8",
"thirdPartyNotices": "https://aka.ms/dotnet/aspire/8.0-third-party-notices",
"groupIdentity": "Aspire.AppHost",
"groupIdentity": "Aspire.AppHost.9",
Copy link
Member

@DamianEdwards DamianEdwards Oct 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the package ID contains 9.0 I think we'd want the groupIdentity to be Aspire.AppHost.9.0 here (and the identity above Aspire.AppHost.CSharp.9.0.net8)? That means different 9.x versions can be installed side-by-side (the package IDs already have the major.minor AFAICT) and the template engine will group the templates by their groupIdentity for TFM selection.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that depends on whether we want major.minor to be SxS. FWIW, we could leave this .9 today, and if we release a 9.1 which we want to be SxS, make that groupid include the minor version.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair point, can always defer that decision

"guids": [
"98048C9C-BF28-46BA-A98E-63767EE5E3A8"
],
Expand Down Expand Up @@ -218,4 +218,4 @@
"continueOnError": true
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"editorTreatAs": "solution"
},
"precedence": "8000",
"identity": "Aspire.Empty.CSharp.8.0",
"identity": "Aspire.Empty.CSharp.9.net8",
"thirdPartyNotices": "https://aka.ms/dotnet/aspire/8.0-third-party-notices",
"groupIdentity": "Aspire.Empty",
"groupIdentity": "Aspire.Empty.9",
"guids": [
"F98A6C4E-E01C-44BB-BCC9-4C23F1CD09CD",
"8CD1957F-C0E5-454E-8BDC-88F84DD58303",
Expand Down Expand Up @@ -245,4 +245,4 @@
"continueOnError": true
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />

<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="!!REPLACE_WITH_EXTENSIONS_VERSION!!" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="!!REPLACE_WITH_EXTENSIONS_8_VERSION!!" />
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="!!REPLACE_WITH_LATEST_VERSION!!" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"type": "project"
},
"precedence": "8000",
"identity": "Aspire.Tests.MSTest.CSharp.8.0",
"identity": "Aspire.Tests.MSTest.CSharp.9.net8",
"thirdPartyNotices": "https://aka.ms/dotnet/aspire/8.0-third-party-notices",
"groupIdentity": "Aspire.Tests.MSTest",
"groupIdentity": "Aspire.Tests.MSTest.9",
"symbols": {
"Framework": {
"type": "parameter",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"type": "project"
},
"precedence": "8000",
"identity": "Aspire.Tests.NUnit.CSharp.8.0",
"identity": "Aspire.Tests.NUnit.CSharp.9.net8",
"thirdPartyNotices": "https://aka.ms/dotnet/aspire/8.0-third-party-notices",
"groupIdentity": "Aspire.Tests.NUnit",
"groupIdentity": "Aspire.Tests.NUnit.9",
"symbols": {
"Framework": {
"type": "parameter",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"type": "project"
},
"precedence": "8000",
"identity": "Aspire.ServiceDefaults.CSharp.8.0",
"identity": "Aspire.ServiceDefaults.CSharp.9.net8",
"thirdPartyNotices": "https://aka.ms/dotnet/aspire/8.0-third-party-notices",
"groupIdentity": "Aspire.ServiceDefaults",
"groupIdentity": "Aspire.ServiceDefaults.9",
"symbols": {
"Framework": {
"type": "parameter",
Expand Down Expand Up @@ -68,4 +68,4 @@
"continueOnError": true
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />

<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="!!REPLACE_WITH_EXTENSIONS_VERSION!!" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="!!REPLACE_WITH_EXTENSIONS_8_VERSION!!" />
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="!!REPLACE_WITH_LATEST_VERSION!!" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"editorTreatAs": "solution"
},
"precedence": "8000",
"identity": "Aspire.Starter.CSharp.8.0",
"identity": "Aspire.Starter.CSharp.9.net8",
"thirdPartyNotices": "https://aka.ms/dotnet/aspire/8.0-third-party-notices",
"groupIdentity": "Aspire.Starter",
"groupIdentity": "Aspire.Starter.9",
"guids": [
"80B24B1B-1E78-4FCB-BDC9-13678F1789F4",
"DB7A3AC1-6E4F-4805-B710-2FCD1084E96E",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />

<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="!!REPLACE_WITH_EXTENSIONS_VERSION!!" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="!!REPLACE_WITH_EXTENSIONS_8_VERSION!!" />
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="!!REPLACE_WITH_LATEST_VERSION!!" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"type": "project"
},
"precedence": "8000",
"identity": "Aspire.Tests.xUnit.CSharp.8.0",
"identity": "Aspire.Tests.xUnit.CSharp.9.net8",
"thirdPartyNotices": "https://aka.ms/dotnet/aspire/8.0-third-party-notices",
"groupIdentity": "Aspire.Tests.xUnit",
"groupIdentity": "Aspire.Tests.xUnit.9",
"symbols": {
"Framework": {
"type": "parameter",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<Project Sdk="Microsoft.NET.Sdk" InitialTargets="AddTemplatesToPackageAsContent">

<PropertyGroup>
<TargetFramework>$(DefaultTargetFramework)</TargetFramework>
<OutputType>Library</OutputType>
<IsPackable>true</IsPackable>
<IncludeContentInPack>true</IncludeContentInPack>
<IncludeBuildOutput>false</IncludeBuildOutput>
<ContentTargetFolders>content</ContentTargetFolders>
<PackageType>Template</PackageType>
<NoWarn>$(NoWarn);NU5128</NoWarn>
<EnableDefaultItems>false</EnableDefaultItems>
<Description>.NET Aspire Template Pack for Microsoft Template Engine</Description>
<UsingToolTemplateLocalizer>true</UsingToolTemplateLocalizer>
</PropertyGroup>

<PropertyGroup>
<UsePublicApiAnalyzers>false</UsePublicApiAnalyzers>
</PropertyGroup>

<PropertyGroup>
<MinCodeCoverage>100</MinCodeCoverage>
</PropertyGroup>

<ItemGroup>
<None Include="templates\**\*" />
</ItemGroup>

<!-- When building a package, this target will run to copy all the templates into the intermediate directory,
replaces the package versions, and adds them to the package.-->
<Target Name="AddTemplatesToPackageAsContent"
DependsOnTargets="ReplacePackageVersionOnTemplates">

<!-- Creating a temporary item instead of defining content items directly in order to avoid MSBuild MSB4120
message shown when an item within a target references itself which may cuase unintended expansion. -->
<ItemGroup>
<_TemplatesForPackage Include="$(IntermediateOutputPath)\content\templates\**\*" />
</ItemGroup>
<ItemGroup>
<Content Include="%(_TemplatesForPackage.Identity)"
PackagePath="content/templates/%(_TemplatesForPackage.RecursiveDir)" />
</ItemGroup>
</Target>

<!-- Replaces the versions referenced by the templates projects to use the version of the packages being live-built -->
<Target Name="ReplacePackageVersionOnTemplates"
DependsOnTargets="CopyTemplatesToIntermediateOutputPath">

<ItemGroup>
<TemplateProjectFiles Include="templates\**\*.csproj" />
<TemplateProjectFiles>
<DestinationFile>$(IntermediateOutputPath)\content\templates\%(RecursiveDir)%(Filename)%(Extension)</DestinationFile>
</TemplateProjectFiles>
</ItemGroup>

<WriteLinesToFile File="%(TemplateProjectFiles.DestinationFile)"
Lines="$([System.IO.File]::ReadAllText('%(TemplateProjectFiles.FullPath)')
.Replace('!!REPLACE_WITH_LATEST_VERSION!!', '$(PackageVersion)')
.Replace('!!REPLACE_WITH_EXTENSIONS_9_VERSION!!', '$(MicrosoftExtensionsHttpResiliencePackageVersionForNet9)'))"
Overwrite="true" />
</Target>

<!-- Grabs the contents of the templates folder and copies them to IntermediateOutputPath directory -->
<Target Name="CopyTemplatesToIntermediateOutputPath">

<ItemGroup>
<_ContentFilesToPackage Include="templates\**\*" Exclude="templates\**\bin\**;templates\**\obj\**;templates\**\*.csproj" />
</ItemGroup>

<Copy SourceFiles="@(_ContentFilesToPackage)"
SkipUnchangedFiles="true"
DestinationFolder="$(IntermediateOutputPath)\content\templates\%(RecursiveDir)" />
</Target>

</Project>
Loading