本文整理汇总了C#中IIntegrationResult.HasModifications方法的典型用法代码示例。如果您正苦于以下问题:C# IIntegrationResult.HasModifications方法的具体用法?C# IIntegrationResult.HasModifications怎么用?C# IIntegrationResult.HasModifications使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IIntegrationResult
的用法示例。
在下文中一共展示了IIntegrationResult.HasModifications方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShouldRunBuild
public bool ShouldRunBuild(IIntegrationResult result)
{
if (!this.Condition)
return true;
bool HasTrackers = this.GetQueryCount() != 0;
bool Modifications = true;
if (this.WithModifications)
Modifications = result.HasModifications();
bool Integratable = HasTrackers && Modifications;
if (!Integratable)
Log.Info(string.Format("No trackers were found in query {0}.", this.QueryInforation.Name));
return Integratable;
}
示例2: GetSource
public override void GetSource(IIntegrationResult result)
{
Util.Log.Info(result.HasModifications().ToString());
ftp = new FtpLib(result.BuildProgressInformation);
string remoteFolder = FtpFolderName;
ftp.LogIn(ServerName, UserName, Password.PrivateValue, UseActiveConnectionMode);
if (!FtpFolderName.StartsWith("/"))
{
remoteFolder = System.IO.Path.Combine(ftp.CurrentWorkingFolder(), FtpFolderName);
}
ftp.DownloadFolder( LocalFolderName, remoteFolder, RecursiveCopy);
ftp.DisConnect();
}
示例3: BuildIntegrationElement
private XmlElement BuildIntegrationElement(XmlDocument ownerDocument, IIntegrationResult result)
{
XmlElement integrationElement = CreateElement(ownerDocument, "item");
integrationElement.AppendChild(CreateTextElement(integrationElement.OwnerDocument,
"title",
"Build {0} : {1} {2} {3}",
result.Label,
result.Status,
GetAmountOfModifiedFiles(result),
GetFirstCommentedModification(result)));
integrationElement.AppendChild(CreateTextElement(
integrationElement.OwnerDocument, "description", GetAmountOfModifiedFiles(result)));
integrationElement.AppendChild(CreateTextElement(
integrationElement.OwnerDocument, "guid", System.Guid.NewGuid().ToString()));
integrationElement.AppendChild(CreateTextElement(
integrationElement.OwnerDocument, "pubDate", System.DateTime.Now.ToString("r", CultureInfo.CurrentCulture)));
if (result.HasModifications())
{
XmlElement modsElement = CreateContentElement(
integrationElement.OwnerDocument,
"encoded");
XmlCDataSection cdata = integrationElement.OwnerDocument.CreateCDataSection(
GetBuildModifications(result));
modsElement.AppendChild(cdata);
integrationElement.AppendChild(modsElement);
}
return integrationElement;
}
示例4: GetFirstCommentedModification
private string GetFirstCommentedModification(IIntegrationResult result)
{
if (result.HasModifications())
{
foreach (Modification modification in result.Modifications)
{
if (!string.IsNullOrEmpty(modification.Comment) )
return "First Comment : " + modification.Comment;
}
}
return string.Empty;
}
示例5: Generate
/// <summary>
/// Generates the specified integration result.
/// </summary>
/// <param name="integrationResult">The integration result.</param>
/// <returns></returns>
/// <remarks></remarks>
public override string Generate(IIntegrationResult integrationResult)
{
Version oldVersion;
int major, minor, patch, revision = 0;
// try getting old version
try
{
Log.Debug(string.Concat("[semverCommentLabeller] Old build label is: ", integrationResult.LastIntegration.Label));
oldVersion = new Version(integrationResult.LastIntegration.Label);
major = oldVersion.Major;
minor = oldVersion.Minor;
patch = oldVersion.Build;
}
catch (Exception)
{
oldVersion = new Version(0, 0, 0, 0);
major = minor = patch = 0;
}
Log.Debug(string.Concat("[semverCommentLabeller] Old version is: ", oldVersion.ToString()));
VersionNumberChange change = VersionNumberChange.None;
if (ResetVersion)
{
major = Major;
minor = Minor;
patch = Patch;
revision = Revision;
}
else
{
if (integrationResult.HasModifications())
{
foreach (var mod in integrationResult.Modifications)
{
if (String.IsNullOrEmpty(mod.Comment) && mod.Comment.Trim() != String.Empty)
{
continue;
}
var comment = mod.Comment.ToUpperInvariant();
if (comment.StartsWith(MAJOR_PREFIX))
{
change = VersionNumberChange.Major;
break;
}
else if (comment.StartsWith(MINOR_PREFIX))
{
change = VersionNumberChange.Minor;
}
else if (comment.StartsWith(PATCH_PREFIX) && change == VersionNumberChange.None)
{
change = VersionNumberChange.Patch;
}
}
}
switch (change)
{
case VersionNumberChange.Major:
major++;
minor = patch = 0;
break;
case VersionNumberChange.Minor:
minor++;
patch = 0;
break;
case VersionNumberChange.Patch:
patch++;
break;
}
//Calculate revision
if (int.TryParse(integrationResult.LastChangeNumber, out revision))
{
Log.Debug(
string.Format(System.Globalization.CultureInfo.CurrentCulture, "[semverCommentLabeller] LastChangeNumber retrieved: {0}",
revision));
int modVal = RevisionModulusValue > 0 ? RevisionModulusValue : 10000;
revision %= modVal;
}
else
{
Log.Debug("[semverCommentLabeller] LastChangeNumber of source control is '{0}', set revision number to '0'.",
string.IsNullOrEmpty(integrationResult.LastChangeNumber)
? "N/A"
: integrationResult.LastChangeNumber);
}
}
// use the revision from last build,
//.........这里部分代码省略.........