Disable infer-runtimes for repos that have netcoreapp projects

This commit is contained in:
Pavel Krymets 2016-04-14 10:09:41 -07:00
Родитель 306983f7a2
Коммит eba5ccb318
1 изменённых файлов: 15 добавлений и 1 удалений

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

@ -10,6 +10,20 @@ restoreDir=''
default currentDir = '${ Directory.GetCurrentDirectory() }'
default restoreDir = '${ currentDir }'
default restore_options=' ${ E("KOREBUILD_DOTNET_RESTORE_NO_INFER_RUNTIMES") == "1" ? "" : "--infer-runtimes" } ${ E("KOREBUILD_DOTNET_RESTORE_OPTIONS") }'
@{
var projectFiles = Files.Include(Path.Combine(restoreDir, "*/*/project.json"));
bool inferRids = false;
foreach (var projectFile in projectFiles)
{
inferRids |= File.ReadAllText(projectFile).Contains("\"netstandardapp1.5\"");
if (inferRids)
{
Log.Warn("Forcing infer-runtimes because of: " + projectFile);
break;
}
}
}
default restore_options=' ${ inferRids ? "--infer-runtimes" : "" } ${ E("KOREBUILD_DOTNET_RESTORE_OPTIONS") }'
dotnet command='restore${ restore_options }' workingDir='${ restoreDir }'