Skip to content

Commit

Permalink
Merge pull request #158 from bugsnag/release/3.1.0
Browse files Browse the repository at this point in the history
Release v3.1.0
  • Loading branch information
yousif-bugsnag committed Jun 15, 2022
2 parents 55d4028 + 20f06cf commit bf2b163
Show file tree
Hide file tree
Showing 16 changed files with 77 additions and 278 deletions.
Binary file added .assets/bugsnag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"cake.tool": {
"version": "2.2.0",
"commands": [
"dotnet-cake"
]
}
}
}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

## 3.1.0 (2022-06-15)

### Enhancements

The `Bugsnag` and `Bugsnag.AspNet.Core` packages now officially support .NET Core 3.x, .NET 5 and .NET 6.

## 3.0.1 (2022-03-24)

### Bug fixes
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
image: Visual Studio 2017
image: Visual Studio 2022
install:
- set PATH=C:\Ruby25-x64\bin;%PATH%
build_script:
- ps: .\build.ps1 -Target Appveyor
- ps: .\build.ps1 --target Appveyor
after_build:
- ps: 7z a build\bugsnag.zip build\Release\**\Bugsnag*.dll build\Release\**\Bugsnag*.pdb
test: off
Expand Down
39 changes: 21 additions & 18 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#tool "nuget:?package=xunit.runner.console"
#addin nuget:?package=Cake.SemVer
#addin nuget:?package=semver&version=2.0.4

var solution = File("./Bugsnag.sln");
var target = Argument("target", "Default");
Expand Down Expand Up @@ -28,21 +25,27 @@ Task("Build")
.SetConfiguration(configuration));
});

