diff options
author | Oren Novotny <oren@novotny.org> | 2018-07-19 20:49:51 -0400 |
---|---|---|
committer | Oren Novotny <oren@novotny.org> | 2018-07-19 20:49:51 -0400 |
commit | 51848a1361afa502677724f2b4ae5d5b2e2f8ff9 (patch) | |
tree | d9a6137e7833a91310b158116cf74d034f66373c | |
parent | Fix Synchronized for modern frameworks (diff) | |
download | BouncyCastle.NET-ed25519-51848a1361afa502677724f2b4ae5d5b2e2f8ff9.tar.xz |
Update build scripts to add code coverage
-rw-r--r-- | .vsts-shared.yml | 23 | ||||
-rw-r--r-- | BouncyCastle.sln | 4 | ||||
-rw-r--r-- | CodeCoverage.runsettings | 33 | ||||
-rw-r--r-- | crypto/src/crypto.csproj | 2 | ||||
-rw-r--r-- | crypto/test/crypto.test.csproj | 2 | ||||
-rw-r--r-- | scripts/Sign-Package.ps1 | 8 | ||||
-rw-r--r-- | scripts/setversion.csproj | 20 | ||||
-rw-r--r-- | scripts/version.json | 8 |
8 files changed, 54 insertions, 46 deletions
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 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- File name extension must be .runsettings --> +<RunSettings> + <DataCollectionRunSettings> + <DataCollectors> + <DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <Configuration> + <CodeCoverage> + + <!-- +About include/exclude lists: +Empty "Include" clauses imply all; empty "Exclude" clauses imply none. +Each element in the list is a regular expression (ECMAScript syntax). See http://msdn.microsoft.com/library/2k3te2cs.aspx. +An item must first match at least one entry in the include list to be included. +Included items must then not match any entries in the exclude list to remain included. +--> + + <!-- Match assembly file paths: --> + <ModulePaths> + <Include> + <ModulePath>.*BouncyCastle.*</ModulePath> + </Include> + <Exclude> + <ModulePath>.*Tests.*</ModulePath> + </Exclude> + </ModulePaths> + + </CodeCoverage> + </Configuration> + </DataCollector> + </DataCollectors> + </DataCollectionRunSettings> +</RunSettings> 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 @@ <ItemGroup> <Compile Include="..\bzip2\src\**\*.cs" LinkBase="bzip2" /> <None Include="..\..\BouncyCastle.snk" /> - <PackageReference Include="NerdBank.GitVersioning" Version="2.1.23" PrivateAssets="All" /> + <PackageReference Include="NerdBank.GitVersioning" Version="2.1.65" PrivateAssets="All" /> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-62925-02" PrivateAssets="All" /> </ItemGroup> 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 @@ <EmbeddedResource Include="data\**\*.*" Exclude="**\README.txt" /> </ItemGroup> <ItemGroup> - <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" /> + <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" /> <PackageReference Include="NUnit" Version="3.10.1" /> <PackageReference Include="NUnit3TestAdapter" Version="3.10.0" /> </ItemGroup> 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 @@ -<Project Sdk="Microsoft.NET.Sdk"> - - <PropertyGroup> - <TargetFramework>netstandard2.0</TargetFramework> - </PropertyGroup> - - <ItemGroup> - <PackageReference Include="Nerdbank.GitVersioning" Version="2.1.23" PrivateAssets="all" /> - </ItemGroup> - - - <Target Name="SetBuildVer" AfterTargets="GetBuildVersion" BeforeTargets="SetCloudBuildVersionVars;SetCloudBuildNumberWithVersion"> - <PropertyGroup> - <CloudBuildNumber>$(BuildVersion)</CloudBuildNumber> - <Version>$(BuildVersion)</Version> - <PackageVersion>$(BuildVersion)</PackageVersion> - <NuGetPackageVersion>$(BuildVersion)</NuGetPackageVersion> - </PropertyGroup> - </Target> -</Project> 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 - } - } -} |