private PackInfo CreatePackInfo(WorkloadPack pack, string aliasedPath, string resolvedPackageId) => new PackInfo( pack.Id.ToString(), pack.Version, pack.Kind, aliasedPath, resolvedPackageId );
/// <summary> /// Resolve the pack path for the host platform. /// </summary> /// <param name="pack">The workload pack</param> /// <returns>The path to the pack, or null if the pack is not available on the host platform.</returns> private string?ResolvePackPath(WorkloadPack pack) { var resolvedId = pack.Id; if (pack.IsAlias) { if (pack.TryGetAliasForRuntimeIdentifiers(_currentRuntimeIdentifiers) is WorkloadPackId aliasedId) { resolvedId = aliasedId; } else { return(null); } } return(GetPackPath(_dotnetRootPaths, resolvedId, pack.Version, pack.Kind)); }
private string GetAliasedPackPath(WorkloadPack pack) { var aliasedId = pack.TryGetAliasForRuntimeIdentifiers(_currentRuntimeIdentifiers) ?? pack.Id; return(GetPackPath(_dotnetRootPaths, aliasedId, pack.Version, pack.Kind)); }
private PackInfo CreatePackInfo(WorkloadPack pack, string aliasedPath) => new PackInfo( pack.Id.ToString(), pack.Version, pack.Kind, aliasedPath );