Task("Test")
.IsDependentOn("Build")
.Does(() => {
var testAssemblies = GetFiles($"{buildDir}/**/*.Tests.dll");
XUnit2(testAssemblies,
new XUnit2Settings {
ArgumentCustomization = args => {
if (AppVeyor.IsRunningOnAppVeyor)
{
args.Append("-appveyor");
}
return args;
Task("Test")
.IsDependentOn("Build")
.Does(() => {
var testAssemblies = GetFiles($"{buildDir}/**/*.Tests.dll");
var settings = new DotNetTestSettings
{
Configuration = configuration,
ArgumentCustomization = args => {
if (AppVeyor.IsRunningOnAppVeyor)
{
args.Append("-appveyor");
}
});
});
return args;
}
};
foreach(var file in testAssemblies)
{
DotNetTest(file.FullPath, "MSTest.MapInconclusiveToFailed=true", settings);
}
});

Task("Pack")
.IsDependentOn("Test")
Expand Down Expand Up @@ -89,7 +92,7 @@ Task("MazeRunner")
.IsDependentOn("Pack")
.Does(() => {
StartProcess("cmd", "/c bundle install");
var mazeRunner = StartProcess("cmd", $"/c \"set BUGSNAG_VERSION={version} && bundle exec bugsnag-maze-runner\"");
var mazeRunner = StartProcess("cmd", $"/c \"set BUGSNAG_VERSION={version} && bundle exec bugsnag-maze-runner --verbose\"");
if (mazeRunner != 0) {
throw new Exception("maze-runner failed");
}
Expand Down
239 changes: 8 additions & 231 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,234 +1,11 @@
##########################################################################
# This is the Cake bootstrapper script for PowerShell.
# This file was downloaded from https://github.com/cake-build/resources
# Feel free to change this file to fit your needs.
##########################################################################
Set-Location -LiteralPath $PSScriptRoot

<#
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = '1'
$env:DOTNET_CLI_TELEMETRY_OPTOUT = '1'
$env:DOTNET_NOLOGO = '1'

.SYNOPSIS
This is a Powershell script to bootstrap a Cake build.
dotnet tool restore
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

.DESCRIPTION
This Powershell script will download NuGet if missing, restore NuGet tools (including Cake)
and execute your Cake build script with the parameters you provide.
.PARAMETER Script
The build script to execute.
.PARAMETER Target
The build script target to run.
.PARAMETER Configuration
The build configuration to use.
.PARAMETER Verbosity
Specifies the amount of information to be displayed.
.PARAMETER ShowDescription
Shows description about tasks.
.PARAMETER DryRun
Performs a dry run.
.PARAMETER Experimental
Uses the nightly builds of the Roslyn script engine.
.PARAMETER Mono
Uses the Mono Compiler rather than the Roslyn script engine.
.PARAMETER SkipToolPackageRestore
Skips restoring of packages.
.PARAMETER ScriptArgs
Remaining arguments are added here.
.LINK
https://cakebuild.net
#>

[CmdletBinding()]
Param(
[string]$Script = "build.cake",
[string]$Target,
[string]$Configuration,
[ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
[string]$Verbosity,
[switch]$ShowDescription,
[Alias("WhatIf", "Noop")]
[switch]$DryRun,
[switch]$Experimental,
[switch]$Mono,
[switch]$SkipToolPackageRestore,
[Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
[string[]]$ScriptArgs
)

[Reflection.Assembly]::LoadWithPartialName("System.Security") | Out-Null
function MD5HashFile([string] $filePath)
{
if ([string]::IsNullOrEmpty($filePath) -or !(Test-Path $filePath -PathType Leaf))
{
return $null
}

[System.IO.Stream] $file = $null;
[System.Security.Cryptography.MD5] $md5 = $null;
try
{
$md5 = [System.Security.Cryptography.MD5]::Create()
$file = [System.IO.File]::OpenRead($filePath)
return [System.BitConverter]::ToString($md5.ComputeHash($file))
}
finally
{
if ($file -ne $null)
{
$file.Dispose()
}
}
}

function GetProxyEnabledWebClient
{
$wc = New-Object System.Net.WebClient
$proxy = [System.Net.WebRequest]::GetSystemWebProxy()
$proxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials
$wc.Proxy = $proxy
return $wc
}

Write-Host "Preparing to run build script..."

if(!$PSScriptRoot){
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
}

$TOOLS_DIR = Join-Path $PSScriptRoot "tools"
$ADDINS_DIR = Join-Path $TOOLS_DIR "Addins"
$MODULES_DIR = Join-Path $TOOLS_DIR "Modules"
$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe"
$CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe"
$NUGET_URL = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
$PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config"
$PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum"
$ADDINS_PACKAGES_CONFIG = Join-Path $ADDINS_DIR "packages.config"
$MODULES_PACKAGES_CONFIG = Join-Path $MODULES_DIR "packages.config"

# Make sure tools folder exists
if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) {
Write-Verbose -Message "Creating tools directory..."
New-Item -Path $TOOLS_DIR -Type directory | out-null
}

# Make sure that packages.config exist.
if (!(Test-Path $PACKAGES_CONFIG)) {
Write-Verbose -Message "Downloading packages.config..."
try {
$wc = GetProxyEnabledWebClient
$wc.DownloadFile("https://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG) } catch {
Throw "Could not download packages.config."
}
}

# Try find NuGet.exe in path if not exists
if (!(Test-Path $NUGET_EXE)) {
Write-Verbose -Message "Trying to find nuget.exe in PATH..."
$existingPaths = $Env:Path -Split ';' | Where-Object { (![string]::IsNullOrEmpty($_)) -and (Test-Path $_ -PathType Container) }
$NUGET_EXE_IN_PATH = Get-ChildItem -Path $existingPaths -Filter "nuget.exe" | Select -First 1
if ($NUGET_EXE_IN_PATH -ne $null -and (Test-Path $NUGET_EXE_IN_PATH.FullName)) {
Write-Verbose -Message "Found in PATH at $($NUGET_EXE_IN_PATH.FullName)."
$NUGET_EXE = $NUGET_EXE_IN_PATH.FullName
}
}

# Try download NuGet.exe if not exists
if (!(Test-Path $NUGET_EXE)) {
Write-Verbose -Message "Downloading NuGet.exe..."
try {
$wc = GetProxyEnabledWebClient
$wc.DownloadFile($NUGET_URL, $NUGET_EXE)
} catch {
Throw "Could not download NuGet.exe."
}
}

# Save nuget.exe path to environment to be available to child processed
$ENV:NUGET_EXE = $NUGET_EXE

# Restore tools from NuGet?
if(-Not $SkipToolPackageRestore.IsPresent) {
Push-Location
Set-Location $TOOLS_DIR

# Check for changes in packages.config and remove installed tools if true.
[string] $md5Hash = MD5HashFile($PACKAGES_CONFIG)
if((!(Test-Path $PACKAGES_CONFIG_MD5)) -Or
($md5Hash -ne (Get-Content $PACKAGES_CONFIG_MD5 ))) {
Write-Verbose -Message "Missing or changed package.config hash..."
Remove-Item * -Recurse -Exclude packages.config,nuget.exe
}

Write-Verbose -Message "Restoring tools from NuGet..."
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`""

if ($LASTEXITCODE -ne 0) {
Throw "An error occured while restoring NuGet tools."
}
else
{
$md5Hash | Out-File $PACKAGES_CONFIG_MD5 -Encoding "ASCII"
}
Write-Verbose -Message ($NuGetOutput | out-string)

Pop-Location
}

# Restore addins from NuGet
if (Test-Path $ADDINS_PACKAGES_CONFIG) {
Push-Location
Set-Location $ADDINS_DIR

Write-Verbose -Message "Restoring addins from NuGet..."
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$ADDINS_DIR`""

if ($LASTEXITCODE -ne 0) {
Throw "An error occured while restoring NuGet addins."
}

Write-Verbose -Message ($NuGetOutput | out-string)

Pop-Location
}

# Restore modules from NuGet
if (Test-Path $MODULES_PACKAGES_CONFIG) {
Push-Location
Set-Location $MODULES_DIR

Write-Verbose -Message "Restoring modules from NuGet..."
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$MODULES_DIR`""

if ($LASTEXITCODE -ne 0) {
Throw "An error occured while restoring NuGet modules."
}

Write-Verbose -Message ($NuGetOutput | out-string)

Pop-Location
}

# Make sure that Cake has been installed.
if (!(Test-Path $CAKE_EXE)) {
Throw "Could not find Cake.exe at $CAKE_EXE"
}



# Build Cake arguments
$cakeArguments = @("$Script");
if ($Target) { $cakeArguments += "-target=$Target" }
if ($Configuration) { $cakeArguments += "-configuration=$Configuration" }
if ($Verbosity) { $cakeArguments += "-verbosity=$Verbosity" }
if ($ShowDescription) { $cakeArguments += "-showdescription" }
if ($DryRun) { $cakeArguments += "-dryrun" }
if ($Experimental) { $cakeArguments += "-experimental" }
if ($Mono) { $cakeArguments += "-mono" }
$cakeArguments += $ScriptArgs

# Start Cake
Write-Host "Running build script..."
&$CAKE_EXE $cakeArguments
exit $LASTEXITCODE
dotnet cake @args
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
4 changes: 2 additions & 2 deletions features/steps/website_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
When("I run the console app {string} with {string}") do |name, args|
path = File.join(Dir.pwd, "features", "fixtures", name)
nuget_package_path = File.join(Dir.pwd, "build", "packages")
run_command("dotnet nuget locals all --clear")
run_command("dotnet add #{path} package -v #{ENV['BUGSNAG_VERSION']} bugsnag")
run_command("dotnet add #{path} package bugsnag --version #{ENV['BUGSNAG_VERSION']} --no-restore")
run_command("dotnet restore #{path} --source #{nuget_package_path} --no-cache")
run_command(@script_env || {}, "dotnet run -p #{path} -- #{args}")
end

Expand Down
2 changes: 1 addition & 1 deletion src/Bugsnag/Payload/StackTraceLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public IEnumerator<StackTraceLine> GetEnumerator()
var stackFrames = new System.Diagnostics.StackTrace(_originalException, true).GetFrames();

#if !NETSTANDARD1_3
if (stackFrames == null)
if (stackFrames == null || stackFrames.Length == 0)
{
// this usually means that the exception has not been thrown so we need
// to try and create a stack trace at the point that the notify call
Expand Down
7 changes: 5 additions & 2 deletions src/Directory.build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<Version></Version>
<Copyright>© 2018 Bugsnag Inc.</Copyright>
<PackageTags>bugsnag crash exception-handling exception-reporting exception-handler error-monitoring error-reporting error-handling unhandled-exceptions debug exceptions error errors bug bugs crash-reporting crash-reporting-tool error-log diagnostic</PackageTags>
<PackageLicenseUrl>https://raw.githubusercontent.com/bugsnag/bugsnag-dotnet/master/LICENSE.txt</PackageLicenseUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/bugsnag/bugsnag-dotnet</PackageProjectUrl>
<PackageIconUrl>https://s3.amazonaws.com/bugsnag.com/images/square-logo-small.png</PackageIconUrl>
<PackageIcon>bugsnag.png</PackageIcon>
<DisableImplicitFrameworkReferences Condition="'$(TargetFramework)' != 'netstandard1.3' AND '$(TargetFramework)' != 'netstandard2.0'">true</DisableImplicitFrameworkReferences>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<LangVersion>7.1</LangVersion>
Expand All @@ -15,4 +15,7 @@
<AssemblyOriginatorKeyFile>$(MSBuildStartupDirectory)\Bugsnag.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)../.assets/bugsnag.png" Pack="true" PackagePath=""/>
</ItemGroup>
</Project>
Loading

0 comments on commit bf2b163

Please sign in to comment.