-
Notifications
You must be signed in to change notification settings - Fork 4.8k
/
Copy pathlibraries-packages.proj
97 lines (81 loc) · 5.73 KB
/
libraries-packages.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
<Project>
<Import Sdk="Microsoft.Build.Traversal" Project="Sdk.props" />
<PropertyGroup>
<TraversalGlobalProperties>BuildAllProjects=true</TraversalGlobalProperties>
<AdditionalBuildTargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(AdditionalBuildTargetFrameworks);package-$(Configuration)</AdditionalBuildTargetFrameworks>
<BuildAllOOBPackages Condition="'$(BuildAllOOBPackages)' == ''">false</BuildAllOOBPackages>
</PropertyGroup>
<PropertyGroup>
<PackagingTaskAssembly>$(NuGetPackageRoot)microsoft.dotnet.build.tasks.packaging\$(MicrosoftDotNetBuildTasksPackagingVersion)\tools\</PackagingTaskAssembly>
<PackagingTaskAssembly Condition="'$(MSBuildRuntimeType)' == 'core'">$(PackagingTaskAssembly)netcoreapp2.1\</PackagingTaskAssembly>
<PackagingTaskAssembly Condition="'$(MSBuildRuntimeType)' != 'core'">$(PackagingTaskAssembly)net472\</PackagingTaskAssembly>
<PackagingTaskAssembly>$(PackagingTaskAssembly)Microsoft.DotNet.Build.Tasks.Packaging.dll</PackagingTaskAssembly>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(PkgDir)*\*.proj" Exclude="$(PkgDir)test\*" Condition="'$(BuildAllOOBPackages)' == 'true'" />
<ProjectReference Include="$(MSBuildThisFileDirectory)*\pkg\**\*.pkgproj" Condition="('$(BuildAllConfigurations)' == 'true' or '$(DotNetBuildFromSource)' == 'true') And '$(BuildAllOOBPackages)' == 'true'" />
<!-- If setting BuildAllOOBPackages to false, add bellow the individual OOB packages you want to continue to build -->
<ProjectReference Include="$(LibrariesProjectRoot)\pkg\Microsoft.Windows.Compatibility\Microsoft.Windows.Compatibility.pkgproj" Condition="'$(BuildAllConfigurations)' == 'true'" />
<ProjectReference Include="$(LibrariesProjectRoot)\System.Text.Json\pkg\System.Text.Json.pkgproj" Condition="'$(BuildAllConfigurations)' == 'true'" />
<ProjectReference Include="$(LibrariesProjectRoot)\System.Diagnostics.DiagnosticSource\pkg\System.Diagnostics.DiagnosticSource.pkgproj" Condition="'$(BuildAllConfigurations)' == 'true'" />
<ProjectReference Include="$(LibrariesProjectRoot)\System.Composition*\pkg\System.Composition*.pkgproj" Condition="'$(BuildAllConfigurations)' == 'true'" />
</ItemGroup>
<!-- Need the PackageIndexFile file property from baseline.props -->
<Import Project="$(PkgDir)baseline\baseline.props" />
<!-- Calculate PackageDownload items for restore. -->
<Import Project="$(RepositoryEngineeringDir)restore\harvestPackages.targets" Condition="'$(MSBuildRestoreSessionId)' != ''" />
<!--
Updates the package index to mark all packages we are building that can go stable as stable.
this will allow for a kicked off build to control package stability at queue time. This does edit
the package index in-place but that shouldn't cause any problems for official builds are the only
ones that might do this. After we ship a stable set of packages this target should be ran and the
changes to the package index should be commited to the repo.
-->
<UsingTask TaskName="UpdatePackageIndex" AssemblyFile="$(PackagingTaskAssembly)"/>
<Target Name="UpdatePackageIndexWithStableVersions"
BeforeTargets="Build"
Condition="'$(DotNetFinalVersionKind)' == 'release'">
<ItemGroup>
<!--
The private packages don't get stabilized so they don't need to be included
in the set of packages that we are gathering stable versions from.
-->
<PkgProjects Include="$(PkgDir)*\*.pkgproj" Exclude="$(MSBuildThisFileDirectory)pkg\*Private*\*.pkgproj" />
<PkgProjects Include="*\pkg\**\*.pkgproj" />
<PkgProjects Remove="Microsoft.Extensions.HostFactoryResolver\pkg\Microsoft.Extensions.HostFactoryResolver.Sources.pkgproj" />
<PkgProjects Remove="System.Numerics.Tensors\pkg\System.Numerics.Tensors.pkgproj" />
<PkgProjects Remove="$(PkgDir)Microsoft.Extensions.Internal.Transport\Microsoft.Extensions.Internal.Transport.pkgproj" />
</ItemGroup>
<MSBuild Targets="GetPackageIdentityIfStable"
BuildInParallel="$(BuildInParallel)"
Projects="@(PkgProjects)"
RemoveProperties="Configuration">
<Output TaskParameter="TargetOutputs" ItemName="_StablePackages" />
</MSBuild>
<Message Text="Marking package '%(_StablePackages.Identity)' stable with version '%(_StablePackages.Version)'" />
<UpdatePackageIndex
PackageIndexFile="$(PackageIndexFile)"
StablePackages="@(_StablePackages)" />
</Target>
<!-- Generate a version text file we include in our packages -->
<Target Name="GenerateVersionFileForPackages"
BeforeTargets="Build"
DependsOnTargets="InitializeSourceControlInformationFromSourceControlManager">
<Error Condition="'$(SourceRevisionId)' == ''" Text="SourceRevisionId is not set, which means the SourceLink targets are not included in the build. Those are needed to produce a correct sha for our build outputs." />
<MakeDir Directories="$([System.IO.Path]::GetDirectoryName($(VersionFileForPackages)))" />
<WriteLinesToFile File="$(VersionFileForPackages)"
Lines="$(SourceRevisionId)"
Overwrite="true" />
</Target>
<Target Name="SetAzureDevOpsVariableForBuiltPackages"
Condition="'$(ContinuousIntegrationBuild)' == 'true'"
AfterTargets="Build">
<ItemGroup>
<_PackageReports Include="$(PackageReportDir)*.json" />
</ItemGroup>
<Message Condition="'@(_PackageReports)' != '' and Exists('$(ArtifactsDir)packages')" Importance="High" Text="##vso[task.setvariable variable=_librariesBuildProducedPackages]true" />
</Target>
<Import Sdk="Microsoft.Build.Traversal" Project="Sdk.targets" />
<!-- Pack is a no-op and should just invoke build. -->
<Target Name="Pack" DependsOnTargets="Build" />
</Project>