add coverage things
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -9,7 +9,7 @@
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
tools
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
|
||||
23
.vscode/launch.json
vendored
Normal file
23
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": ".NET Core Launch (console)",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"preLaunchTask": "build",
|
||||
"program": "${workspaceRoot}/bin/Debug/<target-framework>/<project-name.dll>",
|
||||
"args": [],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"externalConsole": false,
|
||||
"stopAtEntry": false,
|
||||
"internalConsoleOptions": "openOnSessionStart"
|
||||
},
|
||||
{
|
||||
"name": ".NET Core Attach",
|
||||
"type": "coreclr",
|
||||
"request": "attach",
|
||||
"processId": "${command.pickProcess}"
|
||||
}
|
||||
]
|
||||
}
|
||||
16
.vscode/tasks.json
vendored
Normal file
16
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"version": "0.1.0",
|
||||
"command": "dotnet",
|
||||
"isShellCommand": true,
|
||||
"args": [],
|
||||
"tasks": [
|
||||
{
|
||||
"taskName": "build",
|
||||
"args": [
|
||||
""
|
||||
],
|
||||
"isBuildCommand": true,
|
||||
"problemMatcher": "$msCompile"
|
||||
}
|
||||
]
|
||||
}
|
||||
6
Coverage.ps1
Normal file
6
Coverage.ps1
Normal file
@@ -0,0 +1,6 @@
|
||||
nuget install OpenCover -Version 4.6.519 -OutputDirectory tools
|
||||
nuget install coveralls.net -Version 0.7.0 -OutputDirectory tools
|
||||
|
||||
.\tools\OpenCover.4.6.519\tools\OpenCover.Console.exe -target:"C:\Program Files\dotnet\dotnet.exe" -targetargs:" test "".\src\UriBuilder.Fluent.UnitTests"" -f net461" -register:user -filter:"+[UriBuilder*]* -[*Tests]*" -returntargetcode -output:opencover_results.xml
|
||||
|
||||
.\tools\coveralls.net.0.7.0\tools\csmacnz.Coveralls.exe --opencover -i .\opencover_results.xml
|
||||
@@ -12,6 +12,7 @@ init:
|
||||
before_build:
|
||||
- ps: invoke-webrequest https://go.microsoft.com/fwlink/?LinkID=827524 -OutFile core.exe
|
||||
- ps: .\core.exe /install /quiet /norestart
|
||||
- ps: .\update-projectjson.ps1
|
||||
- ps: dotnet restore
|
||||
|
||||
build_script:
|
||||
@@ -20,4 +21,5 @@ build_script:
|
||||
- ps: dotnet build -c Release .\src\UriBuilder.Fluent.UnitTests
|
||||
|
||||
test_script:
|
||||
- ps: dotnet test -c Release .\src\UriBuilder.Fluent.UnitTests
|
||||
- ps: dotnet test -c Release .\src\UriBuilder.Fluent.UnitTests
|
||||
- ps: .\Coverage.ps1
|
||||
@@ -9,6 +9,7 @@
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"net46": {},
|
||||
"netcoreapp1.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.App": {
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace System
|
||||
valuesEnum = new string[0];
|
||||
}
|
||||
var isfirst = string.IsNullOrWhiteSpace(bld.Query);
|
||||
var intitialValue = isfirst ? "?" : $"{bld.Query}&";
|
||||
var intitialValue = isfirst ? "" : $"{bld.Query.TrimStart('?')}&";
|
||||
var sb = new StringBuilder($"{intitialValue}{key}");
|
||||
var validValueHit = false;
|
||||
foreach(var value in valuesEnum)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"netstandard1.6": {
|
||||
"netstandard1.3": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
Get-ChildItem -Path $ENV:APPVEYOR_BUILD_FOLDER -Recurse –File -Filter project.json | foreach {
|
||||
$jsonFile = Get-Content $_.FullName -raw | ConvertFrom-Json
|
||||
if($jsonFile.version)
|
||||
{
|
||||
$jsonFile.version = $ENV:APPVEYOR_BUILD_VERSION
|
||||
$jsonFile | ConvertTo-Json -Depth 999 | Out-File $_.FullName
|
||||
}
|
||||
}
|
||||
$projectJsonFileLocation = "src/UriBuilder.Fluent/project.json"
|
||||
$newVersion = $env:APPVEYOR_REPO_TAG_NAME
|
||||
if($newVersion -eq $null)
|
||||
{
|
||||
$newVersion = "1.0.0-${env:APPVEYOR_BUILD_VERSION}"
|
||||
}
|
||||
if($newVersion -eq $null)
|
||||
{
|
||||
return
|
||||
}
|
||||
|
||||
Write-Host "$projectJsonFileLocation will be update with new version '$newVersion'"
|
||||
|
||||
$json = (Get-Content $projectJsonFileLocation -Raw) | ConvertFrom-Json
|
||||
$json.version = $newVersion
|
||||
$json | ConvertTo-Json -depth 100 | Out-File $projectJsonFileLocation
|
||||
Reference in New Issue
Block a user