forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackages.builds
83 lines (67 loc) · 3.66 KB
/
packages.builds
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
<Project>
<Import Project="$(MSBuildThisFileDirectory)Directory.Build.props" />
<PropertyGroup Condition="'$(DotNetBuildFromSource)' == 'true'">
<AdditionalBuildConfigurations>$(AdditionalBuildConfigurations);package-$(Configuration)</AdditionalBuildConfigurations>
</PropertyGroup>
<ItemGroup Condition="'$(SkipManagedPackageBuild)' != 'true'">
<Project Include="$(PkgDir)*\*.builds" >
<AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
</Project>
<Project Include="*\pkg\**\*.pkgproj" Condition="'$(BuildAllConfigurations)' == 'true' OR '$(DotNetBuildFromSource)' == 'true'">
<AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
</Project>
</ItemGroup>
<!-- Need the PackageIndexFile file property from baseline.props -->
<Import Project="$(PkgDir)baseline\baseline.props" />
<UsingTask TaskName="UpdatePackageIndex" AssemblyFile="$(PackagingTaskDir)Microsoft.DotNet.Build.Tasks.Packaging.dll"/>
<!--
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.
-->
<Target Name="UpdatePackageIndexWithStableVersions"
BeforeTargets="BuildAllProjects"
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" />
</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="BuildAllProjects"
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>
<Import Project="$(MSBuildThisFileDirectory)dir.traversal.targets" />
<Target Name="SetAzureDevOpsVariableForBuiltPackages"
Condition="'$(ContinuousIntegrationBuild)' == 'true'"
AfterTargets="BuildAllProjects">
<ItemGroup>
<_PackageReports Include="$(PackageReportDir)*.json" />
</ItemGroup>
<Message Condition="'@(_PackageReports)' != ''" Importance="High" Text="##vso[task.setvariable variable=_librariesBuildProducedPackages]true" />
</Target>
</Project>