Skip to content

Commit

Permalink
Switched to MSBuild.
Browse files Browse the repository at this point in the history
  • Loading branch information
lextm committed Oct 22, 2020
1 parent 8c8bd10 commit 7119c11
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 22 deletions.
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Expand Up @@ -30,7 +30,7 @@ jobs:
- script: |
set -e
sudo pwsh -file patch-winfx.ps1 $(Agent.ToolsDirectory)/dotnet/sdk/3.1.101
dotnet build SharpSnmpLib.NetStandard.sln --configuration $(buildConfiguration)
pwsh -file release.ps1 $(buildConfiguration)
dotnet test Tests/CSharpCore/Tests.NetStandard.csproj --configuration $(buildConfiguration) --no-build --logger trx
- task: PublishTestResults@2
condition: succeededOrFailed()
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
sudo sysctl -w net.inet.udp.maxdgram=65535
export CI=true
set -e
dotnet build SharpSnmpLib.NetStandard.sln --configuration $(buildConfiguration)
pwsh -file release.ps1 $(buildConfiguration)
dotnet test Tests/CSharpCore/Tests.NetStandard.csproj --configuration $(buildConfiguration) --no-build --logger trx
- task: PublishTestResults@2
condition: succeededOrFailed()
Expand Down
2 changes: 1 addition & 1 deletion global.json
@@ -1,5 +1,5 @@
{
"msbuild-sdks": {
"MSBuild.Sdk.Extras": "2.0.43"
"MSBuild.Sdk.Extras": "2.0.54"
}
}
14 changes: 9 additions & 5 deletions release.ps1
@@ -1,3 +1,9 @@
[CmdletBinding()]
param(
[Parameter(Position = 0)]
[string] $Configuration = 'Release'
)

$msBuild = "msbuild"
$onWindows = $false
try
Expand Down Expand Up @@ -38,11 +44,9 @@ catch

Write-Host "MSBuild found. Compile the projects."

$solution = "SharpSnmpLib.NetStandard.sln"

& $msBuild $solution /p:Configuration=Release /t:restore
& $msBuild $solution /p:Configuration=Release /t:clean
& $msBuild $solution /p:Configuration=Release
& $msBuild /m /p:Configuration=$Configuration /t:restore
& $msBuild /m /p:Configuration=$Configuration /t:clean
& $msBuild /m /p:Configuration=$Configuration
if ($LASTEXITCODE -ne 0)
{
Write-Host "Compilation failed. Exit."
Expand Down
8 changes: 7 additions & 1 deletion sign2.bat
@@ -1,5 +1,11 @@
set signtool="C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x64\signtool.exe"
if exist %signtool% (
echo "sign the assembly"
%signtool% sign /tr http://timestamp.digicert.com /td sha256 /fd sha256 /a "%1"
@IF %ERRORLEVEL% NEQ 0 pause
IF %ERRORLEVEL% NEQ 0 (
echo %ERRORLEVEL%
exit /b 1
)
)

exit /b 0
30 changes: 17 additions & 13 deletions sign3.bat
@@ -1,15 +1,19 @@
set signtool="C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x64\signtool.exe"
mkdir .\SharpSnmpLib\bin\Release
cd .\SharpSnmpLib\bin\Release
for /r %%i in (*.exe *.dll) do (
%signtool% verify /pa /q "%%i"
@IF %ERRORLEVEL% NEQ 0 PAUSE
if exist %signtool% (
mkdir .\SharpSnmpLib\bin\Release
cd .\SharpSnmpLib\bin\Release
for /r %%i in (*.exe *.dll) do (
%signtool% verify /pa /q "%%i"
@IF %ERRORLEVEL% NEQ 0 PAUSE
)
cd ..\..\..
mkdir .\SharpSnmpLib.BouncyCastle\bin\Release
cd .\SharpSnmpLib.BouncyCastle\bin\Release
for /r %%i in (*.exe *.dll) do (
%signtool% verify /pa /q "%%i"
@IF %ERRORLEVEL% NEQ 0 PAUSE
)
cd ..\..\..
)
cd ..\..\..
mkdir .\SharpSnmpLib.BouncyCastle\bin\Release
cd .\SharpSnmpLib.BouncyCastle\bin\Release
for /r %%i in (*.exe *.dll) do (
%signtool% verify /pa /q "%%i"
@IF %ERRORLEVEL% NEQ 0 PAUSE
)
cd ..\..\..

exit /b 0

0 comments on commit 7119c11

Please sign in to comment.