Skip to content
代码片段 群组 项目
提交 1cf3be07 编辑于 作者: Nate McMaster's avatar Nate McMaster
浏览文件

React to aspnet/korebuild#171

上级 6dfbab0b
No related branches found
No related tags found
无相关合并请求
feature/msbuild
\ No newline at end of file
...@@ -32,8 +32,7 @@ cd $PSScriptRoot ...@@ -32,8 +32,7 @@ cd $PSScriptRoot
$repoFolder = $PSScriptRoot $repoFolder = $PSScriptRoot
$env:REPO_FOLDER = $repoFolder $env:REPO_FOLDER = $repoFolder
$korebuildVersion = $(Get-Content -Raw $PSScriptRoot/ToolsVersion.txt).Trim() $koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip"
$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/$korebuildVersion.zip"
if ($env:KOREBUILD_ZIP) if ($env:KOREBUILD_ZIP)
{ {
$koreBuildZip=$env:KOREBUILD_ZIP $koreBuildZip=$env:KOREBUILD_ZIP
...@@ -64,4 +63,4 @@ if (!(Test-Path $buildFolder)) { ...@@ -64,4 +63,4 @@ if (!(Test-Path $buildFolder)) {
} }
} }
&"$buildFile" $args &"$buildFile" $args
\ No newline at end of file
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $repoFolder cd $repoFolder
toolsVersion=$(cat $repoFolder/ToolsVersion.txt) koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip"
koreBuildZip="https://github.com/aspnet/KoreBuild/archive/$toolsVersion.zip"
if [ ! -z $KOREBUILD_ZIP ]; then if [ ! -z $KOREBUILD_ZIP ]; then
koreBuildZip=$KOREBUILD_ZIP koreBuildZip=$KOREBUILD_ZIP
fi fi
...@@ -44,4 +43,4 @@ if test ! -d $buildFolder; then ...@@ -44,4 +43,4 @@ if test ! -d $buildFolder; then
fi fi
fi fi
$buildFile -r $repoFolder "$@" $buildFile -r $repoFolder "$@"
\ No newline at end of file
...@@ -254,8 +254,6 @@ var buildTarget = "compile" ...@@ -254,8 +254,6 @@ var buildTarget = "compile"
Environment.SetEnvironmentVariable("NUGET_PUBLISH_FEED", "https://dotnet.myget.org/F/aspnetcore-volatile-dev/api/v2/package"); Environment.SetEnvironmentVariable("NUGET_PUBLISH_FEED", "https://dotnet.myget.org/F/aspnetcore-volatile-dev/api/v2/package");
} }
var universeToolsVersion = File.ReadAllText(Path.Combine(Directory.GetCurrentDirectory(), "ToolsVersion.txt")).Trim();
foreach (var batch in batchedRepos) foreach (var batch in batchedRepos)
{ {
Parallel.ForEach(batch.ToArray(), new ParallelOptions { MaxDegreeOfParallelism = threads }, repo => Parallel.ForEach(batch.ToArray(), new ParallelOptions { MaxDegreeOfParallelism = threads }, repo =>
...@@ -267,38 +265,13 @@ var buildTarget = "compile" ...@@ -267,38 +265,13 @@ var buildTarget = "compile"
blockLogger.StartBlock(blockName); blockLogger.StartBlock(blockName);
} }
// begin workaround if (!IsLinux)
// as we transition to VS 2017, some repos will build with project.json and others with csproj
// the 'csproj' version of KoreBuild is the 'feature/msbuild' branch of that repo. project.json
// support is on 'dev'. This workaround avoids installing the version of KoreBuild used by
// individual repos unless it is already upgraded to the version currently used by Universe.
var repoToolsVersion = universeToolsVersion;
var buildPs1 = Path.Combine(repo, "build.ps1");
if (File.Exists(buildPs1))
{ {
foreach (var line in File.ReadAllLines(buildPs1)) Exec("cmd", "/C xcopy /S/Q/I/Y .build " + Path.Combine(repo, ".build"), "");
{
var match = Regex.Match(line, @".*https://github.com/aspnet/KoreBuild/archive/(.+)\.zip.*");
if (match != null && match.Success)
{
repoToolsVersion = match.Groups[1].Value;
break;
}
}
} }
Log.Info(repo + " KoreBuild version = " + repoToolsVersion + ", Universe = " + universeToolsVersion); else
// end workaround
if (repoToolsVersion == universeToolsVersion)
{ {
if (!IsLinux) CopyFolder(".build", Path.Combine(repo, ".build"), true);
{
Exec("cmd", "/C xcopy /S/Q/I/Y .build " + Path.Combine(repo, ".build"), "");
}
else
{
CopyFolder(".build", Path.Combine(repo, ".build"), true);
}
} }
try try
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册