|
1 | 1 | <Project> |
2 | 2 |
|
3 | 3 | <!-- |
4 | | - A property-based workload cannot import props files (except AutoImport.props, which has very tight |
5 | | - limitations. |
| 4 | + A property-based workload cannot import props files (except AutoImport.props, which has very tight limitations. |
6 | 5 | Instead, we copy everything from Aspire.Hosting.AppHost.props into these targets. |
7 | | - This means they cannot be overridden in the csproj, and may cause ordering issues, particularly |
8 | | - StaticWebAssets. |
| 6 | + This means they cannot be overridden in the csproj, and may cause ordering issues, particularly StaticWebAssets. |
9 | 7 | --> |
10 | 8 |
|
11 | 9 | <ItemGroup> |
|
15 | 13 | </ItemGroup> |
16 | 14 |
|
17 | 15 | <PropertyGroup> |
18 | | - <!-- Aspire hosting projects aren't publishable right now until |
19 | | - https://github.com/dotnet/aspire/issues/147 is good --> |
| 16 | + <!-- Aspire hosting projects aren't publishable right now until https://github.com/dotnet/aspire/issues/147 is good --> |
20 | 17 | <IsPublishable Condition="'$(IsPublishable)' == ''">false</IsPublishable> |
21 | 18 | <IsPackable Condition="'$(IsPackable)' == ''">false</IsPackable> |
22 | 19 | </PropertyGroup> |
23 | 20 |
|
24 | 21 | <!-- |
25 | | - Default AppHost ProjectReference items to not be referenced in the AppHost, unless it is |
26 | | - IsAspireProjectResource=false. |
| 22 | + Default AppHost ProjectReference items to not be referenced in the AppHost, unless it is IsAspireProjectResource=false. |
27 | 23 | This defaulting needs to happen in the SDK targets so this metadata affects NuGet Restore. |
28 | 24 | --> |
29 | 25 | <ItemGroup Condition="'$(IsAspireHost)' == 'true'"> |
30 | | - |
| 26 | + |
31 | 27 | <ProjectReference Update="@(ProjectReference)"> |
32 | 28 | <IsAspireProjectResource Condition="'%(IsAspireProjectResource)' != 'false'">true</IsAspireProjectResource> |
33 | 29 |
|
34 | | - <ReferenceOutputAssembly |
35 | | - Condition="'%(ReferenceOutputAssembly)' == '' and '%(IsAspireProjectResource)' == 'true'"> |
36 | | - false</ReferenceOutputAssembly> |
37 | | - <SkipGetTargetFrameworkProperties |
38 | | - Condition="'%(SkipGetTargetFrameworkProperties)' == '' and '%(IsAspireProjectResource)' == 'true'"> |
39 | | - true</SkipGetTargetFrameworkProperties> |
40 | | - <ExcludeAssets Condition="'%(ExcludeAssets)' == '' and '%(IsAspireProjectResource)' == 'true'"> |
41 | | - all</ExcludeAssets> |
| 30 | + <ReferenceOutputAssembly Condition="'%(ReferenceOutputAssembly)' == '' and '%(IsAspireProjectResource)' == 'true'">false</ReferenceOutputAssembly> |
| 31 | + <SkipGetTargetFrameworkProperties Condition="'%(SkipGetTargetFrameworkProperties)' == '' and '%(IsAspireProjectResource)' == 'true'">true</SkipGetTargetFrameworkProperties> |
| 32 | + <ExcludeAssets Condition="'%(ExcludeAssets)' == '' and '%(IsAspireProjectResource)' == 'true'">all</ExcludeAssets> |
42 | 33 | <Private Condition="'%(Private)' == '' and '%(IsAspireProjectResource)' == 'true'">false</Private> |
43 | 34 | </ProjectReference> |
44 | 35 |
|
45 | 36 | </ItemGroup> |
46 | 37 |
|
47 | | - <Target Name="__WarnOnAspireCapabilityMissing" BeforeTargets="PrepareForBuild" |
48 | | - Condition="!@(ProjectCapability->AnyHaveMetadataValue('Identity', 'Aspire'))"> |
49 | | - <Warning Code="ASPIRE002" |
50 | | - Text="$(MSBuildProjectName) is an Aspire AppHost project but necessary dependencies aren't present. Are you missing an Aspire.Hosting.AppHost PackageReference?" /> |
| 38 | + <Target Name="__WarnOnAspireCapabilityMissing" BeforeTargets="PrepareForBuild" Condition="!@(ProjectCapability->AnyHaveMetadataValue('Identity', 'Aspire'))"> |
| 39 | + <Warning Code="ASPIRE002" Text="$(MSBuildProjectName) is an Aspire AppHost project but necessary dependencies aren't present. Are you missing an Aspire.Hosting.AppHost PackageReference?" /> |
51 | 40 | </Target> |
52 | 41 |
|
53 | | - <Target Name="__WarnOnMininumVsVersionMissing" BeforeTargets="PrepareForBuild" |
54 | | - Condition="'$(BuildingInsideVisualStudio)' == 'true' and $([MSBuild]::VersionLessThan('$(MSBuildVersion)', '17.10.0'))"> |
55 | | - <Warning Code="ASPIRE003" |
56 | | - 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)." /> |
| 42 | + <Target Name="__WarnOnMininumVsVersionMissing" BeforeTargets="PrepareForBuild" Condition="'$(BuildingInsideVisualStudio)' == 'true' and $([MSBuild]::VersionLessThan('$(MSBuildVersion)', '17.10.0'))"> |
| 43 | + <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)." /> |
57 | 44 | </Target> |
58 | 45 |
|
59 | 46 | <!-- This target extracts the version of Aspire.Hosting.AppHost referenced by the project, and adds |
|
65 | 52 | <!-- First, we assume project is not using Central Package Management, and we try to extract the version |
66 | 53 | from PackageReference Items. --> |
67 | 54 | <ItemGroup> |
68 | | - <_AppHostPackageReference Include="@(PackageReference)" Condition="'%(Identity)' == |
69 | | - 'Aspire.Hosting.AppHost'" /> |
| 55 | + <_AppHostPackageReference Include="@(PackageReference)" Condition="'%(Identity)' == 'Aspire.Hosting.AppHost'" /> |
70 | 56 | </ItemGroup> |
71 | 57 |
|
72 | 58 | <!-- Extract the Version metadata --> |
|
78 | 64 | and we try to extract the PackageVersion Items. --> |
79 | 65 | <ItemGroup Condition="'$(_AppHostVersion)' == ''"> |
80 | 66 | <_AppHostPackageReference /> |
81 | | - <_AppHostPackageReference Include="@(PackageVersion)" Condition="'%(Identity)' == |
82 | | - 'Aspire.Hosting.AppHost'" /> |
| 67 | + <_AppHostPackageReference Include="@(PackageVersion)" Condition="'%(Identity)' == 'Aspire.Hosting.AppHost'" /> |
83 | 68 | </ItemGroup> |
84 | 69 |
|
85 | 70 | <PropertyGroup Condition="'$(_AppHostVersion)' == ''"> |
|
96 | 81 |
|
97 | 82 | <!-- Now that we have the version, we add the package references --> |
98 | 83 | <ItemGroup> |
99 | | - <PackageReference Include="Aspire.Dashboard.Sdk.$(NETCoreSdkRuntimeIdentifier)" |
100 | | - Version="$(_AppHostVersion)" IsImplicitlyDefined="true" /> |
101 | | - <PackageReference Include="Aspire.Hosting.Orchestration.$(NETCoreSdkRuntimeIdentifier)" |
102 | | - Version="$(_AppHostVersion)" IsImplicitlyDefined="true" /> |
| 84 | + <PackageReference Include="Aspire.Dashboard.Sdk.$(NETCoreSdkRuntimeIdentifier)" Version="$(_AppHostVersion)" IsImplicitlyDefined="true" /> |
| 85 | + <PackageReference Include="Aspire.Hosting.Orchestration.$(NETCoreSdkRuntimeIdentifier)" Version="$(_AppHostVersion)" IsImplicitlyDefined="true" /> |
103 | 86 | </ItemGroup> |
104 | 87 | </Target> |
105 | 88 |
|
|
0 commit comments