使用该Error()
方法只会记录错误。但是如果我想中止构建怎么办?我可以抛出异常来中止构建,但它似乎不正确。那么有没有合适的中止方法呢?
var releaseNotes = ParseReleaseNotes("./ReleaseNotes.md");
if(releaseNotes.Version.ToString() != nugetVersion)
{
Error("Release notes are missing an entry for v{0}. Latest release notes are for v{1}", nugetVersion, releaseNotes.Version);
throw new Exception();
}