зеркало из https://github.com/aspnet/KoreBuild.git
Disable infer-runtimes for repos that have netcoreapp projects
This commit is contained in:
Родитель
306983f7a2
Коммит
eba5ccb318
|
@ -10,6 +10,20 @@ restoreDir=''
|
||||||
default currentDir = '${ Directory.GetCurrentDirectory() }'
|
default currentDir = '${ Directory.GetCurrentDirectory() }'
|
||||||
default restoreDir = '${ currentDir }'
|
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 }'
|
dotnet command='restore${ restore_options }' workingDir='${ restoreDir }'
|
||||||
|
|
Загрузка…
Ссылка в новой задаче