This commit is contained in:
Wiesław Šoltés 2018-12-10 18:24:03 +01:00
Родитель e8bc3b4bb5
Коммит 051684b52b
1 изменённых файлов: 12 добавлений и 8 удалений

Просмотреть файл

@ -8,27 +8,27 @@ var target = Argument("target", "Default");
Task("PrintVersions")
.Does(() =>
{
Updater.FindReferences("./build", "*.props", new string[] { }).PrintVersions();
Updater.FindReferences("./", "*.csproj", new string[] { }).PrintVersions();
Updater.FindReferences("../build/", "*.props", new string[] { }).PrintVersions();
Updater.FindReferences("../build/build/", "*.csproj", new string[] { }).PrintVersions();
});
Task("ValidateVersions")
.Does(() =>
{
Updater.FindReferences("./build", "*.props", new string[] { }).ValidateVersions();
Updater.FindReferences("./", "*.csproj", new string[] { }).ValidateVersions();
Updater.FindReferences("../build/", "*.props", new string[] { }).ValidateVersions();
Updater.FindReferences("../build/build/", "*.csproj", new string[] { }).ValidateVersions();
});
Task("UpdateVersions")
.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")
.Does(() =>
{
var result = Updater.FindReferences("./build", "*.props", new string[] { });
var result = Updater.FindReferences("../build/", "*.props", new string[] { });
result.ValidateVersions();
var version = result.GroupedReferences["Newtonsoft.Json"].FirstOrDefault().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 latestVersion = versions.Reverse().FirstOrDefault();
Information("Newtonsoft.Json package latest version: {0}", latestVersion);
}
});
Task("Default")
.IsDependentOn("PrintVersions");
.IsDependentOn("PrintVersions")
.IsDependentOn("ValidateVersions")
.IsDependentOn("UpdateVersions")
.IsDependentOn("InstalledVersions")
.IsDependentOn("AvailableVersions");
RunTarget(target);