Handle timestamp based versions in kruntime itself
- This is useful when testing privates of the runtime itself.
This commit is contained in:
parent
738ab055de
commit
c616eaca6f
|
|
@ -341,8 +341,25 @@ functions
|
|||
|
||||
private static string GetProjectKTargets(string packagesDir)
|
||||
{
|
||||
Func<string, long> getVersion = version => {
|
||||
var dash = version.LastIndexOf('-');
|
||||
|
||||
if(dash != -1)
|
||||
{
|
||||
var lastToken = version.Substring(dash + 1);
|
||||
|
||||
if(lastToken.StartsWith("t"))
|
||||
{
|
||||
return Int64.Parse(lastToken.Substring(1));
|
||||
}
|
||||
|
||||
return Int64.Parse(lastToken);
|
||||
}
|
||||
return Int64.MaxValue;
|
||||
};
|
||||
|
||||
var projectK = Directory.GetDirectories(packagesDir, "ProjectK*")
|
||||
.Select(p => new { Path = p, Build = Int32.Parse(p.Substring(p.LastIndexOf('-') + 1)) })
|
||||
.Select(p => new { Path = p, Build = getVersion(p) })
|
||||
.OrderByDescending(p => p.Build)
|
||||
.FirstOrDefault();
|
||||
|
||||
|
|
|
|||
|
|
@ -16,9 +16,26 @@ command=''
|
|||
nuget-install package='ProjectK' outputDir='packages' extra='-pre' once='ProjectK-NuGet'
|
||||
|
||||
@{
|
||||
Func<string, long> getVersion = version => {
|
||||
var dash = version.LastIndexOf('-');
|
||||
|
||||
if(dash != -1)
|
||||
{
|
||||
var lastToken = version.Substring(dash + 1);
|
||||
|
||||
if(lastToken.StartsWith("t"))
|
||||
{
|
||||
return Int64.Parse(lastToken.Substring(1));
|
||||
}
|
||||
|
||||
return Int64.Parse(lastToken);
|
||||
}
|
||||
return Int64.MaxValue;
|
||||
};
|
||||
|
||||
string packagesDir = Path.Combine(Directory.GetCurrentDirectory(), "packages"),
|
||||
projectKDir = Directory.EnumerateDirectories(packagesDir, "ProjectK*")
|
||||
.OrderByDescending(p => Int32.Parse(p.Substring(p.LastIndexOf('-') + 1)))
|
||||
.OrderByDescending(getVersion)
|
||||
.First();
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue