From 51848a1361afa502677724f2b4ae5d5b2e2f8ff9 Mon Sep 17 00:00:00 2001 From: Oren Novotny Date: Thu, 19 Jul 2018 20:49:51 -0400 Subject: Update build scripts to add code coverage --- .vsts-shared.yml | 23 +++++++++++++---------- BouncyCastle.sln | 4 +++- CodeCoverage.runsettings | 33 +++++++++++++++++++++++++++++++++ crypto/src/crypto.csproj | 2 +- crypto/test/crypto.test.csproj | 2 +- scripts/Sign-Package.ps1 | 8 +++----- scripts/setversion.csproj | 20 -------------------- scripts/version.json | 8 -------- 8 files changed, 54 insertions(+), 46 deletions(-) create mode 100644 CodeCoverage.runsettings delete mode 100644 scripts/setversion.csproj delete mode 100644 scripts/version.json diff --git a/.vsts-shared.yml b/.vsts-shared.yml index ba1238e72..e6887c280 100644 --- a/.vsts-shared.yml +++ b/.vsts-shared.yml @@ -2,18 +2,21 @@ parameters: signSteps: [] steps: -- task: NuGetToolInstaller@0 - displayName: Use NuGet 4.7.0 +- task: DotNetCoreCLI@2 inputs: - versionSpec: 4.7.0 + command: custom + custom: tool + arguments: install --tool-path . nbgv + displayName: Install NBGV tool + condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false)) -- task: DotNetCoreCLI@2 - inputs: - command: build - projects: scripts/setversion.csproj - arguments: -c $(BuildConfiguration) +- script: nbgv cloud displayName: Set Version - condition: eq(variables['system.pullrequest.isfork'], false) + condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false)) + +- task: DotNetCoreInstaller@0 + inputs: + version: '2.1.400-preview-009063' - task: DotNetCoreCLI@2 inputs: @@ -28,7 +31,7 @@ steps: inputs: command: test projects: .\crypto\test\crypto.test.csproj - arguments: -c $(BuildConfiguration) + arguments: -c $(BuildConfiguration) --collect:"Code Coverage" -s $(System.DefaultWorkingDirectory)\CodeCoverage.runsettings /p:DebugType=portable displayName: Run Tests - ${{ parameters.signSteps }} diff --git a/BouncyCastle.sln b/BouncyCastle.sln index 8963c9e1f..6719011e1 100644 --- a/BouncyCastle.sln +++ b/BouncyCastle.sln @@ -5,7 +5,9 @@ VisualStudioVersion = 15.0.26906.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{43196EF9-B75F-4ABB-8967-DAFD621A7D05}" ProjectSection(SolutionItems) = preProject - appveyor.yml = appveyor.yml + .vsts-ci.yml = .vsts-ci.yml + .vsts-pr.yml = .vsts-pr.yml + .vsts-shared.yml = .vsts-shared.yml README.md = README.md EndProjectSection EndProject diff --git a/CodeCoverage.runsettings b/CodeCoverage.runsettings new file mode 100644 index 000000000..138bceeb9 --- /dev/null +++ b/CodeCoverage.runsettings @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + .*BouncyCastle.* + + + .*Tests.* + + + + + + + + + diff --git a/crypto/src/crypto.csproj b/crypto/src/crypto.csproj index 4b85cb148..7dc2ba1da 100644 --- a/crypto/src/crypto.csproj +++ b/crypto/src/crypto.csproj @@ -36,7 +36,7 @@ - + diff --git a/crypto/test/crypto.test.csproj b/crypto/test/crypto.test.csproj index 6c54181b0..541c88c23 100644 --- a/crypto/test/crypto.test.csproj +++ b/crypto/test/crypto.test.csproj @@ -14,7 +14,7 @@ - + diff --git a/scripts/Sign-Package.ps1 b/scripts/Sign-Package.ps1 index 1d0844ab8..ef144a114 100644 --- a/scripts/Sign-Package.ps1 +++ b/scripts/Sign-Package.ps1 @@ -6,19 +6,17 @@ if([string]::IsNullOrEmpty($env:SignClientSecret)){ return; } -& nuget install SignClient -Version 0.9.1 -SolutionDir "$currentDirectory\..\" -Verbosity quiet -ExcludeVersion -# Setup Variables we need to pass into the sign client tool +dotnet tool install --tool-path . SignClient +# Setup Variables we need to pass into the sign client tool $appSettings = "$currentDirectory\SignClient.json" -$appPath = "$currentDirectory\..\packages\SignClient\tools\netcoreapp2.0\SignClient.dll" - $nupgks = ls $Env:ArtifactDirectory\*.nupkg | Select -ExpandProperty FullName foreach ($nupkg in $nupgks){ Write-Host "Submitting $nupkg for signing" - dotnet $appPath 'sign' -c $appSettings -i $nupkg -r $env:SignClientUser -s $env:SignClientSecret -n 'Portable.BouncyCastle' -d 'Portable.BouncyCastle' -u 'https://github.com/onovotny/bc-sharp' + .\SignClient 'sign' -c $appSettings -i $nupkg -r $env:SignClientUser -s $env:SignClientSecret -n 'Portable.BouncyCastle' -d 'Portable.BouncyCastle' -u 'https://github.com/onovotny/bc-sharp' Write-Host "Finished signing $nupkg" } diff --git a/scripts/setversion.csproj b/scripts/setversion.csproj deleted file mode 100644 index 25f6bb43e..000000000 --- a/scripts/setversion.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - netstandard2.0 - - - - - - - - - - $(BuildVersion) - $(BuildVersion) - $(BuildVersion) - $(BuildVersion) - - - diff --git a/scripts/version.json b/scripts/version.json deleted file mode 100644 index f1b52a7dc..000000000 --- a/scripts/version.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "inherit": true, - "cloudBuild": { - "buildNumber": { - "enabled": true - } - } -} -- cgit 1.4.1