diff --git a/eng/dogfood.ps1 b/eng/dogfood.ps1 index 8cde5ba7b0c2..859296b6c2e9 100644 --- a/eng/dogfood.ps1 +++ b/eng/dogfood.ps1 @@ -26,7 +26,6 @@ function Print-Usage() { Write-Host "if it is set, will be used." } -function Global:prompt {"(dogfood) PS $PWD> "} if ($help -or (($command -ne $null) -and ($command.Contains("/help") -or $command.Contains("/?")))) { Print-Usage @@ -38,10 +37,10 @@ try { . $PSScriptroot\restore-toolset.ps1 $env:SDK_REPO_ROOT = $RepoRoot - $TestDotnetRoot = Join-Path $ArtifactsDir "bin\redist\$configuration\dotnet" - $testDotnetVersion = (Get-Childitem -Directory "$TestDotnetRoot\sdk")[-1].Name + + $env:TestDotnetSdkHash = Get-Content -Path (Join-Path $TestDotnetRoot "sdk\$testDotnetVersion\.version") -TotalCount 1 $env:DOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR = Join-Path $TestDotnetRoot "sdk\$testDotnetVersion\Sdks" $env:MicrosoftNETBuildExtensionsTargets = Join-Path $ArtifactsDir "bin\$configuration\Sdks\Microsoft.NET.Build.Extensions\msbuildExtensions\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.targets" @@ -52,13 +51,25 @@ try { # Locally built SDK package version is Major.Minor.0-dev, which won't be available. $env:BuildWithNetFrameworkHostedCompiler = $false + # Prompt + function global:prompt { + # Run command agains $env:SDK_REPO_ROOT to see if there are any changes + $testDotnetSdkCurrentHash = git -C $env:SDK_REPO_ROOT rev-parse HEAD + $hasGitChanges = $testDotnetSdkCurrentHash -ne $env:TestDotnetSdkHash + if ($hasGitChanges) { + "$([char]0x1b)[0;35m(dotnet dogfood *)$([char]0x1b)[0m $PWD > " + } else { + "$([char]0x1b)[0;35m(dotnet dogfood)$([char]0x1b)[0m $PWD > " + } + } + if ($command -eq $null -and $env:DOTNET_SDK_DOGFOOD_SHELL -ne $null) { $command = , $env:DOTNET_SDK_DOGFOOD_SHELL } if ($command -ne $null) { $Host.UI.RawUI.WindowTitle = "SDK Test ($RepoRoot) ($configuration)" - & $command[0] $command[1..($command.Length-1)] + & $command[0] $command[1..($command.Length-1)] } } catch { diff --git a/eng/dogfood.sh b/eng/dogfood.sh index 9394bd4ecbd0..23047a3b1807 100755 --- a/eng/dogfood.sh +++ b/eng/dogfood.sh @@ -21,8 +21,19 @@ export SDK_REPO_ROOT="$repo_root" testDotnetRoot="$artifacts_dir/bin/redist/$configuration/dotnet" testDotnetVersion=$(ls $testDotnetRoot/sdk) export DOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR="$testDotnetRoot/sdk/$testDotnetVersion/Sdks" +export TestDotnetSdkHash=$(head -1 "$testDotnetRoot/sdk/$testDotnetVersion/.version") export MicrosoftNETBuildExtensionsTargets="$artifacts_dir/bin/$configuration/Sdks/Microsoft.NET.Build.Extensions/msbuildExtensions/Microsoft/Microsoft.NET.Build.Extensions/Microsoft.NET.Build.Extensions.targets" export PATH=$testDotnetRoot:$PATH export DOTNET_ROOT=$testDotnetRoot -export PS1="(dogfood) $PS1" \ No newline at end of file + +testDotnetSdkCurrentHash = git -c $SDK_REPO_ROOT rev-parse HEAD +hasGitChanges = $testDotnetSdkCurrentHash != $TestDotnetSdkHash + +if [$hasGitChanges]; then + export PS1="\x1b[0;35m(dotnet dogfood*)\x1b[0m $PS1" +else + export PS1="\x1b[0;35m(dotnet dogfood)\x1b[0m $PS1" +fi + + diff --git a/eng/eng.sln b/eng/eng.sln new file mode 100644 index 000000000000..d120a000afb7 --- /dev/null +++ b/eng/eng.sln @@ -0,0 +1,35 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.2.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dependabot", "dependabot\dependabot.csproj", "{8F679A97-6BF2-8E61-764F-4CB50EF6848F}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "common", "common", "{881589EE-639B-0A35-DBCE-5D94E4FC90C0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tools", "common\internal\Tools.csproj", "{EC3C2A6A-F9C1-3B52-791D-863B6891FEFB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8F679A97-6BF2-8E61-764F-4CB50EF6848F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8F679A97-6BF2-8E61-764F-4CB50EF6848F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8F679A97-6BF2-8E61-764F-4CB50EF6848F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8F679A97-6BF2-8E61-764F-4CB50EF6848F}.Release|Any CPU.Build.0 = Release|Any CPU + {EC3C2A6A-F9C1-3B52-791D-863B6891FEFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EC3C2A6A-F9C1-3B52-791D-863B6891FEFB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EC3C2A6A-F9C1-3B52-791D-863B6891FEFB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EC3C2A6A-F9C1-3B52-791D-863B6891FEFB}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {EC3C2A6A-F9C1-3B52-791D-863B6891FEFB} = {881589EE-639B-0A35-DBCE-5D94E4FC90C0} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {0D38F9D6-853D-4DB5-A726-8C01C293B732} + EndGlobalSection +EndGlobal