-
Notifications
You must be signed in to change notification settings - Fork 344
/
Tools.proj
106 lines (86 loc) · 6.52 KB
/
Tools.proj
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
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
<Project>
<Import Project="BuildStep.props" />
<!-- Properties requires by NuGet.targets to restore PackageReferences -->
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<!-- Workaround changes from newer MSBuild requiring additional properties -->
<TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)' == ''">5</TargetFrameworkVersion>
<TargetFrameworkIdentifier Condition="'$(TargetFrameworkIdentifier)' == ''">.NETFramework</TargetFrameworkIdentifier>
<TargetFrameworkMoniker Condition="'$(TargetFrameworkMoniker)' == ''">.NETFramework,Version=v4.7.2</TargetFrameworkMoniker>
<MSBuildProjectExtensionsPath>$(BaseIntermediateOutputPath)</MSBuildProjectExtensionsPath>
<!-- Internal tool restore settings -->
<!-- VisualStudio.InsertionManifests.targets: Keep condition in sync with import in AfterSigning.proj. -->
<RestoreInternalTooling Condition="'$(UsingToolVSSDK)' == 'true' and '$(GenerateSbom)' == 'true' and '$(MSBuildRuntimeType)' != 'Core'">true</RestoreInternalTooling>
<RestoreInternalToolingAfterTargets Condition="'$(RestoreInternalTooling)' == 'true'">Restore</RestoreInternalToolingAfterTargets>
</PropertyGroup>
<!--
Configure NuGet Restore to use NuGet.config file in the repository root.
We could drop a custom NuGet.config to the containing directory but it's simpler
if we use the same config for all restore operations.
NuGet.Config, NuGet.config, and nuget.config are all allowed casings according to NuGet:
https://github.com/NuGet/NuGet.Client/blob/b83566ec2369c4e9fd07e6f95d734dfe370a1e66/src/NuGet.Core/NuGet.Configuration/Settings/Settings.cs#L34-L36
-->
<PropertyGroup Condition="'$(RestoreConfigFile)' == ''">
<RestoreConfigFile Condition="Exists('$(RepoRoot)NuGet.config')">$(RepoRoot)NuGet.config</RestoreConfigFile>
<RestoreConfigFile Condition="Exists('$(RepoRoot)NuGet.Config')">$(RepoRoot)NuGet.Config</RestoreConfigFile>
<RestoreConfigFile Condition="Exists('$(RepoRoot)nuget.config')">$(RepoRoot)nuget.config</RestoreConfigFile>
</PropertyGroup>
<Import Project="$(_NuGetRestoreTargets)" />
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.NuGetRepack.Tasks" Version="$(MicrosoftDotnetNuGetRepackTasksVersion)" Condition="'$(UsingToolNuGetRepack)' == 'true'" IsImplicitlyDefined="true" />
</ItemGroup>
<!-- These package references should only be included when:
- Not in source-only mode OR
- When in source-only mode in the outer repo build but not launched from the orchestrator.
-->
<PropertyGroup>
<_ImportOrUseTooling>false</_ImportOrUseTooling>
<_ImportOrUseTooling Condition="'$(DotNetBuildSourceOnly)' != 'true' or ('$(DotNetBuildPhase)' == 'Repo' and '$(DotNetBuildOrchestrator)' != 'true')">true</_ImportOrUseTooling>
</PropertyGroup>
<ItemGroup Condition="'$(_ImportOrUseTooling)' == 'true'">
<!-- Copy of 'sn.exe' in form of NuGet package. -->
<PackageReference Include="sn" Version="$(SNVersion)" IsImplicitlyDefined="true" />
<PackageReference Include="MicroBuild.Core" Version="$(MicroBuildCoreVersion)" IsImplicitlyDefined="true" />
<PackageReference Include="MicroBuild.Core.Sentinel" Version="1.0.0" IsImplicitlyDefined="true" />
<PackageReference Include="vswhere" Version="$(VSWhereVersion)" IsImplicitlyDefined="true" />
<PackageReference Include="Microsoft.Signed.Wix" Version="$(MicrosoftSignedWixVersion)" IsImplicitlyDefined="true" />
<PackageReference Include="Microsoft.DotNet.SignTool" Version="$(MicrosoftDotNetSignToolVersion)" IsImplicitlyDefined="true" />
<PackageReference Include="Microsoft.DotNet.Tar" Version="$(MicrosoftDotNetTarVersion)" IsImplicitlyDefined="true" />
<PackageReference Include="Microsoft.SymbolUploader.Build.Task" Version="$(MicrosoftSymbolUploaderBuildTaskVersion)" Condition="'$(PublishToSymbolServer)' == 'true'" IsImplicitlyDefined="true" />
<PackageReference Include="Microsoft.DotNet.Build.Tasks.VisualStudio" Version="$(MicrosoftDotNetBuildTasksVisualStudioVersion)" Condition="'$(UsingToolVSSDK)' == 'true'" IsImplicitlyDefined="true" />
</ItemGroup>
<!-- Unlike the items above, we should restore M.D.B.T.F in source build scenarios since it's used in the inner build. -->
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Feed" Version="$(MicrosoftDotNetBuildTasksFeedVersion)" IsImplicitlyDefined="true" />
</ItemGroup>
<PropertyGroup>
<_RepoToolManifest>$([MSBuild]::NormalizePath('$(RepoRoot)', '.config', 'dotnet-tools.json'))</_RepoToolManifest>
</PropertyGroup>
<!-- When doing source-only build, we should not use these in the inner or orchestrated builds. -->
<Target Name="RestoreRepoTools"
Condition="'$(_ImportOrUseTooling)' == 'true' and Exists('$(_RepoToolManifest)')"
BeforeTargets="Restore">
<!-- Respect a restore config file passed in via /p:RestoreConfigFile, common in VMR builds -->
<PropertyGroup>
<RestoreConfigFileOption></RestoreConfigFileOption>
<RestoreConfigFileOption Condition="'$(RestoreConfigFile)' != ''">--configfile $(RestoreConfigFile)</RestoreConfigFileOption>
</PropertyGroup>
<Exec Command='"$(DotNetTool)" tool restore $(RestoreConfigFileOption)' WorkingDirectory="$(RepoRoot)" />
</Target>
<!-- Set as DependsOnTargets when internal tools (e.g. IBC data, optprof) is required -->
<Target Name="RestoreInternalTooling"
AfterTargets="$(RestoreInternalToolingAfterTargets)">
<MSBuild Projects="$(RepoRoot)eng/common/internal/Tools.csproj"
Targets="Restore"
Properties="@(_RestoreToolsProps);_NETCORE_ENGINEERING_TELEMETRY=Restore"
Condition="'$(Restore)' == 'true'"/>
</Target>
<Import Project="SourceBuild/SourceBuildArcadeTools.targets" Condition="'$(ArcadeBuildFromSource)' == 'true' or
'$(DotNetBuildRepo)' == 'true' or
'$(SetUpSourceBuildIntermediateNupkgCache)' == 'true'" />
<!-- Repository extensibility point -->
<Import Project="$(RepositoryEngineeringDir)Tools.props" Condition="Exists('$(RepositoryEngineeringDir)Tools.props')" />
<Import Project="InstallDotNetCore.targets" Condition="'$(_ImportOrUseTooling)' == 'true'" />
<Import Project="VisualStudio.AcquireOptimizationData.targets" Condition="'$(UsingToolVisualStudioIbcTraining)' == 'true'" />
</Project>