Skip to content

Commit

Permalink
dotnet#7880 - rev MicrosoftNetSdkWorkloadManifestReaderVersion to RTM…
Browse files Browse the repository at this point in the history
… version
  • Loading branch information
MattGal committed Oct 18, 2021
1 parent 0849f98 commit 39e1bfd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<MicrosoftDotNetXHarnessCLIVersion>1.0.0-prerelease.21511.3</MicrosoftDotNetXHarnessCLIVersion>
<MicrosoftSymbolUploaderBuildTaskVersion>2.0.0-preview.1.21474.2</MicrosoftSymbolUploaderBuildTaskVersion>
<MicrosoftSymbolUploaderVersion>2.0.0-preview.1.21474.2</MicrosoftSymbolUploaderVersion>
<MicrosoftNetSdkWorkloadManifestReaderVersion>6.0.100-preview.5.21254.11</MicrosoftNetSdkWorkloadManifestReaderVersion>
<MicrosoftNetSdkWorkloadManifestReaderVersion>6.0.100-rtm.21515.10</MicrosoftNetSdkWorkloadManifestReaderVersion>
<MicrosoftDeploymentDotNetReleasesVersion>1.0.0-preview1.1.21116.1</MicrosoftDeploymentDotNetReleasesVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class VisualStudioComponentTests
public void ItAssignsDefaultValues()
{
WorkloadManifest manifest = Create("WorkloadManifest.json");
WorkloadDefinition definition = manifest.Workloads.FirstOrDefault().Value;
WorkloadDefinition definition = (WorkloadDefinition)manifest.Workloads.FirstOrDefault().Value;
VisualStudioComponent component = VisualStudioComponent.Create(null, manifest, definition, NoItems, NoItems, NoItems, NoItems);

string swixProjDirectory = RandomPath;
Expand All @@ -40,7 +40,7 @@ public void ItAssignsDefaultValues()
public void ItCanOverrideDefaultValues()
{
WorkloadManifest manifest = Create("WorkloadManifest.json");
WorkloadDefinition definition = manifest.Workloads.FirstOrDefault().Value;
WorkloadDefinition definition = (WorkloadDefinition)manifest.Workloads.FirstOrDefault().Value;

ITaskItem[] resources = new ITaskItem[]
{
Expand Down Expand Up @@ -68,7 +68,7 @@ public void ItCanOverrideDefaultValues()
public void ItCreatesSafeComponentIds()
{
WorkloadManifest manifest = Create("WorkloadManifest.json");
WorkloadDefinition definition = manifest.Workloads.FirstOrDefault().Value;
WorkloadDefinition definition = (WorkloadDefinition)manifest.Workloads.FirstOrDefault().Value;
VisualStudioComponent component = VisualStudioComponent.Create(null, manifest, definition, NoItems, NoItems, NoItems, NoItems);

string swixProjDirectory = RandomPath;
Expand All @@ -84,7 +84,7 @@ public void ItCreatesSafeComponentIds()
public void ItCreatesComponentsWhenWorkloadsDoNotIncludePacks()
{
WorkloadManifest manifest = Create("mauiWorkloadManifest.json");
WorkloadDefinition definition = manifest.Workloads.FirstOrDefault().Value;
WorkloadDefinition definition = (WorkloadDefinition)manifest.Workloads.FirstOrDefault().Value;
VisualStudioComponent component = VisualStudioComponent.Create(null, manifest, definition, NoItems, NoItems, NoItems, NoItems);

string swixProjDirectory = RandomPath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,11 @@ private IEnumerable<WorkloadPack> GetWorkloadPacks()
// platform includes Windows
var workloads = manifests.SelectMany(m => m.Workloads).
Select(w => w.Value).
Where(wd => (wd.Platforms == null) || wd.Platforms.Any(p => p.StartsWith("win")));
Where(wd => wd is WorkloadDefinition).
Where(wd => (((WorkloadDefinition)wd).Platforms == null) || ((WorkloadDefinition)wd).Platforms.Any(p => p.StartsWith("win")));

var packIds = workloads.Where(w => w.Packs != null).SelectMany(w => w.Packs).Distinct();
var packIds = workloads.Where(wd => wd is WorkloadDefinition).
Where(w => (((WorkloadDefinition)w).Packs != null)).SelectMany(w => ((WorkloadDefinition)w).Packs).Distinct();

return manifests.SelectMany(m => m.Packs.Values).
Where(p => packIds.Contains(p.Id)).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public static VisualStudioComponent Create(TaskLoggingHelper log, WorkloadManife
// processing direct pack dependencies
if (workload.Extends?.Count() > 0)
{
foreach (WorkloadDefinitionId dependency in workload.Extends)
foreach (WorkloadId dependency in workload.Extends)
{
// Component dependencies, aka. workload extensions only have minimum version dependencies.
component.AddDependency($"{Utils.ToSafeId(dependency.ToString())}", new Version("1.0.0.0"), maxVersion: null);
Expand Down

0 comments on commit 39e1bfd

Please sign in to comment.