React to aspnet/korebuild#171
This commit is contained in:
parent
6dfbab0b6c
commit
1cf3be07d0
|
|
@ -1 +0,0 @@
|
||||||
feature/msbuild
|
|
||||||
|
|
@ -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)) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&"$buildFile" $args
|
&"$buildFile" $args
|
||||||
|
|
|
||||||
5
build.sh
5
build.sh
|
|
@ -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
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$buildFile -r $repoFolder "$@"
|
$buildFile -r $repoFolder "$@"
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue