private PackageSpec GetPackageSpec()
        {
            DependencyGraphSpec projectRestoreInfo;

            if (_projectSystemCache.TryGetProjectRestoreInfo(_projectFullPath, out projectRestoreInfo))
            {
                return(projectRestoreInfo.GetProjectSpec(_projectFullPath));
            }

            // if restore data was not found in the cache, meaning project nomination
            // didn't happen yet or failed.
            return(null);
        }
Beispiel #2
0
        private PackageSpec GetPackageSpec()
        {
            DependencyGraphSpec projectRestoreInfo;

            //TODO NK - We need the Project System team to plumb through extra details
            if (_projectSystemCache.TryGetProjectRestoreInfo(_projectFullPath, out projectRestoreInfo))
            {
                return(projectRestoreInfo.GetProjectSpec(_projectFullPath));
            }

            // if restore data was not found in the cache, meaning project nomination
            // didn't happen yet or failed.
            return(null);
        }
Beispiel #3
0
        public async Task <bool> IsAllProjectsNominatedAsync()
        {
            var netCoreProjects = (await GetNuGetProjectsAsync()).OfType <CpsPackageReferenceProject>().ToList();

            foreach (var project in netCoreProjects)
            {
                // check if this .Net core project is nominated or not.
                DependencyGraphSpec projectRestoreInfo;
                if (!_projectSystemCache.TryGetProjectRestoreInfo(project.MSBuildProjectPath, out projectRestoreInfo, nominationMessages: out _) ||
                    projectRestoreInfo == null)
                {
                    // there are projects still to be nominated.
                    return(false);
                }
            }

            // return true if all the net core projects have been nominated.
            return(true);
        }
        public async Task <bool> IsAllProjectsNominatedAsync()
        {
#if VS14
            // for VS14, always return true since nominations don't apply there.
            return(await Task.FromResult(true));
#else
            var netCoreProjects = (await GetNuGetProjectsAsync()).OfType <NetCorePackageReferenceProject>().ToList();

            foreach (var project in netCoreProjects)
            {
                // check if this .Net core project is nominated or not.
                DependencyGraphSpec projectRestoreInfo;
                if (!_projectSystemCache.TryGetProjectRestoreInfo(project.MSBuildProjectPath, out projectRestoreInfo) ||
                    projectRestoreInfo == null)
                {
                    // there are projects still to be nominated.
                    return(false);
                }
            }

            // return true if all the net core projects have been nominated.
            return(true);
#endif
        }