Repository navigation
Expand file tree
/
Copy pathredist.csproj
More file actions
150 lines (133 loc) · 11.6 KB
/
Copy pathredist.csproj
File metadata and controls
150 lines (133 loc) · 11.6 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>$(SdkTargetFramework)</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<CopyBuildOutputToPublishDirectory>false</CopyBuildOutputToPublishDirectory>
<AssetTargetFallback>dotnet5.4</AssetTargetFallback>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<DisableImplicitNETCorePlatformsReference>true</DisableImplicitNETCorePlatformsReference>
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
<!-- do not import analyzer assemblies from the sdk as they will be double loaded -->
<EnableNETAnalyzers>false</EnableNETAnalyzers>
<!-- Disable the fast up-to-date check as it relies on the redist.dll, which we delete as part of the build process in GenerateLayout.targets. -->
<!-- Property info: https://github.com/dotnet/project-system/blob/main/docs/up-to-date-check.md#disabling-the-up-to-date-check -->
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
<!-- NETSDK1205: The Microsoft.Net.Compilers.Toolset.Framework package should not be set directly. -->
<MSBuildWarningsAsMessages>$(MSBuildWarningsAsMessages);NETSDK1205</MSBuildWarningsAsMessages>
<!-- The D.B.targets file is in subfolder so that the tools projects don't import it. -->
<DirectoryBuildTargetsPath>$(MSBuildThisFileDirectory)targets\Directory.Build.targets</DirectoryBuildTargetsPath>
<!-- Needed to calculate the stable FileVersion for the sdk bundle version. -->
<IsShippingPackage>true</IsShippingPackage>
<NoWarn>$(NoWarn);NU1505</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NuGet.Build.Tasks" />
<PackageReference Include="NuGet.Build.Tasks.Console" />
<PackageReference Include="NuGet.Common" /><!-- Keeps this from being bumped by transitive refs (templating) -->
<PackageReference Include="Microsoft.Build.NuGetSdkResolver" />
<PackageReference Include="Microsoft.TestPlatform.CLI" ExcludeAssets="All" />
<PackageReference Include="Microsoft.TestPlatform.Build" />
<PackageReference Include="NuGet.Localization" />
<PackageReference Include="NuGet.ProjectModel" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" ExcludeAssets="All" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic.CodeStyle" ExcludeAssets="All" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.FSharp.Compiler" ExcludeAssets="All" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.NET.Sdk.Razor.SourceGenerators.Transport" GeneratePathProperty="true" />
<PackageDownload Include="Microsoft.Net.Compilers.Toolset" Version="[$(MicrosoftNetCompilersToolsetVersion)]" />
<PackageReference Include="Microsoft.Net.Compilers.Toolset.Framework" ExcludeAssets="All" GeneratePathProperty="true" Condition="'$(DotNetBuildSourceOnly)' != 'true'" />
<!-- Lift up dependencies of dependencies to prevent build tasks from getting pinned to older versions -->
<PackageReference Include="System.CodeDom" />
<PackageReference Include="System.Security.Cryptography.ProtectedData" />
<PackageReference Include="System.Resources.Extensions" />
<!-- Override to use the newest version. In source-only modes this will be a no-diff change. -->
<PackageReference Include="Microsoft.Build.Runtime" VersionOverride="$(MicrosoftBuildVersion)" />
<PackageReference Include="Microsoft.Build" VersionOverride="$(MicrosoftBuildVersion)" />
<PackageReference Include="Microsoft.Build.Tasks.Core" VersionOverride="$(MicrosoftBuildVersion)" />
<PackageReference Include="Microsoft.Build.Framework" VersionOverride="$(MicrosoftBuildVersion)" />
<PackageReference Include="Microsoft.Build.Utilities.Core" VersionOverride="$(MicrosoftBuildVersion)" />
<PackageReference Include="Microsoft.NET.StringTools" VersionOverride="$(MicrosoftBuildVersion)" />
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Installers" PrivateAssets="all" />
</ItemGroup>
<ItemGroup Condition="'$(GenerateSdkBundleOnly)' != 'true'">
<!-- These project references with ReferenceOutputAssembly="false" should also set SkipGetTargetFrameworkProperties="true". Otherwise, only the inner
build of a multi-targeted project will be built to fulfill the project reference, and if the redist project depends on output that is created
in the outer build (which is the case for some of these references), there may be sporadic incorrect builds if the outer build happens to run concurrently
with or after the redist build. -->
<ProjectReference Include="..\..\Containers\packaging\package.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" Private="false" />
<ProjectReference Include="tools\tool_msbuild.csproj" />
<ProjectReference Include="tools\tool_nuget.csproj" />
<ProjectReference Include="tools\tool_projectdata.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" Private="false" />
<ProjectReference Include="..\..\Cli\dotnet\dotnet.csproj" />
<ProjectReference Include="..\..\Workloads\Manifests\manifest-packages.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" />
<ProjectReference Include="..\..\Tasks\Microsoft.NET.Build.Tasks\Microsoft.NET.Build.Tasks.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" />
<ProjectReference Include="..\..\Tasks\Microsoft.NET.Build.Extensions.Tasks\Microsoft.NET.Build.Extensions.Tasks.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" />
<ProjectReference Include="..\..\Resolvers\Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver\Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.csproj" />
<!-- The outer (cross-targeting) build of these projects produces each SDK's content (Sdk\Sdk.props, Sdk\Sdk.targets
and targets\*) under artifacts\bin\$(Configuration)\Sdks\<SdkName>, which the PublishNetSdks target then copies
into the layout. These references provide the build-ordering edge so the content exists before that copy;
SkipGetTargetFrameworkProperties="true" is required so the outer build (which emits the content) is demanded,
not just an inner build. Without them, CopyAdditionalFilesToLayout can run after the copy and produce a layout
missing Sdk.props, which fails downstream restores with "Could not resolve SDK" (https://github.com/dotnet/sdk/issues/51530). -->
<ProjectReference Include="..\..\RazorSdk\Tasks\Microsoft.NET.Sdk.Razor.Tasks.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" Private="false" />
<ProjectReference Include="..\..\StaticWebAssetsSdk\Tasks\Microsoft.NET.Sdk.StaticWebAssets.Tasks.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" Private="false" />
<ProjectReference Include="..\..\BlazorWasmSdk\Tasks\Microsoft.NET.Sdk.BlazorWebAssembly.Tasks.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" Private="false" />
<ProjectReference Include="..\..\WasmSdk\Tasks\Microsoft.NET.Sdk.WebAssembly.Tasks.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" Private="false" />
<ProjectReference Include="$(RepoRoot)src\Dotnet.Watch\dotnet-watch\dotnet-watch.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" Private="false" />
<ProjectReference Include="$(RepoRoot)src\Dotnet.Format\dotnet-format\dotnet-format.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" Private="false" />
<!-- The PublishDotnetAot target in GenerateLayout.targets calls <MSBuild Targets="Publish"> on
dotnet-aot.csproj. That call passes _IsPublishing=true, which makes it a different
BuildManager project instance than the outer build's evaluation of dotnet-aot.csproj.
Without an explicit reference, the outer Build (writing to bin\dotnet-aot\...) and the
Publish call's internal Build (writing to the same paths) can run concurrently and
race over shared bin\ and obj\ directories. This ProjectReference sequences the outer
Build to complete before redist's GenerateSdkLayout target runs.
Conditioned on the same check as the PublishDotnetAot target itself (_ShouldPublishDotnetAot)
so unsupported target platforms don't pull NativeAOT compiler/runtime packs into the restore
graph. Supported Source Build configurations produce these packs from source and retain this
project reference. -->
<ProjectReference Include="$(RepoRoot)src\Cli\dotnet-aot\dotnet-aot.csproj"
Condition="'$(_ShouldPublishDotnetAot)' == 'true'"
ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" Private="false" />
<ProjectReference Include="$(RepoRoot)template_feed\*\*.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" Private="false" />
<ProjectReference Include="$(RepoRoot)src\Microsoft.CodeAnalysis.NetAnalyzers\src\Microsoft.CodeAnalysis.NetAnalyzers.Package.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" Private="false" />
</ItemGroup>
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
<ProjectReference Include="..\pkg\windows\bundles\sdk\bundle.wixproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" Condition="'$(MSBuildRestoreSessionId)' != ''" />
<ProjectReference Include="..\finalizer\finalizer.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" Private="false" />
</ItemGroup>
<!-- In .NET product build mode, explicitly build workloads in build pass 2.
In the SDK official build, build workloads as part of win-x64. -->
<ItemGroup Condition="'$(OS)' == 'Windows_NT' and '$(SkipBuildingInstallers)' != 'true' and '$(DotNetBuild)' != 'true' and '$(BuildWorkloads)' == 'true'">
<ProjectReference Include="$(RepoRoot)src\Workloads\VSInsertion\workloads.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" Private="false" />
</ItemGroup>
<ItemGroup>
<Content Include="minimumMSBuildVersion">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="trustedroots\codesignctl.pem">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="trustedroots\timestampctl.pem">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<!-- We will reference newer analyzer packages that what can be referenced by the SDK we build with
To break the cycle we remove all analyzers before this compiles. -->
<Target Name="RemoveAnalyzers" BeforeTargets="CoreCompile">
<ItemGroup>
<Analyzer Remove="@(Analyzer)" />
</ItemGroup>
</Target>
<Target Name="RemoveMSBuildRef" AfterTargets="ResolvePackageAssets">
<!-- MSBuild.dll is now in the ref folder of the Microsoft.Build.Runtime NuGet package.
This counter-intuitively was stopping it from being written to the deps.json file.
(This may have been because there wasn't a corresponding implementation in the lib
folder).
This target works around that by removing the item that is generated from the
ref assembly in the NuGet package. -->
<ItemGroup>
<ResolvedCompileFileDefinitions Remove="@(ResolvedCompileFileDefinitions)" Condition="'%(FileName)' == 'MSBuild'" />
</ItemGroup>
</Target>
<Target Name="ReturnProductVersion" Returns="$(FullNugetVersion)" />
</Project>