From 6706e7cc0b69211688d67219c560da3c170930ac Mon Sep 17 00:00:00 2001 From: Joel Verhagen Date: Wed, 11 Feb 2026 21:09:29 -0500 Subject: [PATCH] Allow RepositoryRootDirectory to be set (#10713) * Allow custom repository root directory --- build/common.ps1 | 11 ++++++++--- build/sign-binaries.proj | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/build/common.ps1 b/build/common.ps1 index 153bf9943e..0a4a4c041d 100644 --- a/build/common.ps1 +++ b/build/common.ps1 @@ -200,19 +200,24 @@ Function Sign-Binaries { [int]$BuildNumber = (Get-BuildNumber), [string]$MSBuildVersion = $DefaultMSBuildVersion, [string[]]$ProjectsToSign = $null, - [switch]$BinLog + [switch]$BinLog, + [string]$RepositoryRootDirectory = $null ) - if ($ProjectsToSign -eq $null) { + if ($null -eq $ProjectsToSign) { $repositoryDir = [IO.Path]::GetDirectoryName($PSScriptRoot) $defaultProjectsToSign = Join-Path $repositoryDir "src\**\*.csproj" $ProjectsToSign = @($defaultProjectsToSign) } $projectsToSignProperty = $ProjectsToSign -join ';' + $msbuildProperties = "/p:ProjectsToSign=`"$projectsToSignProperty`"" + if ($RepositoryRootDirectory) { + $msbuildProperties += ";RepositoryRootDirectory=`"$RepositoryRootDirectory`"" + } $ProjectPath = Join-Path $PSScriptRoot "sign-binaries.proj" - Build-Solution $Configuration $BuildNumber -MSBuildVersion "$MSBuildVersion" $ProjectPath -MSBuildProperties "/p:ProjectsToSign=`"$projectsToSignProperty`"" -BinLog:$BinLog + Build-Solution $Configuration $BuildNumber -MSBuildVersion "$MSBuildVersion" $ProjectPath -MSBuildProperties $msbuildProperties -BinLog:$BinLog } Function Sign-Packages { diff --git a/build/sign-binaries.proj b/build/sign-binaries.proj index 46e708d061..95277349ff 100644 --- a/build/sign-binaries.proj +++ b/build/sign-binaries.proj @@ -3,7 +3,7 @@ - $([System.IO.Path]::GetDirectoryName($(MSBuildProjectDirectory)))\ + $([System.IO.Path]::GetDirectoryName($(MSBuildProjectDirectory)))\ $(RepositoryRootDirectory)artifacts\sign\obj\ $(RepositoryRootDirectory) BatchSign