This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
/
harvestPackages.depproj
58 lines (48 loc) · 2.81 KB
/
harvestPackages.depproj
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
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
</PropertyGroup>
<Import Project="harvestPackages.props" />
<Import Project="$(ProjectDir)pkg/baseline/baseline.props" />
<!--
Custom target to update the stable versions. Ideally we would just run this target as part of the build but
currently the restore step happens in CLI which doesn't have matching dependencies for the package task. Currently
they have different versions of nuget libraries. We can look at fixing that in the future but for now this will need
to be manually run to update the harvestPackages.props file.
-->
<Target Name="UpdateToLatestStablePackages">
<ItemGroup>
<PackageReference>
<!-- Set version to highest version possible to ensure we get the highest stable package version -->
<Version>255.255.255</Version>
</PackageReference>
</ItemGroup>
<GetLastStablePackage
LatestPackages="@(PackageReference)"
PackageIndexes="$(PackageIndexFile)">
<Output TaskParameter="LastStablePackages" ItemName="_NewPackageReferences" />
</GetLastStablePackage>
<ItemGroup>
<_NewPackageReferences Condition="'%(Identity)' == 'System.Reflection.TypeExtensions'">
<!-- harvest from 4.4.0 until we ship a new stable package -->
<Version Condition="'%(Version)' == '4.5.0'">4.4.0</Version>
</_NewPackageReferences>
</ItemGroup>
<ItemGroup>
<_Lines Include="<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">" />
<_Lines Include="<!-- The versions can be updated by running UpdateToLatestStablePackages target in harvestPackages.depproj -->" />
<_Lines Include="<ItemGroup>" />
<_Lines Include="<PackageReference Include="%(_NewPackageReferences.Identity)"> <Version>%(_NewPackageReferences.Version)</Version> </PackageReference>" />
<_Lines Include="</ItemGroup>" />
<_Lines Include="</Project>" />
</ItemGroup>
<WriteLinesToFile Lines="@(_Lines)" File="harvestPackages.props" Overwrite="true" />
</Target>
<!-- only restore this project during the build, don't copy any of it's packages
The sole purpose of this project is to download packages that can be examined
for harvesting binaries & support. -->
<Target Name="Build" DependsOnTargets="RestorePackages" />
</Project>