Example #1
0
        internal static string GetBuildDirectory(BuildVersion version)
        {
            // used for local testing:
            if (Options.RoslynDropPath.EndsWith(@"Binaries\Debug", StringComparison.OrdinalIgnoreCase) ||
                Options.RoslynDropPath.EndsWith(@"Binaries\Release", StringComparison.OrdinalIgnoreCase))
            {
                return(Options.RoslynDropPath);
            }

            return(Path.Combine(
                       Options.RoslynDropPath,
                       Options.RoslynBuildQueueName,
                       Path.GetFileName(Options.RoslynBranchName), // The folder under Roslyn-Signed is just the last component of the name
                       Options.RoslynBuildConfig,
                       version.ToString()));
        }
Example #2
0
        private static async Task <Build> GetSpecificBuildAsync(BuildVersion version, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();
            Console.WriteLine($"Getting build with build number {version}");
            var buildClient = ProjectCollection.GetClient <BuildHttpClient>();
            var definitions = await buildClient.GetDefinitionsAsync(project : Options.TFSProjectName, name : Options.BuildQueueName);

            var builds = await buildClient.GetBuildsAsync(
                project : Options.TFSProjectName,
                definitions : definitions.Select(d => d.Id),
                buildNumber : version.ToString(),
                statusFilter : BuildStatus.Completed,
                cancellationToken : cancellationToken);

            return((from build in builds
                    where version == BuildVersion.FromTfsBuildNumber(build.BuildNumber, Options.BuildQueueName)
                    orderby build.FinishTime descending
                    select build).FirstOrDefault());
        }