Skip to content

Commit 63350d0

Browse files
committed
build: Take optional path to strong name sign file
If specified and file exists, the solution will be built with strong name signing enabled. Typically only the build server will do this, which has the private key installed.
1 parent d5e2222 commit 63350d0

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

Build/build-all-release.bat

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
@echo off
2-
SET ROOT=%~dp0..
3-
"C:\Program Files (x86)\MSBuild\14.0\Bin\MsBuild.exe" %ROOT%\Build\all.msbuild /verbosity:normal /p:Configuration=Release /p:Platform="AnyCPU" /target:CleanAndBuild /p:RestorePackages=false
2+
set StrongNameSignFile=%1
3+
set ROOT=%~dp0..
4+
if exist %StrongNameSignFile% (
5+
echo "BUILD WITH STRONG NAME SIGNING USING %StrongNameSignFile%"
6+
pause
7+
"C:\Program Files (x86)\MSBuild\14.0\Bin\MsBuild.exe" %ROOT%\Build\all.msbuild /verbosity:normal /p:Configuration=Release /p:Platform="AnyCPU" /target:CleanAndBuild /p:RestorePackages=false /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=%StrongNameSignFile%
8+
) else (
9+
echo "NO STRONG NAME SIGNING FILE"
10+
pause
11+
"C:\Program Files (x86)\MSBuild\14.0\Bin\MsBuild.exe" %ROOT%\Build\all.msbuild /verbosity:normal /p:Configuration=Release /p:Platform="AnyCPU" /target:CleanAndBuild /p:RestorePackages=false
12+
)
413
if %errorlevel% neq 0 exit /b %errorlevel%

Build/build.bat

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@echo off
2-
SET ROOT=%~dp0..
2+
set StrongNameSignFile=%1
3+
set ROOT=%~dp0..
34

45
if exist %ROOT%\Artifacts rmdir /Q /S %ROOT%\Artifacts
56

@@ -9,7 +10,7 @@ if %errorlevel% neq 0 exit /b %errorlevel%
910
call %ROOT%\Build\nuget-restore.bat
1011
if %errorlevel% neq 0 exit /b %errorlevel%
1112

12-
call %ROOT%\Build\build-all-release.bat
13+
call %ROOT%\Build\build-all-release.bat "%StrongNameSignFile%"
1314
if %errorlevel% neq 0 exit /b %errorlevel%
1415

1516
call %ROOT%\Build\run-tests.bat

0 commit comments

Comments
 (0)