Skip to content

Commit c843f9c

Browse files
committed
Remove cli patch 11: use PVP to set aspnet version
1 parent fc92b33 commit c843f9c

File tree

4 files changed

+27
-25
lines changed

4 files changed

+27
-25
lines changed

patches/cli/0011-Set-AspNetCore-version-to-final.patch

Lines changed: 0 additions & 25 deletions
This file was deleted.

repos/cli.proj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@
4040
<OrchestratedManifestBuildName>N/A</OrchestratedManifestBuildName>
4141
</PropertyGroup>
4242

43+
<ItemGroup>
44+
<ExtraPackageVersionPropsPackageInfo
45+
Include="
46+
Microsoft.AspNetCore.All;
47+
Microsoft.AspNetCore.App;
48+
Microsoft.NET.Sdk.Razor"
49+
Version="2.1.0-preview2-final" />
50+
</ItemGroup>
51+
4352
<ItemGroup>
4453
<RepositoryReference Include="application-insights" />
4554
<RepositoryReference Include="cli-migrate" />

repos/dir.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@
157157
<_PreviouslySourceBuiltPackages Include="$(SourceBuiltPackagesPath)*.nupkg" />
158158
</ItemGroup>
159159
<WriteBuildOutputProps NuGetPackages="@(_PreviouslySourceBuiltPackages)"
160+
ExtraPackageInfo="@(ExtraPackageVersionPropsPackageInfo)"
160161
OutputPath="$(PackageVersionPropsPath)" />
161162

162163
<ReadLinesFromFile File="$(PackageVersionPropsPath)">

tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks/WriteBuildOutputProps.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
using Microsoft.Build.Utilities;
77
using NuGet.Packaging;
88
using NuGet.Packaging.Core;
9+
using NuGet.Versioning;
10+
using System.Collections.Generic;
911
using System.IO;
1012
using System.Linq;
1113
using System.Text;
@@ -21,6 +23,20 @@ public class WriteBuildOutputProps : Task
2123
[Required]
2224
public string OutputPath { get; set; }
2325

26+
/// <summary>
27+
/// Package id/versions to add to the build output props, which may not exist as nupkgs.
28+
///
29+
/// %(Identity): Package identity.
30+
/// %(Version): Package version.
31+
/// </summary>
32+
public ITaskItem[] ExtraPackageInfo { get; set; }
33+
34+
private IEnumerable<PackageIdentity> ExtraPackageIdentities => ExtraPackageInfo
35+
?.Select(item => new PackageIdentity(
36+
item.GetMetadata("Identity"),
37+
NuGetVersion.Parse(item.GetMetadata("Version"))))
38+
?? Enumerable.Empty<PackageIdentity>();
39+
2440
public override bool Execute()
2541
{
2642
PackageIdentity[] latestPackages = NuGetPackages
@@ -31,6 +47,7 @@ public override bool Execute()
3147
return reader.GetIdentity();
3248
}
3349
})
50+
.Concat(ExtraPackageIdentities)
3451
.GroupBy(identity => identity.Id)
3552
.Select(g => g.OrderBy(id => id.Version).Last())
3653
.OrderBy(id => id.Id)

0 commit comments

Comments
 (0)