コード例 #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
ファイル: WorkloadResolver.cs プロジェクト: joelweiss/sdk
        private string GetAliasedPackPath(WorkloadPack pack)
        {
            var aliasedId = pack.TryGetAliasForRuntimeIdentifiers(_currentRuntimeIdentifiers) ?? pack.Id;

            return(GetPackPath(_dotnetRootPaths, aliasedId, pack.Version, pack.Kind));
        }
コード例 #4
0
ファイル: WorkloadResolver.cs プロジェクト: joelweiss/sdk
 private PackInfo CreatePackInfo(WorkloadPack pack, string aliasedPath) => new PackInfo(
     pack.Id.ToString(),
     pack.Version,
     pack.Kind,
     aliasedPath
     );