|
| 1 | +From c46510737402f30f28c23b06a0b309354f98e29a Mon Sep 17 00:00:00 2001 |
| 2 | +From: dseefeld < [email protected]> |
| 3 | +Date: Thu, 3 May 2018 22:30:30 +0000 |
| 4 | +Subject: [PATCH] Update build.sh to uptake source-built repotoolset |
| 5 | + |
| 6 | +--- |
| 7 | + build/build.sh | 30 ++++++++++++++++++++++++------ |
| 8 | + 1 file changed, 24 insertions(+), 6 deletions(-) |
| 9 | + |
| 10 | +diff --git a/build/build.sh b/build/build.sh |
| 11 | +index 141f779..310cf85 100755 |
| 12 | +--- a/build/build.sh |
| 13 | ++++ b/build/build.sh |
| 14 | +@@ -278,19 +278,36 @@ function InstallDotNetCli { |
| 15 | + } |
| 16 | + |
| 17 | + function InstallRepoToolset { |
| 18 | ++ CreateDirectory "$RepoToolsetDir" |
| 19 | + ReadJson "$RepoRoot/global.json" "RoslynTools.RepoToolset" |
| 20 | + RepoToolsetVersion=$readjsonvalue |
| 21 | +- RepoToolsetDir="$NuGetPackageRoot/roslyntools.repotoolset/$RepoToolsetVersion/tools" |
| 22 | +- RepoToolsetBuildProj="$RepoToolsetDir/Build.proj" |
| 23 | ++ RepoToolsetLocationFile="$RepoToolsetDir/$RepoToolsetVersion.txt" |
| 24 | ++ |
| 25 | ++ if [[ -a "$RepoToolsetLocationFile" ]]; then |
| 26 | ++ local path=`cat $RepoToolsetLocationFile` |
| 27 | ++ if [[ -a "$path" ]]; then |
| 28 | ++ RepoToolsetBuildProj=$path |
| 29 | ++ return |
| 30 | ++ fi |
| 31 | ++ fi |
| 32 | ++ if [[ "$restore" != true ]]; then |
| 33 | ++ ExitIfError 2 "Toolset version $RepoToolsetVersion has not been restored." |
| 34 | ++ fi |
| 35 | + |
| 36 | + echo "Using repo tools version: $readjsonvalue" |
| 37 | ++ local proj="$RepoToolsetDir/restore.proj" |
| 38 | ++ echo '<Project Sdk="RoslynTools.RepoToolset"/>' > $proj |
| 39 | + |
| 40 | + local logCmd=$(GetLogCmd Toolset) |
| 41 | ++ CallMSBuild $(QQ $proj) /t:__WriteToolsetLocation /m /nologo /clp:None /warnaserror $logCmd /p:__ToolsetLocationOutputFile=$RepoToolsetLocationFile |
| 42 | ++ local lastexitcode=$? |
| 43 | + |
| 44 | +- if [ ! -d "$RepoToolsetBuildProj" ] |
| 45 | +- then |
| 46 | +- local ToolsetProj="$ScriptRoot/Toolset.csproj" |
| 47 | +- CallMSBuild $(QQ $ToolsetProj) /t:build /m /clp:Summary /warnaserror /v:$verbosity $logCmd $properties |
| 48 | ++ ExitIfError $lastexitcode "Failed to restore toolset (exit code '$lastexitcode')." |
| 49 | ++ |
| 50 | ++ RepoToolsetBuildProj=`cat $RepoToolsetLocationFile` |
| 51 | ++ |
| 52 | ++ if [[ ! -a "$RepoToolsetBuildProj" ]]; then |
| 53 | ++ ExitIfError 3 "Invalid toolset path: $RepoToolsetBuildProj" |
| 54 | + fi |
| 55 | + } |
| 56 | + |
| 57 | +@@ -392,6 +409,7 @@ ArtifactsConfigurationDir="$ArtifactsDir/$configuration" |
| 58 | + PackagesDir="$ArtifactsConfigurationDir/packages" |
| 59 | + LogDir="$ArtifactsConfigurationDir/log" |
| 60 | + VersionsProps="$ScriptRoot/Versions.props" |
| 61 | ++RepoToolsetDir="$ArtifactsDir/toolset" |
| 62 | + |
| 63 | + #https://github.com/dotnet/source-build |
| 64 | + if $dotnetBuildFromSource |
| 65 | +-- |
| 66 | +1.8.3.1 |
| 67 | + |
0 commit comments