Skip to content

Commit

Permalink
Fixing unintended formatting changes (#5471)
Browse files Browse the repository at this point in the history
  • Loading branch information
joperezr authored Sep 4, 2024
1 parent a218e5e commit ab0a8d5
Showing 1 changed file with 16 additions and 33 deletions.
49 changes: 16 additions & 33 deletions src/Aspire.Hosting.Sdk/SDK/Sdk.targets
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<Project>

<!--
A property-based workload cannot import props files (except AutoImport.props, which has very tight
limitations.
A property-based workload cannot import props files (except AutoImport.props, which has very tight limitations.
Instead, we copy everything from Aspire.Hosting.AppHost.props into these targets.
This means they cannot be overridden in the csproj, and may cause ordering issues, particularly
StaticWebAssets.
This means they cannot be overridden in the csproj, and may cause ordering issues, particularly StaticWebAssets.
-->

<ItemGroup>
Expand All @@ -15,45 +13,34 @@
</ItemGroup>

<PropertyGroup>
<!-- Aspire hosting projects aren't publishable right now until
https://github.com/dotnet/aspire/issues/147 is good -->
<!-- Aspire hosting projects aren't publishable right now until https://github.com/dotnet/aspire/issues/147 is good -->
<IsPublishable Condition="'$(IsPublishable)' == ''">false</IsPublishable>
<IsPackable Condition="'$(IsPackable)' == ''">false</IsPackable>
</PropertyGroup>

<!--
Default AppHost ProjectReference items to not be referenced in the AppHost, unless it is
IsAspireProjectResource=false.
Default AppHost ProjectReference items to not be referenced in the AppHost, unless it is IsAspireProjectResource=false.
This defaulting needs to happen in the SDK targets so this metadata affects NuGet Restore.
-->
<ItemGroup Condition="'$(IsAspireHost)' == 'true'">

<ProjectReference Update="@(ProjectReference)">
<IsAspireProjectResource Condition="'%(IsAspireProjectResource)' != 'false'">true</IsAspireProjectResource>

<ReferenceOutputAssembly
Condition="'%(ReferenceOutputAssembly)' == '' and '%(IsAspireProjectResource)' == 'true'">
false</ReferenceOutputAssembly>
<SkipGetTargetFrameworkProperties
Condition="'%(SkipGetTargetFrameworkProperties)' == '' and '%(IsAspireProjectResource)' == 'true'">
true</SkipGetTargetFrameworkProperties>
<ExcludeAssets Condition="'%(ExcludeAssets)' == '' and '%(IsAspireProjectResource)' == 'true'">
all</ExcludeAssets>
<ReferenceOutputAssembly Condition="'%(ReferenceOutputAssembly)' == '' and '%(IsAspireProjectResource)' == 'true'">false</ReferenceOutputAssembly>
<SkipGetTargetFrameworkProperties Condition="'%(SkipGetTargetFrameworkProperties)' == '' and '%(IsAspireProjectResource)' == 'true'">true</SkipGetTargetFrameworkProperties>
<ExcludeAssets Condition="'%(ExcludeAssets)' == '' and '%(IsAspireProjectResource)' == 'true'">all</ExcludeAssets>
<Private Condition="'%(Private)' == '' and '%(IsAspireProjectResource)' == 'true'">false</Private>
</ProjectReference>

</ItemGroup>

<Target Name="__WarnOnAspireCapabilityMissing" BeforeTargets="PrepareForBuild"
Condition="!@(ProjectCapability->AnyHaveMetadataValue('Identity', 'Aspire'))">
<Warning Code="ASPIRE002"
Text="$(MSBuildProjectName) is an Aspire AppHost project but necessary dependencies aren't present. Are you missing an Aspire.Hosting.AppHost PackageReference?" />
<Target Name="__WarnOnAspireCapabilityMissing" BeforeTargets="PrepareForBuild" Condition="!@(ProjectCapability->AnyHaveMetadataValue('Identity', 'Aspire'))">
<Warning Code="ASPIRE002" Text="$(MSBuildProjectName) is an Aspire AppHost project but necessary dependencies aren't present. Are you missing an Aspire.Hosting.AppHost PackageReference?" />
</Target>

<Target Name="__WarnOnMininumVsVersionMissing" BeforeTargets="PrepareForBuild"
Condition="'$(BuildingInsideVisualStudio)' == 'true' and $([MSBuild]::VersionLessThan('$(MSBuildVersion)', '17.10.0'))">
<Warning Code="ASPIRE003"
Text="$(MSBuildProjectName) is a .NET Aspire AppHost project that requires Visual Studio version 17.10 or above to work correctly. You are using version $(MSBuildVersion)." />
<Target Name="__WarnOnMininumVsVersionMissing" BeforeTargets="PrepareForBuild" Condition="'$(BuildingInsideVisualStudio)' == 'true' and $([MSBuild]::VersionLessThan('$(MSBuildVersion)', '17.10.0'))">
<Warning Code="ASPIRE003" Text="$(MSBuildProjectName) is a .NET Aspire AppHost project that requires Visual Studio version 17.10 or above to work correctly. You are using version $(MSBuildVersion)." />
</Target>

<!-- This target extracts the version of Aspire.Hosting.AppHost referenced by the project, and adds
Expand All @@ -65,8 +52,7 @@
<!-- First, we assume project is not using Central Package Management, and we try to extract the version
from PackageReference Items. -->
<ItemGroup>
<_AppHostPackageReference Include="@(PackageReference)" Condition="'%(Identity)' ==
'Aspire.Hosting.AppHost'" />
<_AppHostPackageReference Include="@(PackageReference)" Condition="'%(Identity)' == 'Aspire.Hosting.AppHost'" />
</ItemGroup>

<!-- Extract the Version metadata -->
Expand All @@ -78,8 +64,7 @@
and we try to extract the PackageVersion Items. -->
<ItemGroup Condition="'$(_AppHostVersion)' == ''">
<_AppHostPackageReference />
<_AppHostPackageReference Include="@(PackageVersion)" Condition="'%(Identity)' ==
'Aspire.Hosting.AppHost'" />
<_AppHostPackageReference Include="@(PackageVersion)" Condition="'%(Identity)' == 'Aspire.Hosting.AppHost'" />
</ItemGroup>

<PropertyGroup Condition="'$(_AppHostVersion)' == ''">
Expand All @@ -96,10 +81,8 @@

<!-- Now that we have the version, we add the package references -->
<ItemGroup>
<PackageReference Include="Aspire.Dashboard.Sdk.$(NETCoreSdkRuntimeIdentifier)"
Version="$(_AppHostVersion)" IsImplicitlyDefined="true" />
<PackageReference Include="Aspire.Hosting.Orchestration.$(NETCoreSdkRuntimeIdentifier)"
Version="$(_AppHostVersion)" IsImplicitlyDefined="true" />
<PackageReference Include="Aspire.Dashboard.Sdk.$(NETCoreSdkRuntimeIdentifier)" Version="$(_AppHostVersion)" IsImplicitlyDefined="true" />
<PackageReference Include="Aspire.Hosting.Orchestration.$(NETCoreSdkRuntimeIdentifier)" Version="$(_AppHostVersion)" IsImplicitlyDefined="true" />
</ItemGroup>
</Target>

Expand Down

0 comments on commit ab0a8d5

Please sign in to comment.