1 Star 0 Fork 0

yangming886/AspectCore-Framework

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
build.cake 1.87 KB
一键复制 编辑 原始数据 按行查看 历史
#addin "nuget:https://www.nuget.org/api/v2?package=Newtonsoft.Json&version=9.0.1"
#load "./build/index.cake"
var target = Argument("target", "Default");
var build = BuildParameters.Create(Context);
var util = new Util(Context, build);
Task("Clean")
.Does(() =>
{
if (DirectoryExists("./artifacts"))
{
DeleteDirectory("./artifacts", new DeleteDirectorySettings(){ Force = true });
}
});
Task("Restore")
.IsDependentOn("Clean")
.Does(() =>
{
var settings = new DotNetCoreRestoreSettings
{
ArgumentCustomization = args =>
{
args.Append($"/p:VersionSuffix={build.Version.Suffix}");
return args;
}
};
foreach (var project in build.ProjectFiles)
{
DotNetCoreRestore(project.FullPath, settings);
}
});
Task("Build")
.IsDependentOn("Restore")
.Does(() =>
{
var settings = new DotNetCoreBuildSettings
{
Configuration = build.Configuration,
VersionSuffix = build.Version.Suffix,
ArgumentCustomization = args =>
{
args.Append($"/p:InformationalVersion={build.Version.VersionWithSuffix()}");
return args;
}
};
foreach (var project in build.ProjectFiles)
{
DotNetCoreBuild(project.FullPath, settings);
}
});
Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
foreach (var testProject in build.TestProjectFiles)
{
DotNetCoreTest(testProject.FullPath);
}
});
Task("Pack")
.Does(() =>
{
var settings = new DotNetCorePackSettings
{
Configuration = build.Configuration,
VersionSuffix = build.Version.Suffix,
IncludeSymbols = true,
OutputDirectory = "./artifacts/packages"
};
foreach (var project in build.ProjectFiles)
{
DotNetCorePack(project.FullPath, settings);
}
});
Task("Default")
.IsDependentOn("Build")
.IsDependentOn("Test")
.IsDependentOn("Pack")
.Does(() =>
{
util.PrintInfo();
});
Task("Version")
.Does(() =>
{
Information($"{build.FullVersion()}");
});
Task("Print")
.Does(() =>
{
util.PrintInfo();
});
RunTarget(target);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/yangming886/AspectCore-Framework.git
git@gitee.com:yangming886/AspectCore-Framework.git
yangming886
AspectCore-Framework
AspectCore-Framework
master

搜索帮助