示例#1
0
 private PackInfo CreatePackInfo(WorkloadPack pack, string aliasedPath, string resolvedPackageId) => new PackInfo(
     pack.Id.ToString(),
     pack.Version,
     pack.Kind,
     aliasedPath,
     resolvedPackageId
     );
示例#2
0
        /// <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));
        }
示例#3
0
        private string GetAliasedPackPath(WorkloadPack pack)
        {
            var aliasedId = pack.TryGetAliasForRuntimeIdentifiers(_currentRuntimeIdentifiers) ?? pack.Id;

            return(GetPackPath(_dotnetRootPaths, aliasedId, pack.Version, pack.Kind));
        }
示例#4
0
 private PackInfo CreatePackInfo(WorkloadPack pack, string aliasedPath) => new PackInfo(
     pack.Id.ToString(),
     pack.Version,
     pack.Kind,
     aliasedPath
     );