-
Notifications
You must be signed in to change notification settings - Fork 360
/
Sdk.targets
46 lines (36 loc) · 2.63 KB
/
Sdk.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<Project>
<!--
A property-based workload cannot import props files (except AutoImport.props, which has very tight limitations.
Instead, we copy everything from Aspire.Hosting.props into these targets.
This means they cannot be overridden in the csproj, and may cause ordering issues, particularly StaticWebAssets.
-->
<ItemGroup>
<ProjectCapability Include="DynamicFileNesting" />
<ProjectCapability Include="DynamicFileNestingEnabled" />
<ProjectCapability Include="AspireOrchestration" />
</ItemGroup>
<PropertyGroup>
<!-- 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.
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>
<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 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>
</Project>