aspnetcore/build/_k.shade

50 lines
1.3 KiB
Plaintext

@{/*
k
Run klr commands in your project. Executes k sdk.
kVersion='0.0.1-pre-30109-087'
May be passed to override the nuget package version holding xunit console runner.
kProgram='...'
May be passed to override the path to the xunit program that will be executed
command=''
prefetch='true'
May be passed if fetching k from nuget is required before running
*/}
default prefetch='${true}'
nuget-install package='ProjectK' outputDir='packages' extra='-pre' once='ProjectK-NuGet' if='prefetch'
@{
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(getVersion)
.First();
}
default kProgram='${projectKDir}/tools/k.cmd'
exec program='${Path.GetFullPath(kProgram)}' commandline='${command}'