Skip to content

Commit f92639d

Browse files
Remove KoreBuild
Remove usage of KoreBuild as it is obsolete and no longer supports .NET Core 3.0 after preview 5. Add code coverage to test project.
1 parent 204ca5e commit f92639d

File tree

10 files changed

+164
-442
lines changed

10 files changed

+164
-442
lines changed

AspNet.Security.OAuth.Providers.sln

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
129129
build.sh = build.sh
130130
CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md
131131
global.json = global.json
132-
korebuild-lock.txt = korebuild-lock.txt
133-
korebuild.json = korebuild.json
134132
LICENSE = LICENSE
135133
NuGet.config = NuGet.config
136134
README.md = README.md

build.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
@ECHO OFF
2-
PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' default-build %*; exit $LASTEXITCODE"
2+
PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' %*; exit $LASTEXITCODE"

build.ps1

Lines changed: 2 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,6 @@
11
$ErrorActionPreference = "Stop"
22

3-
function DownloadWithRetry([string] $url, [string] $downloadLocation, [int] $retries)
4-
{
5-
while($true)
6-
{
7-
try
8-
{
9-
Invoke-WebRequest $url -OutFile $downloadLocation
10-
break
11-
}
12-
catch
13-
{
14-
$exceptionMessage = $_.Exception.Message
15-
Write-Host "Failed to download '$url': $exceptionMessage"
16-
if ($retries -gt 0) {
17-
$retries--
18-
Write-Host "Waiting 10 seconds before retrying. Retries left: $retries"
19-
Start-Sleep -Seconds 10
20-
21-
}
22-
else
23-
{
24-
$exception = $_.Exception
25-
throw $exception
26-
}
27-
}
28-
}
29-
}
30-
31-
cd $PSScriptRoot
32-
33-
$repoFolder = $PSScriptRoot
34-
$env:REPO_FOLDER = $repoFolder
35-
36-
$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip"
37-
if ($env:KOREBUILD_ZIP)
38-
{
39-
$koreBuildZip=$env:KOREBUILD_ZIP
40-
}
41-
42-
$buildFolder = ".build"
43-
$buildFile="$buildFolder\KoreBuild.ps1"
44-
45-
if (!(Test-Path $buildFolder)) {
46-
Write-Host "Downloading KoreBuild from $koreBuildZip"
47-
48-
$tempFolder=$env:TEMP + "\KoreBuild-" + [guid]::NewGuid()
49-
New-Item -Path "$tempFolder" -Type directory | Out-Null
50-
51-
$localZipFile="$tempFolder\korebuild.zip"
52-
53-
DownloadWithRetry -url $koreBuildZip -downloadLocation $localZipFile -retries 6
54-
55-
Add-Type -AssemblyName System.IO.Compression.FileSystem
56-
[System.IO.Compression.ZipFile]::ExtractToDirectory($localZipFile, $tempFolder)
57-
58-
New-Item -Path "$buildFolder" -Type directory | Out-Null
59-
copy-item "$tempFolder\**\build\*" $buildFolder -Recurse
60-
61-
# Cleanup
62-
if (Test-Path $tempFolder) {
63-
Remove-Item -Recurse -Force $tempFolder
64-
}
65-
}
3+
Set-Location $PSScriptRoot
4+
$buildFile = Join-Path "$PSScriptRoot" "Run.ps1"
665

676
&"$buildFile" @args

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
55

66
# Call "sync" between "chmod" and execution to prevent "text file busy" error in Docker (aufs)
77
chmod +x "$DIR/run.sh"; sync
8-
"$DIR/run.sh" default-build "$@"
8+
"$DIR/run.sh" "$@"

build/common.props

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,12 @@
1111
<DebugType>portable</DebugType>
1212
</PropertyGroup>
1313

14+
<PropertyGroup>
15+
<CollectCoverage>true</CollectCoverage>
16+
<CoverletOutput>$(OutputPath)/</CoverletOutput>
17+
<CoverletOutputFormat>cobertura,json</CoverletOutputFormat>
18+
<Exclude>[Mvc.Client*]*,[xunit.*]*</Exclude>
19+
<ExcludeByAttribute>System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute</ExcludeByAttribute>
20+
</PropertyGroup>
21+
1422
</Project>

build/dependencies.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,15 @@
99
<JustEatHttpClientInterceptionVersion>2.0.1</JustEatHttpClientInterceptionVersion>
1010
<MartinCostelloLoggingXUnitVersion>0.1.0</MartinCostelloLoggingXUnitVersion>
1111
<MicrosoftSourceLinkGitHubVersion>1.0.0-beta2-19270-01</MicrosoftSourceLinkGitHubVersion>
12+
<ReportGeneratorVersion>4.2.2</ReportGeneratorVersion>
1213
<ShouldlyVersion>3.0.2</ShouldlyVersion>
1314
<TwitterProviderVersion>3.0.0-preview6.19307.2</TwitterProviderVersion>
1415
<XunitVersion>2.4.1</XunitVersion>
1516
</PropertyGroup>
1617

18+
<ItemGroup>
19+
<PackageReference Include="coverlet.msbuild" Version="$(CoverletVersion)" PrivateAssets="All" />
20+
<PackageReference Include="ReportGenerator" Version="$(ReportGeneratorVersion)" PrivateAssets="All" />
21+
</ItemGroup>
22+
1723
</Project>

korebuild-lock.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

korebuild.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)