Skip to content

Commit

Permalink
Suppress importing the orchestration SDK targets in test AppHosts, so…
Browse files Browse the repository at this point in the history
… the projects build even if the workload is not installed.
  • Loading branch information
eerhardt committed Jan 19, 2024
1 parent e257742 commit e0a57dd
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions playground/dapr/AppHost/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../../'))" />

<!-- NOTE: These lines are only required because we are using P2P references, not NuGet. They will not exist in real apps. -->
<PropertyGroup>
<_SuppressImportAspireHostingOrchestrationTargets>true</_SuppressImportAspireHostingOrchestrationTargets>
</PropertyGroup>
<Import Project="..\..\..\src\Aspire.Hosting\build\Aspire.Hosting.targets" />
<Import Project="..\..\..\src\Aspire.Hosting.Sdk\SDK\Sdk.targets" />

Expand Down
3 changes: 3 additions & 0 deletions playground/eShopLite/AppHost/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../'))" />

<!-- NOTE: These lines are only required because we are using P2P references, not NuGet. They will not exist in real apps. -->
<PropertyGroup>
<_SuppressImportAspireHostingOrchestrationTargets>true</_SuppressImportAspireHostingOrchestrationTargets>
</PropertyGroup>
<Import Project="..\..\..\src\Aspire.Hosting\build\Aspire.Hosting.targets" />
<Import Project="..\..\..\src\Aspire.Hosting.Sdk\SDK\Sdk.targets" />

Expand Down
3 changes: 3 additions & 0 deletions playground/orleans/OrleansAppHost/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../'))" />

<!-- NOTE: These lines are only required because we are using P2P references, not NuGet. They will not exist in real apps. -->
<PropertyGroup>
<_SuppressImportAspireHostingOrchestrationTargets>true</_SuppressImportAspireHostingOrchestrationTargets>
</PropertyGroup>
<Import Project="..\..\..\src\Aspire.Hosting\build\Aspire.Hosting.targets" />
<Import Project="..\..\..\src\Aspire.Hosting.Sdk\SDK\Sdk.targets" />

Expand Down
2 changes: 1 addition & 1 deletion src/Aspire.Hosting.Sdk/SDK/Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@
also contains Aspire.Hosting.Orchestration and vice versa. Once Aspire/DCP are public
we can move it to WorkloadManifest.targets to ensure future correctness.
-->
<Import Project="Sdk.targets" Sdk="Aspire.Hosting.Orchestration" />
<Import Project="Sdk.targets" Sdk="Aspire.Hosting.Orchestration" Condition="'$(_SuppressImportAspireHostingOrchestrationTargets)' != 'true'" />

</Project>
3 changes: 3 additions & 0 deletions tests/testproject/TestProject.AppHost/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../'))" />

<!-- NOTE: These lines are only required because we are using P2P references, not NuGet. They will not exist in real apps. -->
<PropertyGroup>
<_SuppressImportAspireHostingOrchestrationTargets>true</_SuppressImportAspireHostingOrchestrationTargets>
</PropertyGroup>
<Import Project="..\..\..\src\Aspire.Hosting\build\Aspire.Hosting.targets" />
<Import Project="..\..\..\src\Aspire.Hosting.Sdk\SDK\Sdk.targets" />

Expand Down

0 comments on commit e0a57dd

Please sign in to comment.