Skip to content

Commit

Permalink
Supply RuntimeIdentifier graph to NuGet
Browse files Browse the repository at this point in the history
Fix #3325
  • Loading branch information
dsplaisted committed Jul 8, 2019
1 parent 08c09e3 commit 2723589
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 46 deletions.
34 changes: 0 additions & 34 deletions src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ public class ProcessFrameworkReferences : TaskBase
[Output]
public ITaskItem[] PackagesToDownload { get; set; }

[Output]
public ITaskItem[] LegacyFrameworkPackages { get; set; }

[Output]
public ITaskItem[] RuntimeFrameworks { get; set; }

Expand Down Expand Up @@ -84,7 +81,6 @@ protected override void ExecuteCore()
var frameworkReferenceMap = FrameworkReferences.ToDictionary(fr => fr.ItemSpec, StringComparer.OrdinalIgnoreCase);

List<ITaskItem> packagesToDownload = new List<ITaskItem>();
List<ITaskItem> legacyFrameworkPackages = new List<ITaskItem>();
List<ITaskItem> runtimeFrameworks = new List<ITaskItem>();
List<ITaskItem> targetingPacks = new List<ITaskItem>();
List<ITaskItem> runtimePacks = new List<ITaskItem>();
Expand Down Expand Up @@ -112,18 +108,6 @@ protected override void ExecuteCore()
continue;
}

if (frameworkReference != null && !string.IsNullOrEmpty(knownFrameworkReference.LegacyFrameworkPackages))
{
foreach (var packageAndVersion in knownFrameworkReference.LegacyFrameworkPackages.Split(';'))
{
var items = packageAndVersion.Split('/');
TaskItem packageToReference = new TaskItem(items[0]);
packageToReference.SetMetadata(MetadataKeys.Version, items[1]);

legacyFrameworkPackages.Add(packageToReference);
}
}

// Get the path of the targeting pack in the targeting pack root (e.g. dotnet/ref)
TaskItem targetingPack = new TaskItem(knownFrameworkReference.Name);
targetingPack.SetMetadata(MetadataKeys.PackageName, knownFrameworkReference.TargetingPackName);
Expand Down Expand Up @@ -230,11 +214,6 @@ protected override void ExecuteCore()
PackagesToDownload = packagesToDownload.ToArray();
}

if (legacyFrameworkPackages.Any())
{
LegacyFrameworkPackages = legacyFrameworkPackages.ToArray();
}

if (runtimeFrameworks.Any())
{
RuntimeFrameworks = runtimeFrameworks.ToArray();
Expand Down Expand Up @@ -412,19 +391,6 @@ public KnownFrameworkReference(ITaskItem item)

public string Profile => _item.GetMetadata("Profile");

public string LegacyFrameworkPackages
{
get
{
var packages = _item.GetMetadata("LegacyFrameworkPackages");
if (string.IsNullOrEmpty(packages))
{
packages = _item.GetMetadata("PackagesToReference");
}
return packages;
}
}

public NuGetFramework TargetFramework { get; }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ Copyright (c) .NET Foundation. All rights reserved.
Should be re-visited when multiple TFM support is added to Dependencies logic.
-->
<DefaultImplicitPackages>Microsoft.NETCore.App;NETStandard.Library</DefaultImplicitPackages>

<!-- Set RuntimeIdentifier graph for NuGet -->
<RuntimeIdentifierGraphPath Condition="'$(RuntimeIdentifierGraphPath)' == ''">$(BundledRuntimeIdentifierGraphFile)</RuntimeIdentifierGraphPath>
</PropertyGroup>

<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ Copyright (c) .NET Foundation. All rights reserved.
EnableTargetingPackDownload="$(EnableTargetingPackDownload)">

<Output TaskParameter="PackagesToDownload" ItemName="_PackageToDownload" />
<Output TaskParameter="LegacyFrameworkPackages" ItemName="_LegacyFrameworkPackage" />
<Output TaskParameter="RuntimeFrameworks" ItemName="RuntimeFramework" />
<Output TaskParameter="TargetingPacks" ItemName="TargetingPack" />
<Output TaskParameter="RuntimePacks" ItemName="RuntimePack" />
Expand Down Expand Up @@ -121,17 +120,6 @@ Copyright (c) .NET Foundation. All rights reserved.
PrivateAssets="all"
ExcludeAssets="all" />
</ItemGroup>

<!-- Only add these "legacy" package references if there are already existing package references,
as they are only needed in those scenarios (for example supplying the RID graph to
NuGet, or preventing older versions of Framework packages from being used). -->
<ItemGroup Condition="'@(PackageReference)' != '' and '$(DisableImplicitFrameworkReferences)' != 'true'">
<PackageReference Include="@(_LegacyFrameworkPackage)"
IsImplicitlyDefined="true"
PrivateAssets="all"
ExcludeAssets="all" />
</ItemGroup>

</Target>

<!--
Expand Down

0 comments on commit 2723589

Please sign in to comment.