本文整理汇总了C#中SemanticVersion.IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C# SemanticVersion.IsEmpty方法的具体用法?C# SemanticVersion.IsEmpty怎么用?C# SemanticVersion.IsEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SemanticVersion
的用法示例。
在下文中一共展示了SemanticVersion.IsEmpty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FindVersion
public SemanticVersion FindVersion(IRepository repository, Commit tip)
{
int major;
int minor;
int patch;
foreach (var tag in repository.TagsByDate(tip))
{
if (ShortVersionParser.TryParse(tag.Name, out major, out minor, out patch))
{
return BuildVersion(repository, tip, major, minor, patch);
}
}
var semanticVersion = new SemanticVersion();
string versionString;
if (MergeMessageParser.TryParse(tip, out versionString))
{
if (ShortVersionParser.TryParse(versionString, out major, out minor, out patch))
{
semanticVersion = BuildVersion(repository, tip, major, minor, patch);
}
}
semanticVersion.OverrideVersionManuallyIfNeeded(repository);
if (semanticVersion == null || semanticVersion.IsEmpty())
{
throw new WarningException("The head of a support branch should always be a merge commit if you follow gitflow. Please create one or work around this by tagging the commit with SemVer compatible Id.");
}
return semanticVersion;
}
示例2: EmptyVersion
public void EmptyVersion()
{
Assert.IsTrue(SemanticVersion.Empty.IsEmpty());
var emptyVersion = new SemanticVersion();
Assert.IsTrue(emptyVersion.IsEmpty());
}