6 Star 22 Fork 6

Argo / Cronos

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
build.cake 2.15 KB
一键复制 编辑 原始数据 按行查看 历史
#tool "nuget:?package=xunit.runner.console"
#tool "nuget:?package=OpenCover"
var configuration = Argument("configuration", "Release");
var version = Argument<string>("buildVersion", null);
var target = Argument("target", "Default");
Task("Default").IsDependentOn("Pack");
Task("Clean").Does(()=>
{
CleanDirectory("./build");
StartProcess("dotnet", "clean -c:" + configuration);
});
Task("Restore").Does(()=>
{
DotNetCoreRestore();
});
Task("Build")
.IsDependentOn("UseAppVeyorVersion")
.IsDependentOn("Clean")
.IsDependentOn("Restore")
.Does(()=>
{
var buildSettings = new DotNetCoreBuildSettings { Configuration = configuration };
if(!string.IsNullOrEmpty(version)) buildSettings.ArgumentCustomization = args => args.Append("/p:Version=" + version);
DotNetCoreBuild("src/Cronos/Cronos.csproj", buildSettings);
});
Task("Test").IsDependentOn("Build").Does(() =>
{
DotNetCoreTest("./tests/Cronos.Tests/Cronos.Tests.csproj", new DotNetCoreTestSettings
{
Configuration = configuration,
ArgumentCustomization = args => args.Append("/p:BuildProjectReferences=false")
});
});
Task("TestCoverage").IsDependentOn("Test").Does(() =>
{
OpenCover(
tool => { tool.XUnit2("tests/Cronos.Tests/bin/" + configuration + "/**/Cronos.Tests.dll", new XUnit2Settings { ShadowCopy = false }); },
new FilePath("coverage.xml"),
new OpenCoverSettings()
.WithFilter("+[Cronos]*")
.WithFilter("-[Cronos.Tests]*"));
});
Task("Pack").IsDependentOn("TestCoverage").Does(()=>
{
CreateDirectory("build");
CopyFiles(GetFiles("./src/Cronos/bin/**/*.nupkg"), "build");
Zip("./src/Cronos/bin/" + configuration, "build/Cronos-" + version +".zip");
});
Task("UseAppVeyorVersion").WithCriteria(AppVeyor.IsRunningOnAppVeyor).Does(() =>
{
version = AppVeyor.Environment.Build.Version;
if (AppVeyor.Environment.Repository.Tag.IsTag)
{
var tagName = AppVeyor.Environment.Repository.Tag.Name;
if(tagName.StartsWith("v"))
{
version = tagName.Substring(1);
}
AppVeyor.UpdateBuildVersion(version);
}
});
RunTarget(target);
C#
1
https://gitee.com/Longbow/Cronos.git
git@gitee.com:Longbow/Cronos.git
Longbow
Cronos
Cronos
master

搜索帮助