Update build.cake
This commit is contained in:
Родитель
e8bc3b4bb5
Коммит
051684b52b
|
@ -8,27 +8,27 @@ var target = Argument("target", "Default");
|
||||||
Task("PrintVersions")
|
Task("PrintVersions")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
Updater.FindReferences("./build", "*.props", new string[] { }).PrintVersions();
|
Updater.FindReferences("../build/", "*.props", new string[] { }).PrintVersions();
|
||||||
Updater.FindReferences("./", "*.csproj", new string[] { }).PrintVersions();
|
Updater.FindReferences("../build/build/", "*.csproj", new string[] { }).PrintVersions();
|
||||||
});
|
});
|
||||||
|
|
||||||
Task("ValidateVersions")
|
Task("ValidateVersions")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
Updater.FindReferences("./build", "*.props", new string[] { }).ValidateVersions();
|
Updater.FindReferences("../build/", "*.props", new string[] { }).ValidateVersions();
|
||||||
Updater.FindReferences("./", "*.csproj", new string[] { }).ValidateVersions();
|
Updater.FindReferences("../build/build/", "*.csproj", new string[] { }).ValidateVersions();
|
||||||
});
|
});
|
||||||
|
|
||||||
Task("UpdateVersions")
|
Task("UpdateVersions")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
Updater.FindReferences("./build", "*.props", new string[] { }).UpdateVersions("Newtonsoft.Json", "10.0.3");
|
Updater.FindReferences("../build/", "*.props", new string[] { }).UpdateVersions("Newtonsoft.Json", "10.0.3");
|
||||||
});
|
});
|
||||||
|
|
||||||
Task("InstalledVersions")
|
Task("InstalledVersions")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
var result = Updater.FindReferences("./build", "*.props", new string[] { });
|
var result = Updater.FindReferences("../build/", "*.props", new string[] { });
|
||||||
result.ValidateVersions();
|
result.ValidateVersions();
|
||||||
var version = result.GroupedReferences["Newtonsoft.Json"].FirstOrDefault().Version;
|
var version = result.GroupedReferences["Newtonsoft.Json"].FirstOrDefault().Version;
|
||||||
Information("Newtonsoft.Json package version: {0}", version);
|
Information("Newtonsoft.Json package version: {0}", version);
|
||||||
|
@ -40,9 +40,13 @@ Task("AvailableVersions")
|
||||||
var versions = NuGetApi.GetPackageVersions("https://api.nuget.org/v3/index.json", "Newtonsoft.Json").Result;
|
var versions = NuGetApi.GetPackageVersions("https://api.nuget.org/v3/index.json", "Newtonsoft.Json").Result;
|
||||||
var latestVersion = versions.Reverse().FirstOrDefault();
|
var latestVersion = versions.Reverse().FirstOrDefault();
|
||||||
Information("Newtonsoft.Json package latest version: {0}", latestVersion);
|
Information("Newtonsoft.Json package latest version: {0}", latestVersion);
|
||||||
}
|
});
|
||||||
|
|
||||||
Task("Default")
|
Task("Default")
|
||||||
.IsDependentOn("PrintVersions");
|
.IsDependentOn("PrintVersions")
|
||||||
|
.IsDependentOn("ValidateVersions")
|
||||||
|
.IsDependentOn("UpdateVersions")
|
||||||
|
.IsDependentOn("InstalledVersions")
|
||||||
|
.IsDependentOn("AvailableVersions");
|
||||||
|
|
||||||
RunTarget(target);
|
RunTarget(target);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче