-
Notifications
You must be signed in to change notification settings - Fork 59
/
Build.props
94 lines (78 loc) · 5.75 KB
/
Build.props
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
<Project>
<ItemGroup Condition="'$(GeneratePackageSource)' == 'true'">
<ProjectToBuild Include="$(RepoRoot)src\packageSourceGenerator\PackageSourceGenerator.proj" />
</ItemGroup>
<ItemGroup Condition="'$(Test)' == 'true'">
<ProjectToBuild Include="$(RepoRoot)tests\SbrpTests\Sbrp.Tests.csproj" Test="$(Test)" />
</ItemGroup>
<ItemGroup Condition="'$(GeneratePackageSource)' != 'true' and '$(Test)' != 'true'">
<!--
All new projects must be added to DependencyPackageProjects. This will ensure that they get built first
and in order of inclusion. The resulting packages from these projects will get added the source-build
package cache when building with source-build to prevent prebuilts.
All newly added packages should be grouped together at the end of the list separated by empty lines.
The reason this is important is that when previous source-built artifacts are updated, the entries
for the new projects it includes can be removed. New PRs may miss that cut and if they are not grouped
at the bottom, this management becomes more difficult.
Format:
<DependencyPackageProjects Include="$(RepoRoot)src\referencePackages\src\**\Microsoft.Extensions.Options.5.0.0.csproj" />
-->
<DependencyPackageProjects Include="$(RepoRoot)src\referencePackages\src\**\NuGet.Frameworks.6.11.0.csproj" />
<DependencyPackageProjects Include="$(RepoRoot)src\referencePackages\src\**\NuGet.Common.6.11.0.csproj" />
<DependencyPackageProjects Include="$(RepoRoot)src\referencePackages\src\**\NuGet.Configuration.6.11.0.csproj" />
<DependencyPackageProjects Include="$(RepoRoot)src\referencePackages\src\**\NuGet.Versioning.6.11.0.csproj" />
<DependencyPackageProjects Include="$(RepoRoot)src\referencePackages\src\**\NuGet.Packaging.6.11.0.csproj" />
<DependencyPackageProjects Include="$(RepoRoot)src\referencePackages\src\**\Nuget.LibraryModel.6.11.0.csproj" />
<DependencyPackageProjects Include="$(RepoRoot)src\referencePackages\src\**\Nuget.Protocol.6.11.0.csproj" />
<DependencyPackageProjects Include="$(RepoRoot)src\referencePackages\src\**\Nuget.DependencyResolver.core.6.11.0.csproj" />
<DependencyPackageProjects Include="$(RepoRoot)src\referencePackages\src\**\Nuget.Credentials.6.11.0.csproj" />
<DependencyPackageProjects Include="$(RepoRoot)src\referencePackages\src\**\Nuget.ProjectModel.6.11.0.csproj" />
<DependencyPackageProjects Include="$(RepoRoot)src\referencePackages\src\**\Nuget.Commands.6.11.0.csproj" />
<DependencyPackageProjects Include="$(RepoRoot)src\referencePackages\src\**\System.Text.Json.8.0.5.csproj" />
<DependencyPackageProjects Include="$(RepoRoot)src\textOnlyPackages\src\**\Microsoft.NetCore.Platforms.3.1.0.csproj" />
<DependencyPackageProjects Include="$(RepoRoot)src\referencePackages\src\**\Microsoft.Bcl.HashCode.6.0.0-preview.1.24529.4.csproj" />
<DependencyPackageProjects Include="$(RepoRoot)src\referencePackages\src\**\System.Buffers.4.6.0-preview.1.24529.4.csproj" />
<DependencyPackageProjects Include="$(RepoRoot)src\referencePackages\src\**\System.Numerics.Vectors.4.6.0-preview.1.24531.1.csproj" />
<DependencyPackageProjects Include="$(RepoRoot)src\referencePackages\src\**\System.Runtime.CompilerServices.Unsafe.6.1.0-preview.1.24529.4.csproj" />
<DependencyPackageProjects Include="$(RepoRoot)src\referencePackages\src\**\System.Memory.4.6.0-preview.1.24529.4.csproj" />
<DependencyPackageProjects Include="$(RepoRoot)src\referencePackages\src\**\System.Threading.Tasks.Extensions.4.6.0-preview.1.24529.4.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(BuildDependencyPackageProjects)' == 'true'">
<!-- Building an empty project triggers building the Arcade Tools.proj which is needed before BuildDependencyPackageProjects -->
<ProjectToBuild Include="$(RepoRoot)\eng\NoOp.csproj" />
</ItemGroup>
<Target Name="BuildDependencyPackageProjects"
AfterTargets="Execute"
Condition="'$(BuildDependencyPackageProjects)' == 'true'"
Outputs="%(DependencyPackageProjects.Identity)">
<MSBuild Condition="'@(DependencyPackageProjects)' != ''"
Projects="@(DependencyPackageProjects)"
Targets="Restore;Build;Pack" />
<Copy Condition="'$(LocalNuGetPackageCacheDirectory)' != ''"
SourceFiles="@(DependencyPackageProjects->'$(ArtifactsShippingPackagesDir)%(FileName).nupkg')"
DestinationFolder="$(LocalNuGetPackageCacheDirectory)" />
</Target>
<ItemGroup Condition="'$(GeneratePackageSource)' != 'true' and '$(BuildDependencyPackageProjects)' != 'true' and '$(Test)' != 'true'">
<TargetingPackageProject Include="$(RepoRoot)src\targetPacks\ILsrc\**\*.csproj" />
<ProjectToBuild Include="@(TargetingPackageProject)" />
<TextOnlyPackageProject Include="$(RepoRoot)src\textOnlyPackages\src\*\*\*.csproj" />
<ProjectToBuild Include="@(TextOnlyPackageProject)" />
<ReferencePackageProject Include="$(RepoRoot)src\referencePackages\src\**\*.csproj" />
<ProjectToBuild Include="@(ReferencePackageProject)" />
<ProjectToBuild Remove="@(DependencyPackageProjects)" />
</ItemGroup>
<!--
Adding new projects is somewhat copy-paste heavy and may result in project name overlaps. Catch
that early, as it may cause binclash otherwise.
-->
<Target Name="EnsureUniqueProjectNames"
BeforeTargets="Execute">
<ItemGroup>
<ProjectToBuildName Include="@(ProjectToBuild -> '%(Filename)%(Extension)')" />
<DistinctProjectToBuildName Include="@(ProjectToBuildName->Distinct())" />
</ItemGroup>
<Error
Condition="@(ProjectToBuildName->Count()) != @(DistinctProjectToBuildName->Count())"
Text="A project name is duplicated. Every project name must be distinct to have separate output directories." />
</Target>
</Project>