Exemplo n.º 1
0
            private async Task <VersionStamp> ComputeDependentVersionAsync(Solution solution, CancellationToken cancellationToken)
            {
                var projectState = this.ProjectState;
                var projVersion  = projectState.Version;
                var docVersion   = await projectState.GetLatestDocumentVersionAsync(cancellationToken).ConfigureAwait(false);

                var version = docVersion.GetNewerVersion(projVersion);

                foreach (var dependentProjectReference in projectState.ProjectReferences)
                {
                    cancellationToken.ThrowIfCancellationRequested();

                    if (solution.ContainsProject(dependentProjectReference.ProjectId))
                    {
                        var dependentProjectVersion = await solution.GetDependentVersionAsync(dependentProjectReference.ProjectId, cancellationToken).ConfigureAwait(false);

                        version = dependentProjectVersion.GetNewerVersion(version);
                    }
                }

                return(version);
            }
            private async Task<VersionStamp> ComputeDependentVersionAsync(Solution solution, CancellationToken cancellationToken)
            {
                var projectState = this.ProjectState;
                var projVersion = projectState.Version;
                var docVersion = await projectState.GetLatestDocumentVersionAsync(cancellationToken).ConfigureAwait(false);

                var version = docVersion.GetNewerVersion(projVersion);
                foreach (var dependentProjectReference in projectState.ProjectReferences)
                {
                    cancellationToken.ThrowIfCancellationRequested();

                    if (solution.ContainsProject(dependentProjectReference.ProjectId))
                    {
                        var dependentProjectVersion = await solution.GetDependentVersionAsync(dependentProjectReference.ProjectId, cancellationToken).ConfigureAwait(false);
                        version = dependentProjectVersion.GetNewerVersion(version);
                    }
                }

                return version;
            }
Exemplo n.º 3
0
 /// <summary>
 /// The most recent version of the project, its documents and all dependent projects and documents.
 /// </summary>
 public Task <VersionStamp> GetDependentVersionAsync(CancellationToken cancellationToken = default(CancellationToken))
 {
     return(_solution.GetDependentVersionAsync(this.Id, cancellationToken));
 }