dotnet-installer/build_projects/dotnet-cli-build/GetUseBundledVersionAsDefaultVersion.cs
William Li 7d94dbbd99
Test and automatic Update default package version and re-enable Latest package version test (#9507)
* Add Compute UseBundledNETCoreAppPackageVersionAsDefaultNetCorePatchVersion

* Add tests to catch DefaultNetCorePatchVersion moving

* Update LatestPatchVersionForNetCore2_0 to 2.0.9, it is in the process of shipping

* Update LatestPatchVersionForNetCore1_0 and LatestPatchVersionForNetCore1_1
2018-06-21 10:40:44 -07:00

30 lines
1 KiB
C#

// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.IO;
using Microsoft.Build.Utilities;
using Microsoft.Build.Framework;
using Microsoft.DotNet.Cli.Build.Framework;
using NuGet.Versioning;
namespace Microsoft.DotNet.Cli.Build
{
public class GetUseBundledNETCoreAppPackageVersionAsDefaultNetCorePatchVersion : Task
{
[Required]
public string BundledNETCoreAppPackageVersion { get; set; }
[Output]
public string UseBundledNETCoreAppPackageVersionAsDefaultNetCorePatchVersion { get; set; }
public override bool Execute()
{
var parsedVersion = NuGetVersion.Parse(BundledNETCoreAppPackageVersion);
UseBundledNETCoreAppPackageVersionAsDefaultNetCorePatchVersion =
(parsedVersion.Patch == 0) && parsedVersion.IsPrerelease ? "true" : "false";
return true;
}
}
}