示例#1
0
        private PackageRestoreUnconfiguredInput MergeRestoreInputs(IReadOnlyCollection <PackageRestoreConfiguredInput> inputs)
        {
            // If there are no updates, we have no active configurations
            ProjectRestoreInfo?restoreInfo = null;

            if (inputs.Count != 0)
            {
                // We need to combine the snapshots from each implicitly active configuration (ie per TFM),
                // resolving any conflicts, which we'll report to the user.
                string               msbuildProjectExtensionsPath = ResolveMSBuildProjectExtensionsPathConflicts(inputs);
                string               originalTargetFrameworks     = ResolveOriginalTargetFrameworksConflicts(inputs);
                string               projectAssetsFilePath        = ResolveProjectAssetsFilePathConflicts(inputs);
                IVsReferenceItems    toolReferences   = ResolveToolReferenceConflicts(inputs);
                IVsTargetFrameworks2 targetFrameworks = GetAllTargetFrameworks(inputs);

                restoreInfo = new ProjectRestoreInfo(
                    msbuildProjectExtensionsPath,
                    projectAssetsFilePath,
                    originalTargetFrameworks,
                    targetFrameworks,
                    toolReferences);
            }

            return(new PackageRestoreUnconfiguredInput(restoreInfo, inputs));
        }
示例#2
0
 public ProjectRestoreInfo(string msbuildProjectExtensionsPath, string originalTargetFrameworks, IVsTargetFrameworks2 targetFrameworks, IVsReferenceItems toolReferences)
 {
     MSBuildProjectExtensionsPath = msbuildProjectExtensionsPath;
     OriginalTargetFrameworks     = originalTargetFrameworks;
     TargetFrameworks             = targetFrameworks;
     ToolReferences = toolReferences;
 }
        public ProjectRestoreInfo(string msbuildProjectExtensionsPath, string originalTargetFrameworks, IVsTargetFrameworks2 targetFrameworks, IVsReferenceItems toolReferences)
        {
            Requires.NotNull(msbuildProjectExtensionsPath, nameof(msbuildProjectExtensionsPath));
            Requires.NotNull(originalTargetFrameworks, nameof(originalTargetFrameworks));
            Requires.NotNull(targetFrameworks, nameof(targetFrameworks));
            Requires.NotNull(toolReferences, nameof(toolReferences));

            MSBuildProjectExtensionsPath = msbuildProjectExtensionsPath;
            OriginalTargetFrameworks     = originalTargetFrameworks;
            TargetFrameworks             = targetFrameworks;
            ToolReferences = toolReferences;
        }
示例#4
0
        private static void LogTargetFrameworks(BatchLogger logger, IVsTargetFrameworks2 targetFrameworks)
        {
            logger.WriteLine($"Target Frameworks ({targetFrameworks.Count})");
            logger.IndentLevel++;

            foreach (IVsTargetFrameworkInfo2 tf in targetFrameworks)
            {
                LogTargetFramework(logger, tf);
            }

            logger.IndentLevel--;
        }
示例#5
0
        public VsProjectRestoreInfo2(
            string baseIntermediatePath,
            IVsTargetFrameworks2 targetFrameworks)
        {
            if (string.IsNullOrEmpty(baseIntermediatePath))
            {
                throw new ArgumentException("Argument cannot be null or empty", nameof(baseIntermediatePath));
            }

            BaseIntermediatePath = baseIntermediatePath;
            TargetFrameworks     = targetFrameworks ?? throw new ArgumentNullException(nameof(targetFrameworks));
        }
        private IVsProjectRestoreInfo2 MergeRestoreData(IReadOnlyCollection <ProjectRestoreUpdate> updates)
        {
            // We have no active configuration
            if (updates.Count == 0)
            {
                return(null);
            }

            // We need to combine the snapshots from each implicitly active configuration (ie per TFM),
            // resolving any conflicts, which we'll report to the user.

            string               msbuildProjectExtensionsPath = ResolveMSBuildProjectExtensionsPathConflicts(updates);
            string               originalTargetFrameworks     = ResolveOriginalTargetFrameworksConflicts(updates);
            IVsReferenceItems    toolReferences   = ResolveToolReferenceConflicts(updates);
            IVsTargetFrameworks2 targetFrameworks = GetAllTargetFrameworks(updates);

            return(new ProjectRestoreInfo(
                       msbuildProjectExtensionsPath,
                       originalTargetFrameworks,
                       targetFrameworks,
                       toolReferences));
        }