コード例 #1
0
ファイル: Changes.cs プロジェクト: Eibwen/TeamCitySharp
        public List<ChangeSummary> GetChanges(Build build)
        {
            if (build.Changes.Count == 0) return new List<ChangeSummary>();

            var changeWrapper = _caller.GetFormat<ChangeWrapper>(build.Changes.Href);

            return changeWrapper.Change;
        }
コード例 #2
0
 public void GetArtifactsInBuild(Build build, Action<IEnumerable<ArtifactModel>> callback)
 {
     if (callback == null) throw new ArgumentNullException("callback");
     if (!(client is TeamCityClient)) throw new InvalidOperationException("Not TeamCityClient");
     worker.QueueWork(delegate
         {
             // TODO why is not this method in the interface?
             callback(
                 ((TeamCityClient)client).ArtifactsByBuildConfigIdAndBuildNumber(build.BuildTypeId, build.Number).Select(
                 x => new ArtifactModel(x)));
         });
 }
コード例 #3
0
 private static string GetFlagTooltip(Build b)
 {
     return string.Format("{0} - {1} #{2}", b.NiceProjectName(), b.NiceName(), b.Number);
 }
コード例 #4
0
 private static string GetFlagTooltip(Build b)
 {
     return $"{b.NiceProjectName()} - {b.NiceName()} #{b.Number}";
 }
コード例 #5
0
 /// <summary/>
 /// <param name="downloadHandler"></param>
 /// <param name="build"> </param>
 public void DownloadTestsCsv(Action<string> downloadHandler, Build build)
 {
     string uriPart = string.Format("/get/tests/buildId/{0}", build.Id);
       _caller.GetDownloadFormat(downloadHandler, uriPart);
 }
コード例 #6
0
        /// <summary>
        /// Retrieves the artifacts associated to the specified <see cref="Build"/>.
        /// </summary>
        /// <param name="build">
        /// The TeamCity <see cref="Build"/> of the desired artifacts.
        /// </param>
        /// <param name="artifactRelativeName">
        /// the relative path and filename of a specific artifact. Supports referencing files under archives using the  &quot;!&quot; delimiter after the archive name.
        /// </param>
        /// <remarks>
        /// This method is only supported by TeamCity 8.x and higher.
        /// </remarks>
        public IArtifactWrapper2 ByBuild(Build build, string artifactRelativeName = "")
        {
            if (build == null || string.IsNullOrEmpty(build.Id))
            {
                throw new ArgumentException("Invalid build specified. Please be sure to use the methods of the IBuilds interface to obtain it.");
            }

            var receivedBuildHref = string.Format(TeamCityRestBuildFormat, build.Id);
            if (!build.Href.EndsWith(receivedBuildHref))
            {
                throw new ArgumentException("Invalid build specified. Please be sure to use the methods of the IBuilds interface to obtain it.");
            }

            var artifacts = _caller.GetFormat<Artifacts>("{0}{1}{2}",
                                                         build.Href,
                                                         TeamCityRestBuildArtifactChildren,
                                                         string.IsNullOrEmpty(artifactRelativeName) ? string.Empty : string.Format("/{0}", artifactRelativeName));

            return new ArtifactWrapper2(_caller, artifacts, artifactRelativeName);
        }