diff --git a/.gitignore b/.gitignore index 165f4dfe..09e6148d 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,10 @@ obj/ /TestResult.xml docs/_build .vs +artifacts/ +build/ +tools/ +!tools/packages.config +!tools/NuGet.config +.vscode +.idea \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 27c0909e..88cc96bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,12 @@ language: csharp +mono: + - weekly + solution: src/SharpRaven.sln + sudo: false -install: - - make +dotnet: 2.0.0 +dist: trusty + script: - - make test \ No newline at end of file + - ./build.sh --verbosity diagnostic --target Travis diff --git a/Makefile b/Makefile deleted file mode 100644 index 52b4c15e..00000000 --- a/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -build: setup-nuget restore - -setup-nuget: - mkdir -p .nuget - wget -O .nuget/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe - -restore: - mono --runtime=v4.0.30319 ".nuget/nuget.exe" Restore "src" - -test: restore - xbuild "./src/SharpRaven.build" - mono --debug --runtime=v4.0.30319 ./src/packages/NUnit.Runners.2.6.4/tools/nunit-console.exe ./src/tests/SharpRaven.UnitTests/bin/Release/net45/SharpRaven.UnitTests.dll -exclude=NuGet,NoMono -nodots diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..5b9d6bb2 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,8 @@ +environment: + NuGetOrgApiKey: + secure: pAgSjPrAcwxzQMP32ya83+Hy+g3uS2J5ubnjv49d9urupYC5xJLVqcPOpnJ4ChYn +version: 1.0.{build} +image: Visual Studio 2017 +build_script: +- ps: .\build.ps1 -Target AppVeyor -Verbosity Diagnostic +test: off diff --git a/build.cake b/build.cake new file mode 100644 index 00000000..c2e42e89 --- /dev/null +++ b/build.cake @@ -0,0 +1,240 @@ +#tool "nuget:?package=NUnit.Runners&version=2.6.4" +#tool "nuget:?package=GitVersion.CommandLine" + +////////////////////////////////////////////////////////////////////// +// ARGUMENTS +////////////////////////////////////////////////////////////////////// + +var target = Argument("target", "Default"); +var configuration = Argument("configuration", "Debug"); +var nugetOrgApiKey = EnvironmentVariable("NuGetOrgApiKey"); + +var isAppveyor = BuildSystem.IsRunningOnAppVeyor; +var isTravis = BuildSystem.IsRunningOnTravisCI; + +////////////////////////////////////////////////////////////////////// +// VERSION +////////////////////////////////////////////////////////////////////// + +var gitVersion = isTravis ? null : GitVersion(new GitVersionSettings +{ + OutputType = GitVersionOutput.Json, + UpdateAssemblyInfo = false +}); + +var version = isTravis ? "0.0.1" : gitVersion.NuGetVersion; + +////////////////////////////////////////////////////////////////////// +// CONSTS +////////////////////////////////////////////////////////////////////// + +var artifactsDir = Directory("./artifacts"); +var outputDir = Directory("./build"); + +var dotnetFrameworks = IsRunningOnWindows() ? new [] { "net45", "net40", "netstandard2.0" } : new string[] { }; +// net35 can't be build by dotnet - https://github.com/Microsoft/msbuild/issues/1333 +var msBuildFrameworks = IsRunningOnWindows() ? new [] { "net35" } : new [] { "net45", "net40", "net35", "netstandard2.0" }; + +var frameworks = dotnetFrameworks.Union(msBuildFrameworks).ToList(); + +var solution = "src/SharpRaven.sln"; +var packages = new [] +{ + "src/app/SharpRaven/SharpRaven.csproj", + "src/app/SharpRaven.Nancy/SharpRaven.Nancy.csproj", +}; + +////////////////////////////////////////////////////////////////////// +// SETUP +////////////////////////////////////////////////////////////////////// + +Setup(context => +{ + if (isAppveyor) + { + AppVeyor.UpdateBuildVersion(gitVersion.FullBuildMetaData); + } + + Information("Building version {0} of RavenSharp.", version); +}); + +////////////////////////////////////////////////////////////////////// +// TASKS +////////////////////////////////////////////////////////////////////// + +Task("Clean") + .Description("Deletes all files in the artifact and output directories") + .Does(() => + { + CleanDirectory(artifactsDir); + CleanDirectory(outputDir); + }); + +Task("RestorePackages") + .Description("Restores packages from nuget using 'dotnet'") + .Does(() => + { + DotNetCoreRestore(solution); + }); + +Task("UpdateAssemblyInformation") + .Description("Update assembly information using GitVersion") + .Does(() => + { + if (!isAppveyor) + { + return; + } + + GitVersion(new GitVersionSettings + { + UpdateAssemblyInfo = true, + UpdateAssemblyInfoFilePath = "src/CommonAssemblyInfo.cs", + }); + + Information("AssemblyVersion -> {0}", gitVersion.AssemblySemVer); + Information("AssemblyFileVersion -> {0}.0", gitVersion.MajorMinorPatch); + Information("AssemblyInformationalVersion -> {0}", gitVersion.InformationalVersion); + }); + +Task("Build") + .Description("Builds all versions") + .IsDependentOn("RestorePackages") + .IsDependentOn("UpdateAssemblyInformation") + .Does(() => + { + EnsureDirectoryExists(outputDir); + + foreach (var framework in msBuildFrameworks) + { + var settings = new MSBuildSettings + { + Configuration = configuration + "-" + framework, + ToolVersion = MSBuildToolVersion.VS2017, + }; + settings.WithProperty("TargetFramework", new string[] { framework }); + + MSBuild(solution, settings); + } + + foreach (var framework in dotnetFrameworks) + { + DotNetCoreBuild(solution, new DotNetCoreBuildSettings + { + Framework = framework, + Configuration = configuration + "-" + framework, + }); + } + }); + +Task("Test") + .Description("Runs all the tests on all the versions") + .IsDependentOn("Build") + .Does(() => + { + EnsureDirectoryExists(artifactsDir); + + foreach (var framework in frameworks.Where(x => x != "netstandard2.0")) + { + var assemblies = GetFiles((outputDir + Directory(configuration) + Directory(framework)).ToString() + "/*.UnitTests.dll"); + if (!assemblies.Any()) + { + throw new FileNotFoundException("Could not find any test assemblies in: '" + configuration + "-" + framework + "'."); + } + + var resultPath = artifactsDir + File(configuration + "-" + framework + "-tests.xml"); + NUnit(assemblies, new NUnitSettings + { + ResultsFile = resultPath, + Exclude = IsRunningOnWindows() ? null : "NuGet,NoMono", + }); + + if (isAppveyor) + { + AppVeyor.UploadTestResults(resultPath, AppVeyorTestResultsType.NUnit); + } + } + }); + +Task("Package") + .Description("Create NuGet packages") + .IsDependentOn("Build") + .Does(() => + { + EnsureDirectoryExists(artifactsDir); + + foreach (var package in packages) + { + MSBuild(package, c => c + .SetConfiguration("Release") + .SetVerbosity(Verbosity.Minimal) + .UseToolVersion(MSBuildToolVersion.VS2017) + .WithProperty("NoBuild", "true") + .WithProperty("Version", gitVersion.NuGetVersion) + .WithTarget("Pack")); + } + + MoveFiles((outputDir + Directory(configuration)).ToString() + "/*.nupkg", artifactsDir); + }); + +Task("UploadAppVeyorArtifacts") + .Description("Uploads artifacts to AppVeyor") + .IsDependentOn("Package") + .Does(() => + { + foreach (var zip in System.IO.Directory.GetFiles(artifactsDir, "*.nupkg")) + { + AppVeyor.UploadArtifact(zip); + } + }); + +Task("PublishNuGetPackages") + .Description("Publishes .nupkg files to nuget.org") + .IsDependentOn("Package") + .WithCriteria(() => + { + var branchName = gitVersion.BranchName.Trim(); + return branchName == "master" || branchName == "develop"; + }) + .Does(() => + { + if (String.IsNullOrEmpty(nugetOrgApiKey)) + { + throw new ArgumentNullException("nugetOrgApiKey"); + } + + var nugetFiles = GetFiles(artifactsDir.ToString() + "/*.nupkg"); + NuGetPush(nugetFiles, new NuGetPushSettings + { + ApiKey = nugetOrgApiKey, + Source = "https://api.nuget.org/v3/index.json" + }); + }); + +////////////////////////////////////////////////////////////////////// +// META TASKS +////////////////////////////////////////////////////////////////////// + +Task("Rebuild") + .Description("Rebuilds all versions") + .IsDependentOn("Clean") + .IsDependentOn("Build"); + +Task("Appveyor") + .Description("Builds, tests and publishes packages on AppVeyor") + .IsDependentOn("UploadAppVeyorArtifacts") + .IsDependentOn("PublishNuGetPackages"); + +Task("Travis") + .Description("Builds and tests on Travis") + .IsDependentOn("Test"); + +Task("Default") + .Description("Builds all versions") + .IsDependentOn("Build"); + +////////////////////////////////////////////////////////////////////// +// EXECUTION +////////////////////////////////////////////////////////////////////// + +RunTarget(target); diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 00000000..e3430743 --- /dev/null +++ b/build.ps1 @@ -0,0 +1,182 @@ +<# + +.SYNOPSIS +This is a Powershell script to bootstrap a Cake build. + +.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 Experimental +Tells Cake to use the latest Roslyn release. +.PARAMETER WhatIf +Performs a dry run of the build script. +No tasks will be executed. +.PARAMETER Mono +Tells Cake to use the Mono scripting 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 = "Default", + [string]$Configuration = "Release", + [ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")] + [string]$Verbosity = "Verbose", + [switch]$Experimental, + [Alias("DryRun","Noop")] + [switch]$WhatIf, + [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() + } + } +} + +Write-Host "Preparing to run build script..." + +if(!$PSScriptRoot){ + $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent +} + +$TOOLS_DIR = Join-Path $PSScriptRoot "tools" +$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" + +# Should we use mono? +$UseMono = ""; +if($Mono.IsPresent) { + Write-Verbose -Message "Using the Mono based scripting engine." + $UseMono = "-mono" +} + +# Should we use the new Roslyn? +$UseExperimental = ""; +if($Experimental.IsPresent -and !($Mono.IsPresent)) { + Write-Verbose -Message "Using experimental version of Roslyn." + $UseExperimental = "-experimental" +} + +# Is this a dry run? +$UseDryRun = ""; +if($WhatIf.IsPresent) { + $UseDryRun = "-dryrun" +} + +# 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 { (New-Object System.Net.WebClient).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 { + (New-Object System.Net.WebClient).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 +} + +# Make sure that Cake has been installed. +if (!(Test-Path $CAKE_EXE)) { + Throw "Could not find Cake.exe at $CAKE_EXE" +} + +# Start Cake +Write-Host "Running build script..." +Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseMono $UseDryRun $UseExperimental $ScriptArgs" +exit $LASTEXITCODE diff --git a/build.sh b/build.sh new file mode 100755 index 00000000..e4ebeba7 --- /dev/null +++ b/build.sh @@ -0,0 +1,95 @@ +#!/usr/bin/env bash + +# Define directories. +SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +TOOLS_DIR=$SCRIPT_DIR/tools +NUGET_EXE=$TOOLS_DIR/nuget.exe +CAKE_EXE=$TOOLS_DIR/Cake/Cake.exe +PACKAGES_CONFIG=$TOOLS_DIR/packages.config +PACKAGES_CONFIG_MD5=$TOOLS_DIR/packages.config.md5sum + +# Define md5sum or md5 depending on Linux/OSX +MD5_EXE= +if [[ "$(uname -s)" == "Darwin" ]]; then + MD5_EXE="md5 -r" +else + MD5_EXE="md5sum" +fi + +# Define default arguments. +SCRIPT="build.cake" +TARGET="Default" +CONFIGURATION="Release" +VERBOSITY="verbose" +DRYRUN= +SHOW_VERSION=false +SCRIPT_ARGUMENTS=() + +# Parse arguments. +for i in "$@"; do + case $1 in + -s|--script) SCRIPT="$2"; shift ;; + -t|--target) TARGET="$2"; shift ;; + -c|--configuration) CONFIGURATION="$2"; shift ;; + -v|--verbosity) VERBOSITY="$2"; shift ;; + -d|--dryrun) DRYRUN="-dryrun" ;; + --version) SHOW_VERSION=true ;; + --) shift; SCRIPT_ARGUMENTS+=("$@"); break ;; + *) SCRIPT_ARGUMENTS+=("$1") ;; + esac + shift +done + +# Make sure the tools folder exist. +if [ ! -d "$TOOLS_DIR" ]; then + mkdir "$TOOLS_DIR" +fi + +# Make sure that packages.config exist. +if [ ! -f "$TOOLS_DIR/packages.config" ]; then + echo "Downloading packages.config..." + curl -Lsfo "$TOOLS_DIR/packages.config" https://cakebuild.net/download/bootstrapper/packages + if [ $? -ne 0 ]; then + echo "An error occured while downloading packages.config." + exit 1 + fi +fi + +# Download NuGet if it does not exist. +if [ ! -f "$NUGET_EXE" ]; then + echo "Downloading NuGet..." + curl -Lsfo "$NUGET_EXE" https://dist.nuget.org/win-x86-commandline/latest/nuget.exe + if [ $? -ne 0 ]; then + echo "An error occured while downloading nuget.exe." + exit 1 + fi +fi + +# Restore tools from NuGet. +pushd "$TOOLS_DIR" >/dev/null +if [ ! -f $PACKAGES_CONFIG_MD5 ] || [ "$( cat $PACKAGES_CONFIG_MD5 | sed 's/\r$//' )" != "$( $MD5_EXE $PACKAGES_CONFIG | awk '{ print $1 }' )" ]; then + find . -type d ! -name . | xargs rm -rf +fi + +mono "$NUGET_EXE" install -ExcludeVersion +if [ $? -ne 0 ]; then + echo "Could not restore NuGet packages." + exit 1 +fi + +$MD5_EXE $PACKAGES_CONFIG | awk '{ print $1 }' >| $PACKAGES_CONFIG_MD5 + +popd >/dev/null + +# Make sure that Cake has been installed. +if [ ! -f "$CAKE_EXE" ]; then + echo "Could not find Cake.exe at '$CAKE_EXE'." + exit 1 +fi + +# Start Cake +if $SHOW_VERSION; then + exec mono "$CAKE_EXE" -version +else + exec mono "$CAKE_EXE" $SCRIPT -verbosity=$VERBOSITY -configuration="$CONFIGURATION" -target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}" +fi diff --git a/src/.nuget/nuget.config b/src/.nuget/nuget.config deleted file mode 100644 index d134c863..00000000 --- a/src/.nuget/nuget.config +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/src/.nuget/packages.config b/src/.nuget/packages.config deleted file mode 100644 index a7df95cf..00000000 --- a/src/.nuget/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/Build.cmd b/src/Build.cmd deleted file mode 100644 index d50790d0..00000000 --- a/src/Build.cmd +++ /dev/null @@ -1,35 +0,0 @@ -@echo off -SETLOCAL -SET PATH=%PATH%;%WINDIR%\Microsoft.NET\Framework\v4.0.30319;%CD%\..\.nuget; -echo. -echo. -echo ===================== -echo === NuGet Restore === -echo ===================== -echo. -NuGet restore SharpRaven.sln -echo. -echo. -echo ===================== -echo === GitVersion === -echo ===================== -echo. -packages\GitVersion.CommandLine.1.3.3\Tools\GitVersion.exe /output json /updateassemblyinfo false /l gitversion.log -echo. -echo. -echo. -echo. -echo ===================== -echo === MSBuild === -echo ===================== -echo. -MSBUILD SharpRaven.build -echo. -echo ===================== -echo === NuGet Pack === -echo ===================== -echo. -NuGet pack app\SharpRaven\SharpRaven.csproj -Properties ReleaseNotes='Test' -NuGet pack app\SharpRaven.Nancy\SharpRaven.Nancy.csproj -Properties ReleaseNotes='Test' -echo. -ENDLOCAL \ No newline at end of file diff --git a/src/CommonConfigurations.targets b/src/CommonConfigurations.targets new file mode 100644 index 00000000..b99f2d79 --- /dev/null +++ b/src/CommonConfigurations.targets @@ -0,0 +1,21 @@ + + + + Debug;Release;Debug-net35;Release-net35;Debug-net40;Release-net40;Debug-net45;Release-net45;Release-netstandard2.0;Debug-netstandard2.0 + ..\..\..\build\$(Configuration.Split("-")[0]) + ..\..\..\build\obj\$(Configuration.Split("-")[0])\ + + + + $(DefineConstants);net35 + + + $(DefineConstants);net40 + + + $(DefineConstants);net45 + + + $(DefineConstants);netstandard2.0 + + diff --git a/src/SharpRaven.build b/src/SharpRaven.build deleted file mode 100644 index 89598bbc..00000000 --- a/src/SharpRaven.build +++ /dev/null @@ -1,27 +0,0 @@ - - - - $(MSBuildProjectDirectory) - SharpRaven.sln - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/SharpRaven.sln b/src/SharpRaven.sln index 7e56e8cf..56108c3d 100644 --- a/src/SharpRaven.sln +++ b/src/SharpRaven.sln @@ -1,12 +1,10 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.40629.0 +# Visual Studio 15 +VisualStudioVersion = 15.0.27130.2027 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpRaven", "app\SharpRaven\SharpRaven.csproj", "{CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpRaven", "app\SharpRaven\SharpRaven.csproj", "{CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpRaven.UnitTests", "tests\SharpRaven.UnitTests\SharpRaven.UnitTests.csproj", "{E1DBEBBF-9448-4D99-B378-2B8CF1629F31}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpRaven.WebTest", "tests\SharpRaven.WebTest\SharpRaven.WebTest.csproj", "{156621FC-2C48-4CDF-A368-9347BABE9089}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpRaven.UnitTests", "tests\SharpRaven.UnitTests\SharpRaven.UnitTests.csproj", "{E1DBEBBF-9448-4D99-B378-2B8CF1629F31}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "app", "app", "{88CB5CD6-ACFA-441E-9FBB-E1E06F181B89}" EndProject @@ -18,6 +16,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ..\.gitignore = ..\.gitignore ..\.gitmodules = ..\.gitmodules ..\.travis.yml = ..\.travis.yml + ..\build.cake = ..\build.cake Build.cmd = Build.cmd ..\GitVersionConfig.yaml = ..\GitVersionConfig.yaml ..\LICENSE = ..\LICENSE @@ -27,9 +26,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution SharpRaven.sln.DotSettings = SharpRaven.sln.DotSettings EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpRaven.Nancy", "app\SharpRaven.Nancy\SharpRaven.Nancy.csproj", "{ABE22746-6EEB-4970-A608-C02BC3B8BDA3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpRaven.Nancy", "app\SharpRaven.Nancy\SharpRaven.Nancy.csproj", "{ABE22746-6EEB-4970-A608-C02BC3B8BDA3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpRaven.Nancy.UnitTests", "tests\SharpRaven.Nancy.UnitTests\SharpRaven.Nancy.UnitTests.csproj", "{7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpRaven.Nancy.UnitTests", "tests\SharpRaven.Nancy.UnitTests\SharpRaven.Nancy.UnitTests.csproj", "{7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{D18000EF-446C-4756-87BD-632E3B71BD45}" ProjectSection(SolutionItems) = preProject @@ -47,160 +46,88 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{F44F1C47-D EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug 3.5|Any CPU = Debug 3.5|Any CPU - Debug 3.5|Mixed Platforms = Debug 3.5|Mixed Platforms - Debug 3.5|x86 = Debug 3.5|x86 - Debug 4.0|Any CPU = Debug 4.0|Any CPU - Debug 4.0|Mixed Platforms = Debug 4.0|Mixed Platforms - Debug 4.0|x86 = Debug 4.0|x86 - Debug 4.5|Any CPU = Debug 4.5|Any CPU - Debug 4.5|Mixed Platforms = Debug 4.5|Mixed Platforms - Debug 4.5|x86 = Debug 4.5|x86 - Release 3.5|Any CPU = Release 3.5|Any CPU - Release 3.5|Mixed Platforms = Release 3.5|Mixed Platforms - Release 3.5|x86 = Release 3.5|x86 - Release 4.0|Any CPU = Release 4.0|Any CPU - Release 4.0|Mixed Platforms = Release 4.0|Mixed Platforms - Release 4.0|x86 = Release 4.0|x86 - Release 4.5|Any CPU = Release 4.5|Any CPU - Release 4.5|Mixed Platforms = Release 4.5|Mixed Platforms - Release 4.5|x86 = Release 4.5|x86 + Debug|Any CPU = Debug|Any CPU + Debug-net35|Any CPU = Debug-net35|Any CPU + Debug-net40|Any CPU = Debug-net40|Any CPU + Debug-net45|Any CPU = Debug-net45|Any CPU + Debug-netstandard2.0|Any CPU = Debug-netstandard2.0|Any CPU + Release|Any CPU = Release|Any CPU + Release-net35|Any CPU = Release-net35|Any CPU + Release-net40|Any CPU = Release-net40|Any CPU + Release-net45|Any CPU = Release-net45|Any CPU + Release-netstandard2.0|Any CPU = Release-netstandard2.0|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug 3.5|Any CPU.ActiveCfg = Debug 3.5|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug 3.5|Any CPU.Build.0 = Debug 3.5|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug 3.5|Mixed Platforms.ActiveCfg = Debug 3.5|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug 3.5|Mixed Platforms.Build.0 = Debug 3.5|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug 3.5|x86.ActiveCfg = Debug 3.5|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug 4.0|Any CPU.ActiveCfg = Debug 4.0|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug 4.0|Any CPU.Build.0 = Debug 4.0|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug 4.0|Mixed Platforms.ActiveCfg = Debug 4.0|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug 4.0|Mixed Platforms.Build.0 = Debug 4.0|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug 4.0|x86.ActiveCfg = Debug 4.0|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug 4.5|Any CPU.ActiveCfg = Debug 4.5|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug 4.5|Any CPU.Build.0 = Debug 4.5|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug 4.5|Mixed Platforms.ActiveCfg = Debug 4.5|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug 4.5|Mixed Platforms.Build.0 = Debug 4.5|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug 4.5|x86.ActiveCfg = Debug 4.5|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release 3.5|Any CPU.ActiveCfg = Release 3.5|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release 3.5|Any CPU.Build.0 = Release 3.5|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release 3.5|Mixed Platforms.ActiveCfg = Release 3.5|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release 3.5|Mixed Platforms.Build.0 = Release 3.5|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release 3.5|x86.ActiveCfg = Release 3.5|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release 4.0|Any CPU.ActiveCfg = Release 4.0|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release 4.0|Any CPU.Build.0 = Release 4.0|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release 4.0|Mixed Platforms.ActiveCfg = Release 4.0|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release 4.0|Mixed Platforms.Build.0 = Release 4.0|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release 4.0|x86.ActiveCfg = Release 4.0|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release 4.5|Any CPU.ActiveCfg = Release 4.5|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release 4.5|Any CPU.Build.0 = Release 4.5|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release 4.5|Mixed Platforms.ActiveCfg = Release 4.5|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release 4.5|Mixed Platforms.Build.0 = Release 4.5|Any CPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release 4.5|x86.ActiveCfg = Release 4.5|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug 3.5|Any CPU.ActiveCfg = Debug 3.5|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug 3.5|Any CPU.Build.0 = Debug 3.5|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug 3.5|Mixed Platforms.ActiveCfg = Debug 3.5|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug 3.5|Mixed Platforms.Build.0 = Debug 3.5|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug 3.5|x86.ActiveCfg = Debug 3.5|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug 3.5|x86.Build.0 = Debug 3.5|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug 4.0|Any CPU.ActiveCfg = Debug 4.0|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug 4.0|Any CPU.Build.0 = Debug 4.0|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug 4.0|Mixed Platforms.ActiveCfg = Debug 4.0|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug 4.0|Mixed Platforms.Build.0 = Debug 4.0|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug 4.0|x86.ActiveCfg = Debug 4.0|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug 4.5|Any CPU.ActiveCfg = Debug 4.5|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug 4.5|Any CPU.Build.0 = Debug 4.5|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug 4.5|Mixed Platforms.ActiveCfg = Debug 4.5|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug 4.5|Mixed Platforms.Build.0 = Debug 4.5|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug 4.5|x86.ActiveCfg = Debug 4.5|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release 3.5|Any CPU.ActiveCfg = Release 3.5|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release 3.5|Any CPU.Build.0 = Release 3.5|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release 3.5|Mixed Platforms.ActiveCfg = Release 3.5|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release 3.5|Mixed Platforms.Build.0 = Release 3.5|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release 3.5|x86.ActiveCfg = Release 3.5|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release 3.5|x86.Build.0 = Release 3.5|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release 4.0|Any CPU.ActiveCfg = Release 4.0|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release 4.0|Any CPU.Build.0 = Release 4.0|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release 4.0|Mixed Platforms.ActiveCfg = Release 4.0|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release 4.0|Mixed Platforms.Build.0 = Release 4.0|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release 4.0|x86.ActiveCfg = Release 4.0|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release 4.5|Any CPU.ActiveCfg = Release 4.5|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release 4.5|Any CPU.Build.0 = Release 4.5|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release 4.5|Mixed Platforms.ActiveCfg = Release 4.5|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release 4.5|Mixed Platforms.Build.0 = Release 4.5|Any CPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release 4.5|x86.ActiveCfg = Release 4.5|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Debug 3.5|Any CPU.ActiveCfg = Debug 3.5|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Debug 3.5|Any CPU.Build.0 = Debug 3.5|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Debug 3.5|Mixed Platforms.ActiveCfg = Debug 3.5|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Debug 3.5|Mixed Platforms.Build.0 = Debug 3.5|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Debug 3.5|x86.ActiveCfg = Debug 3.5|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Debug 3.5|x86.Build.0 = Debug 3.5|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Debug 4.0|Any CPU.ActiveCfg = Debug 4.0|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Debug 4.0|Any CPU.Build.0 = Debug 4.0|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Debug 4.0|Mixed Platforms.ActiveCfg = Debug 4.0|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Debug 4.0|Mixed Platforms.Build.0 = Debug 4.0|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Debug 4.0|x86.ActiveCfg = Debug 4.0|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Debug 4.5|Any CPU.ActiveCfg = Debug 4.5|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Debug 4.5|Any CPU.Build.0 = Debug 4.5|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Debug 4.5|Mixed Platforms.ActiveCfg = Debug 4.5|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Debug 4.5|Mixed Platforms.Build.0 = Debug 4.5|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Debug 4.5|x86.ActiveCfg = Debug 4.5|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Release 3.5|Any CPU.ActiveCfg = Release 3.5|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Release 3.5|Any CPU.Build.0 = Release 3.5|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Release 3.5|Mixed Platforms.ActiveCfg = Release 3.5|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Release 3.5|Mixed Platforms.Build.0 = Release 3.5|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Release 3.5|x86.ActiveCfg = Release 3.5|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Release 3.5|x86.Build.0 = Release 3.5|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Release 4.0|Any CPU.ActiveCfg = Release 4.0|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Release 4.0|Any CPU.Build.0 = Release 4.0|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Release 4.0|Mixed Platforms.ActiveCfg = Release 4.0|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Release 4.0|Mixed Platforms.Build.0 = Release 4.0|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Release 4.0|x86.ActiveCfg = Release 4.0|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Release 4.5|Any CPU.ActiveCfg = Release 4.5|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Release 4.5|Any CPU.Build.0 = Release 4.5|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Release 4.5|Mixed Platforms.ActiveCfg = Release 4.5|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Release 4.5|Mixed Platforms.Build.0 = Release 4.5|Any CPU - {156621FC-2C48-4CDF-A368-9347BABE9089}.Release 4.5|x86.ActiveCfg = Release 4.5|Any CPU - {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug 4.0|Any CPU.ActiveCfg = Debug 4.0|Any CPU - {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug 4.0|Any CPU.Build.0 = Debug 4.0|Any CPU - {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug 4.0|Mixed Platforms.ActiveCfg = Debug 4.0|Any CPU - {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug 4.0|Mixed Platforms.Build.0 = Debug 4.0|Any CPU - {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug 4.0|x86.ActiveCfg = Debug 4.0|Any CPU - {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug 4.5|Any CPU.ActiveCfg = Debug 4.5|Any CPU - {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug 4.5|Any CPU.Build.0 = Debug 4.5|Any CPU - {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug 4.5|Mixed Platforms.ActiveCfg = Debug 4.5|Any CPU - {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug 4.5|Mixed Platforms.Build.0 = Debug 4.5|Any CPU - {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug 4.5|x86.ActiveCfg = Debug 4.5|Any CPU - {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release 4.0|Any CPU.ActiveCfg = Release 4.0|Any CPU - {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release 4.0|Any CPU.Build.0 = Release 4.0|Any CPU - {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release 4.0|Mixed Platforms.ActiveCfg = Release 4.0|Any CPU - {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release 4.0|Mixed Platforms.Build.0 = Release 4.0|Any CPU - {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release 4.0|x86.ActiveCfg = Release 4.0|Any CPU - {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release 4.5|Any CPU.ActiveCfg = Release 4.5|Any CPU - {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release 4.5|Any CPU.Build.0 = Release 4.5|Any CPU - {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release 4.5|Mixed Platforms.ActiveCfg = Release 4.5|Any CPU - {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release 4.5|Mixed Platforms.Build.0 = Release 4.5|Any CPU - {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release 4.5|x86.ActiveCfg = Release 4.5|Any CPU - {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug 4.0|Any CPU.ActiveCfg = Debug 4.0|Any CPU - {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug 4.0|Any CPU.Build.0 = Debug 4.0|Any CPU - {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug 4.0|Mixed Platforms.ActiveCfg = Debug 4.0|Any CPU - {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug 4.0|Mixed Platforms.Build.0 = Debug 4.0|Any CPU - {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug 4.0|x86.ActiveCfg = Debug 4.0|Any CPU - {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug 4.5|Any CPU.ActiveCfg = Debug 4.5|Any CPU - {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug 4.5|Any CPU.Build.0 = Debug 4.5|Any CPU - {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug 4.5|Mixed Platforms.ActiveCfg = Debug 4.5|Any CPU - {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug 4.5|Mixed Platforms.Build.0 = Debug 4.5|Any CPU - {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug 4.5|x86.ActiveCfg = Debug 4.5|Any CPU - {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release 4.0|Any CPU.ActiveCfg = Release 4.0|Any CPU - {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release 4.0|Any CPU.Build.0 = Release 4.0|Any CPU - {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release 4.0|Mixed Platforms.ActiveCfg = Release 4.0|Any CPU - {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release 4.0|Mixed Platforms.Build.0 = Release 4.0|Any CPU - {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release 4.0|x86.ActiveCfg = Release 4.0|Any CPU - {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release 4.5|Any CPU.ActiveCfg = Release 4.5|Any CPU - {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release 4.5|Any CPU.Build.0 = Release 4.5|Any CPU - {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release 4.5|Mixed Platforms.ActiveCfg = Release 4.5|Any CPU - {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release 4.5|Mixed Platforms.Build.0 = Release 4.5|Any CPU - {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release 4.5|x86.ActiveCfg = Release 4.5|Any CPU + {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug-net35|Any CPU.ActiveCfg = Debug-net35|Any CPU + {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug-net35|Any CPU.Build.0 = Debug-net35|Any CPU + {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug-net40|Any CPU.ActiveCfg = Debug-net40|Any CPU + {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug-net40|Any CPU.Build.0 = Debug-net40|Any CPU + {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug-net45|Any CPU.ActiveCfg = Debug-net45|Any CPU + {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug-net45|Any CPU.Build.0 = Debug-net45|Any CPU + {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug-netstandard2.0|Any CPU.ActiveCfg = Debug-netstandard2.0|Any CPU + {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Debug-netstandard2.0|Any CPU.Build.0 = Debug-netstandard2.0|Any CPU + {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release|Any CPU.Build.0 = Release|Any CPU + {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release-net35|Any CPU.ActiveCfg = Release-net35|Any CPU + {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release-net35|Any CPU.Build.0 = Release-net35|Any CPU + {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release-net40|Any CPU.ActiveCfg = Release-net40|Any CPU + {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release-net40|Any CPU.Build.0 = Release-net40|Any CPU + {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release-net45|Any CPU.ActiveCfg = Release-net45|Any CPU + {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release-net45|Any CPU.Build.0 = Release-net45|Any CPU + {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release-netstandard2.0|Any CPU.ActiveCfg = Release-netstandard2.0|Any CPU + {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1}.Release-netstandard2.0|Any CPU.Build.0 = Release-netstandard2.0|Any CPU + {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug-net35|Any CPU.ActiveCfg = Debug-net35|Any CPU + {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug-net35|Any CPU.Build.0 = Debug-net35|Any CPU + {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug-net40|Any CPU.ActiveCfg = Debug-net40|Any CPU + {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug-net40|Any CPU.Build.0 = Debug-net40|Any CPU + {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug-net45|Any CPU.ActiveCfg = Debug-net45|Any CPU + {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug-net45|Any CPU.Build.0 = Debug-net45|Any CPU + {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Debug-netstandard2.0|Any CPU.ActiveCfg = Debug-netstandard2.0|Any CPU + {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release|Any CPU.Build.0 = Release|Any CPU + {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release-net35|Any CPU.ActiveCfg = Release-net35|Any CPU + {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release-net35|Any CPU.Build.0 = Release-net35|Any CPU + {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release-net40|Any CPU.ActiveCfg = Release-net40|Any CPU + {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release-net40|Any CPU.Build.0 = Release-net40|Any CPU + {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release-net45|Any CPU.ActiveCfg = Release-net45|Any CPU + {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release-net45|Any CPU.Build.0 = Release-net45|Any CPU + {E1DBEBBF-9448-4D99-B378-2B8CF1629F31}.Release-netstandard2.0|Any CPU.ActiveCfg = Release-netstandard2.0|Any CPU + {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug-net35|Any CPU.ActiveCfg = Debug-net35|Any CPU + {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug-net40|Any CPU.ActiveCfg = Debug-net40|Any CPU + {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug-net40|Any CPU.Build.0 = Debug-net40|Any CPU + {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug-net45|Any CPU.ActiveCfg = Debug-net45|Any CPU + {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug-net45|Any CPU.Build.0 = Debug-net45|Any CPU + {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Debug-netstandard2.0|Any CPU.ActiveCfg = Debug-netstandard2.0|Any CPU + {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release|Any CPU.Build.0 = Release|Any CPU + {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release-net35|Any CPU.ActiveCfg = Release-net35|Any CPU + {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release-net40|Any CPU.ActiveCfg = Release-net40|Any CPU + {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release-net40|Any CPU.Build.0 = Release-net40|Any CPU + {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release-net45|Any CPU.ActiveCfg = Release-net45|Any CPU + {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release-net45|Any CPU.Build.0 = Release-net45|Any CPU + {ABE22746-6EEB-4970-A608-C02BC3B8BDA3}.Release-netstandard2.0|Any CPU.ActiveCfg = Release-netstandard2.0|Any CPU + {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug-net35|Any CPU.ActiveCfg = Debug-net35|Any CPU + {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug-net40|Any CPU.ActiveCfg = Debug-net40|Any CPU + {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug-net40|Any CPU.Build.0 = Debug-net40|Any CPU + {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug-net45|Any CPU.ActiveCfg = Debug-net45|Any CPU + {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug-net45|Any CPU.Build.0 = Debug-net45|Any CPU + {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Debug-netstandard2.0|Any CPU.ActiveCfg = Debug-netstandard2.0|Any CPU + {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release|Any CPU.Build.0 = Release|Any CPU + {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release-net35|Any CPU.ActiveCfg = Release-net35|Any CPU + {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release-net40|Any CPU.ActiveCfg = Release-net40|Any CPU + {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release-net40|Any CPU.Build.0 = Release-net40|Any CPU + {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release-net45|Any CPU.ActiveCfg = Release-net45|Any CPU + {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release-net45|Any CPU.Build.0 = Release-net45|Any CPU + {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C}.Release-netstandard2.0|Any CPU.ActiveCfg = Release-netstandard2.0|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -208,9 +135,11 @@ Global GlobalSection(NestedProjects) = preSolution {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1} = {88CB5CD6-ACFA-441E-9FBB-E1E06F181B89} {E1DBEBBF-9448-4D99-B378-2B8CF1629F31} = {D2B3990A-A048-49F3-A697-A1DAEF82CE7F} - {156621FC-2C48-4CDF-A368-9347BABE9089} = {D2B3990A-A048-49F3-A697-A1DAEF82CE7F} {ABE22746-6EEB-4970-A608-C02BC3B8BDA3} = {88CB5CD6-ACFA-441E-9FBB-E1E06F181B89} {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C} = {D2B3990A-A048-49F3-A697-A1DAEF82CE7F} {F44F1C47-DCF1-472A-A2D1-7F132AA54339} = {BF6154D1-9BC4-4966-9506-BC33E81F317C} EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F6F9418F-8C35-4ADB-B667-AB78EE9AFD04} + EndGlobalSection EndGlobal diff --git a/src/SharpRaven.sln.DotSettings b/src/SharpRaven.sln.DotSettings index d5d67f5d..a0164c9b 100644 --- a/src/SharpRaven.sln.DotSettings +++ b/src/SharpRaven.sln.DotSettings @@ -63,6 +63,7 @@ ByFirstAttr DoNotTouch False + False <?xml version="1.0" encoding="utf-16"?> <Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns"> <TypePattern DisplayName="COM interfaces or structs"> @@ -633,6 +634,7 @@ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF S True True True + True C:\Programs\NUnit-2.6.3\bin\lib Always 5 diff --git a/src/app/SharpRaven.Nancy/SharpRaven.Nancy.csproj b/src/app/SharpRaven.Nancy/SharpRaven.Nancy.csproj index 1e965520..c2fb8730 100644 --- a/src/app/SharpRaven.Nancy/SharpRaven.Nancy.csproj +++ b/src/app/SharpRaven.Nancy/SharpRaven.Nancy.csproj @@ -1,112 +1,42 @@ - - - + - Release 4.5 - AnyCPU - {ABE22746-6EEB-4970-A608-C02BC3B8BDA3} - Library - Properties - SharpRaven.Nancy - SharpRaven.Nancy - v4.5 - 512 - ..\ - - ec5b9b6c - - - true - full - false - bin\Debug\net40\ - TRACE;DEBUG;net40 - prompt - 4 - bin\Debug\net40\SharpRaven.Nancy.xml - MinimumRecommendedRules.ruleset - false - v4.0 - - - pdbonly - true - bin\Release\net40\ - TRACE;net40 - prompt - 4 - bin\Release\net40\SharpRaven.Nancy.xml - MinimumRecommendedRules.ruleset - false - v4.0 - - - true - bin\Debug\net45\ - DEBUG;TRACE - full - AnyCPU - prompt - bin\Debug\net45\SharpRaven.Nancy.xml - MinimumRecommendedRules.ruleset - false - v4.5 - - - bin\Release\net45\ - TRACE - true - pdbonly - AnyCPU - prompt - bin\Release\net45\SharpRaven.Nancy.xml - MinimumRecommendedRules.ruleset - false - v4.5 + net45;net40 + false + + SharpRaven.Nancy + https://raw.githubusercontent.com/getsentry/raven-csharp/master/sentry-icon.png + raven sentry logging nancy + .NET client for Sentry (getsentry.com) running on Nancy + Raven is a C# client for Sentry (getsentry.com and github.com/getsentry/sentry) + Copyright 2014 The Sentry Team and individual contributors + false + $(ReleaseNotes) + Sentry Team + asbjornu, xpicio + https://github.com/getsentry/raven-csharp + https://github.com/getsentry/raven-csharp.git + git + + + - - ..\..\packages\Nancy.1.4.3\lib\net40\Nancy.dll - True - - - False - ..\..\packages\Newtonsoft.Json.6.0.8\lib\net40\Newtonsoft.Json.dll - + + + + + - - Properties\CommonAssemblyInfo.cs - - - - Code - - - - - - - - - {cc80a2e1-ae39-44de-8da3-4eef42f90fb1} - SharpRaven - + + + - - + - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - \ No newline at end of file + diff --git a/src/app/SharpRaven.Nancy/SharpRaven.Nancy.nuspec b/src/app/SharpRaven.Nancy/SharpRaven.Nancy.nuspec deleted file mode 100644 index 0cc7554b..00000000 --- a/src/app/SharpRaven.Nancy/SharpRaven.Nancy.nuspec +++ /dev/null @@ -1,25 +0,0 @@ - - - - SharpRaven.Nancy - $version$ - .NET client for Sentry (getsentry.com) running on Nancy - Sentry Team - asbjornu, xpicio - https://github.com/getsentry/raven-csharp/blob/master/LICENSE - https://github.com/getsentry/raven-csharp - https://raw.githubusercontent.com/getsentry/raven-csharp/master/sentry-icon.png - false - Raven is a C# client for Sentry (getsentry.com and github.com/getsentry/sentry) - $releaseNotes$ - Copyright 2014 The Sentry Team and individual contributors - raven sentry logging nancy - - - - - - - - - \ No newline at end of file diff --git a/src/app/SharpRaven.Nancy/packages.config b/src/app/SharpRaven.Nancy/packages.config deleted file mode 100644 index 9019375f..00000000 --- a/src/app/SharpRaven.Nancy/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/app/SharpRaven/Data/DefaultHttpRequestBodyConverter.cs b/src/app/SharpRaven/Data/DefaultHttpRequestBodyConverter.cs index f11ca92e..03f756d8 100644 --- a/src/app/SharpRaven/Data/DefaultHttpRequestBodyConverter.cs +++ b/src/app/SharpRaven/Data/DefaultHttpRequestBodyConverter.cs @@ -88,11 +88,19 @@ public bool TryConvert(dynamic httpContext, out object converted) { using (var stream = new MemoryStream()) { - httpContext.Request.InputStream.Seek(0, SeekOrigin.Begin); - httpContext.Request.InputStream.CopyTo(stream); - converted = Encoding.UTF8.GetString(stream.ToArray()); + var position = httpContext.Request.InputStream.Position; + try + { + httpContext.Request.InputStream.Seek(0, SeekOrigin.Begin); + httpContext.Request.InputStream.CopyTo(stream); + converted = Encoding.UTF8.GetString(stream.ToArray()); - return true; + return true; + } + finally + { + httpContext.Request.InputStream.Position = position; + } } } catch (Exception exception) diff --git a/src/app/SharpRaven/Data/ExceptionFrame.cs b/src/app/SharpRaven/Data/ExceptionFrame.cs index 4a2627bd..ce9da37b 100644 --- a/src/app/SharpRaven/Data/ExceptionFrame.cs +++ b/src/app/SharpRaven/Data/ExceptionFrame.cs @@ -121,7 +121,7 @@ public ExceptionFrame(StackFrame frame) /// The function. /// [JsonProperty(PropertyName = "function")] - public string Function { get; private set; } + public string Function { get; set; } /// /// Signifies whether this frame is related to the execution of the relevant code in this @@ -151,7 +151,7 @@ public ExceptionFrame(StackFrame frame) /// The module. /// [JsonProperty(PropertyName = "module")] - public string Module { get; private set; } + public string Module { get; set; } /// /// Gets or sets the post context. diff --git a/src/app/SharpRaven/Data/JsonHttpRequestBodyConverter.cs b/src/app/SharpRaven/Data/JsonHttpRequestBodyConverter.cs index ad3ef593..ac3af56b 100644 --- a/src/app/SharpRaven/Data/JsonHttpRequestBodyConverter.cs +++ b/src/app/SharpRaven/Data/JsonHttpRequestBodyConverter.cs @@ -101,9 +101,17 @@ public bool TryConvert(dynamic httpContext, out object converted) using (var stream = new MemoryStream()) { - httpContext.Request.InputStream.Seek(0, SeekOrigin.Begin); - httpContext.Request.InputStream.CopyTo(stream); - body = Encoding.UTF8.GetString(stream.ToArray()); + var position = httpContext.Request.InputStream.Position; + try + { + httpContext.Request.InputStream.Seek(0, SeekOrigin.Begin); + httpContext.Request.InputStream.CopyTo(stream); + body = Encoding.UTF8.GetString(stream.ToArray()); + } + finally + { + httpContext.Request.InputStream.Position = position; + } } converted = JsonConvert.DeserializeObject>(body); diff --git a/src/app/SharpRaven/Data/JsonPacket.cs b/src/app/SharpRaven/Data/JsonPacket.cs index 0e6d6a8c..9d0251cf 100644 --- a/src/app/SharpRaven/Data/JsonPacket.cs +++ b/src/app/SharpRaven/Data/JsonPacket.cs @@ -123,7 +123,16 @@ private static object Merge(SentryEvent @event) } } else - result = JObject.FromObject(extra); + { + try + { + result = JObject.FromObject(extra); + } + catch (ArgumentException) + { + result = JObject.FromObject(new Dictionary { { extra.GetType().ToString(), extra } }); + } + } var jExceptionData = JObject.FromObject(exceptionData); result.Merge(jExceptionData); @@ -397,4 +406,4 @@ private void Initialize(Exception exception) } } } -} \ No newline at end of file +} diff --git a/src/app/SharpRaven/Data/Requester.cs b/src/app/SharpRaven/Data/Requester.cs index 38157f6b..e2a1fef2 100644 --- a/src/app/SharpRaven/Data/Requester.cs +++ b/src/app/SharpRaven/Data/Requester.cs @@ -58,7 +58,7 @@ public partial class Requester /// /// The to initialize with. /// The to initialize with. - internal Requester(JsonPacket packet, RavenClient ravenClient) + public Requester(JsonPacket packet, RavenClient ravenClient) { if (packet == null) throw new ArgumentNullException("packet"); diff --git a/src/app/SharpRaven/NoOpRavenClient.Net45.cs b/src/app/SharpRaven/NoOpRavenClient.Net45.cs new file mode 100644 index 00000000..b73e137f --- /dev/null +++ b/src/app/SharpRaven/NoOpRavenClient.Net45.cs @@ -0,0 +1,113 @@ +#region License + +// Copyright (c) 2014 The Sentry Team and individual contributors. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, are permitted +// provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of +// conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of +// conditions and the following disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// 3. Neither the name of the Sentry nor the names of its contributors may be used to +// endorse or promote products derived from this software without specific prior written +// permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#endregion + +#if !(net40) && !(net35) + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; + +using SharpRaven.Data; + +namespace SharpRaven +{ + /// + /// Empty (no-op) implementation for the Raven Client for use in dependency injection + /// and other places when a silent operation is needed. + /// + public partial class NoOpRavenClient + { + /// Captures the event. + /// The event. + /// + /// The of the successfully captured , or null if it fails. + /// + public async Task CaptureAsync(SentryEvent @event) + { + return await Task.FromResult(Guid.NewGuid().ToString("n")); + } + + + /// + /// Captures the . + /// + /// The to capture. + /// The optional message to capture. Default: . + /// The of the captured . Default: . + /// The tags to annotate the captured with. + /// The custom fingerprint to annotate the captured with. + /// The extra metadata to send with the captured . + /// + /// The of the successfully captured , or null if it fails. + /// + [Obsolete("Use CaptureAsync(SentryEvent) instead.")] + public async Task CaptureExceptionAsync(Exception exception, + SentryMessage message = null, + ErrorLevel level = ErrorLevel.Error, + IDictionary tags = null, + string[] fingerprint = null, + object extra = null) + { + return await Task.FromResult(Guid.NewGuid().ToString("n")); + } + + + /// + /// Captures the message. + /// + /// The message to capture. + /// The of the captured . Default . + /// The tags to annotate the captured with. + /// The custom fingerprint to annotate the captured with. + /// The extra metadata to send with the captured . + /// + /// The of the successfully captured , or null if it fails. + /// + [Obsolete("Use CaptureAsync(SentryEvent) instead.")] + public async Task CaptureMessageAsync(SentryMessage message, + ErrorLevel level = ErrorLevel.Info, + IDictionary tags = null, + string[] fingerprint = null, + object extra = null) + { + return await Task.FromResult(Guid.NewGuid().ToString("n")); + } + + /// Sends the specified user feedback to Sentry + /// An empty string if succesful, otherwise the server response + /// The user feedback to send + public async Task SendUserFeedbackAsync(SentryUserFeedback feedback) + { + return await Task.FromResult(string.Empty); + } + } +} + +#endif diff --git a/src/app/SharpRaven/NoOpRavenClient.cs b/src/app/SharpRaven/NoOpRavenClient.cs new file mode 100644 index 00000000..adb90224 --- /dev/null +++ b/src/app/SharpRaven/NoOpRavenClient.cs @@ -0,0 +1,239 @@ +#region License + +// Copyright (c) 2014 The Sentry Team and individual contributors. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, are permitted +// provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of +// conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of +// conditions and the following disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// 3. Neither the name of the Sentry nor the names of its contributors may be used to +// endorse or promote products derived from this software without specific prior written +// permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#endregion + +using System; +using System.Collections.Generic; +using SharpRaven.Data; +using SharpRaven.Logging; + +namespace SharpRaven +{ + /// + /// Empty (no-op) implementation for the Raven Client for use in dependency injection + /// and other places when a silent operation is needed. + /// + public partial class NoOpRavenClient : IRavenClient + { + private readonly Dsn currentDsn; + private readonly IDictionary defaultTags; + + /// + /// Initializes a new instance of the class. + /// + public NoOpRavenClient() + { + currentDsn = new Dsn("http://sentry-dsn.invalid"); + defaultTags = new Dictionary(); + } + + /// + /// Gets or sets the to execute to manipulate or extract data from + /// the object before it is used in the method. + /// + /// + /// The to execute to manipulate or extract data from the + /// object before it is used in the method. + /// + public Func BeforeSend { get; set; } + + /// + /// Gets or sets the to execute if an error occurs when executing + /// . + /// + /// + /// The to execute if an error occurs when executing . + /// + public Action ErrorOnCapture { get; set; } + + /// + /// Enable Gzip Compression? + /// Defaults to false. + /// + public bool Compression { get; set; } + + /// + /// The Dsn currently being used to log exceptions. + /// + public Dsn CurrentDsn + { + get { return currentDsn; } + } + + /// + /// Interface for providing a 'log scrubber' that removes + /// sensitive information from exceptions sent to sentry. + /// + public IScrubber LogScrubber { get; set; } + + /// + /// The name of the logger. The default logger name is "root". + /// + public string Logger { get; set; } + + /// + /// The version of the application. + /// + public string Release { get; set; } + + /// + /// The environment (e.g. production) + /// + public string Environment { get; set; } + + /// + /// Default tags sent on all events. + /// + public IDictionary Tags + { + get { return this.defaultTags; } + } + + /// + /// Gets or sets the timeout value in milliseconds for the HTTP communication with Sentry. + /// + /// + /// The number of milliseconds to wait before the request times out. The default is 5,000 milliseconds (5 seconds). + /// + public TimeSpan Timeout { get; set; } + + /// + /// Not register the for tracking. + /// + public bool IgnoreBreadcrumbs { get; set; } + + + /// + /// Captures the last 100 . + /// + /// The to capture. + public void AddTrail(Breadcrumb breadcrumb) + { + } + + + /// + /// Restart the capture of the for tracking. + /// + public void RestartTrails() + { + } + + + /// Captures the specified . + /// The event to capture. + /// + /// The of the successfully captured , or null if it fails. + /// + public string Capture(SentryEvent @event) + { + return Guid.NewGuid().ToString("n"); + } + + + /// + /// Captures the event. + /// + /// The to capture. + /// + [Obsolete("Use CaptureException() instead.", true)] + public string CaptureEvent(Exception e) + { + return CaptureException(e); + } + + + /// + /// Captures the event. + /// + /// The to capture. + /// The tags to annotate the captured exception with. + /// + [Obsolete("Use CaptureException() instead.", true)] + public string CaptureEvent(Exception e, Dictionary tags) + { + return CaptureException(e, tags : tags); + } + + + /// + /// Captures the . + /// + /// The to capture. + /// The optional message to capture. Default: . + /// The of the captured . Default: . + /// The tags to annotate the captured with. + /// The custom fingerprint to annotate the captured with. + /// The extra metadata to send with the captured . + /// + /// The of the successfully captured , or null if it fails. + /// + [Obsolete("Use Capture(SentryEvent) instead")] + public string CaptureException(Exception exception, + SentryMessage message = null, + ErrorLevel level = ErrorLevel.Error, + IDictionary tags = null, + string[] fingerprint = null, + object extra = null) + { + return Guid.NewGuid().ToString("n"); + } + + + /// + /// Captures the message. + /// + /// The message to capture. + /// The of the captured . Default . + /// The tags to annotate the captured with. + /// The custom fingerprint to annotate the captured with. + /// The extra metadata to send with the captured . + /// + /// The of the successfully captured , or null if it fails. + /// + [Obsolete("Use Capture(SentryEvent) instead")] + public string CaptureMessage(SentryMessage message, + ErrorLevel level = ErrorLevel.Info, + IDictionary tags = null, + string[] fingerprint = null, + object extra = null) + { + return Guid.NewGuid().ToString("n"); + } + + + /// Sends the specified user feedback to Sentry + /// An empty string if succesful, otherwise the server response + /// The user feedback to send + public string SendUserFeedback(SentryUserFeedback feedback) + { + return string.Empty; + } + } +} diff --git a/src/app/SharpRaven/SharpRaven.csproj b/src/app/SharpRaven/SharpRaven.csproj index 9b93c36a..ae5d394c 100644 --- a/src/app/SharpRaven/SharpRaven.csproj +++ b/src/app/SharpRaven/SharpRaven.csproj @@ -1,175 +1,50 @@ - - - + - Release 4.5 - AnyCPU - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1} - Library - Properties - SharpRaven - SharpRaven - v4.5 - 512 - ..\ - - 7a5c1353 + netstandard2.0;net45;net40;net35 + false + Debug;Release;Debug-net35;Release-net35;Debug-net40;Release-net40;Debug-net45;Release-net45;Release-netstandard2.0;Debug-netstandard2.0;Release-netstandard2.0 + + SharpRaven + https://raw.githubusercontent.com/getsentry/raven-csharp/master/sentry-icon.png + raven sentry logging + .NET client for Sentry (getsentry.com) + Raven is a C# client for Sentry (getsentry.com and github.com/getsentry/sentry) + Copyright 2014 The Sentry Team and individual contributors + false + $(ReleaseNotes) + Sentry Team + jsk, asbjornu, gmaclellan + https://github.com/getsentry/raven-csharp + https://github.com/getsentry/raven-csharp.git + git - - true - full - false - bin\Debug\net35\ - TRACE;DEBUG;net35 - prompt - 4 - bin\Debug\net35\SharpRaven.xml - MinimumRecommendedRules.ruleset - false - v3.5 - - - pdbonly - true - bin\Release\net35\ - TRACE;net35 - prompt - 4 - bin\Release\net35\SharpRaven.xml - MinimumRecommendedRules.ruleset - false - v3.5 - - - true - full - false - bin\Debug\net40\ - TRACE;DEBUG;net40 - prompt - 4 - bin\Debug\net40\SharpRaven.xml - MinimumRecommendedRules.ruleset - false - v4.0 - - - pdbonly - true - bin\Release\net40\ - TRACE;net40 - prompt - 4 - bin\Release\net40\SharpRaven.xml - MinimumRecommendedRules.ruleset - false - v4.0 - - - true - bin\Debug\net45\ - DEBUG;TRACE - full - AnyCPU - prompt - bin\Debug\net45\SharpRaven.xml - MinimumRecommendedRules.ruleset - false - v4.5 - - - bin\Release\net45\ - TRACE - true - pdbonly - AnyCPU - prompt - bin\Release\net45\SharpRaven.xml - MinimumRecommendedRules.ruleset - false - v4.5 - - - - - False - ..\..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll - - - False - ..\..\packages\Newtonsoft.Json.6.0.8\lib\net40\Newtonsoft.Json.dll - - - False - ..\..\packages\Newtonsoft.Json.6.0.8\lib\net40\Newtonsoft.Json.dll - + + + + - - + - - - Properties\CommonAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - \ No newline at end of file + diff --git a/src/app/SharpRaven/SharpRaven.nuspec b/src/app/SharpRaven/SharpRaven.nuspec deleted file mode 100644 index ac37dd60..00000000 --- a/src/app/SharpRaven/SharpRaven.nuspec +++ /dev/null @@ -1,23 +0,0 @@ - - - - SharpRaven - $version$ - .NET client for Sentry (getsentry.com) - Sentry Team - jsk, asbjornu, gmaclellan - https://github.com/getsentry/raven-csharp/blob/master/LICENSE - https://github.com/getsentry/raven-csharp - https://raw.githubusercontent.com/getsentry/raven-csharp/master/sentry-icon.png - false - Raven is a C# client for Sentry (getsentry.com and github.com/getsentry/sentry) - $releaseNotes$ - Copyright 2014 The Sentry Team and individual contributors - raven sentry logging - - - - - - - \ No newline at end of file diff --git a/src/app/SharpRaven/packages.config b/src/app/SharpRaven/packages.config deleted file mode 100644 index e7c24c6a..00000000 --- a/src/app/SharpRaven/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/src/tests/SharpRaven.Nancy.UnitTests/LogModule.cs b/src/tests/SharpRaven.Nancy.UnitTests/LogModule.cs index 9ad24b6f..46bd68bb 100644 --- a/src/tests/SharpRaven.Nancy.UnitTests/LogModule.cs +++ b/src/tests/SharpRaven.Nancy.UnitTests/LogModule.cs @@ -28,8 +28,6 @@ #endregion -using System.Net.Http; - using Nancy; namespace SharpRaven.Nancy.UnitTests @@ -44,14 +42,12 @@ public LogModule(IRavenClient ravenClient) return View["log.html", new { MessageId = messageId }]; }; + #if (!net40) && (!net35) Get["/log-async", runAsync : true] = async (_, token) => + #else + Get["/log-async"] = (_) => + #endif { - var httpClient = new HttpClient(); - var response = await httpClient.GetAsync("http://www.google.com"); - - response.EnsureSuccessStatusCode(); - - var result = await response.Content.ReadAsStringAsync(); #if (!net40) && (!net35) var messageId = await ravenClient.CaptureMessageAsync("Hello world!!!"); #else @@ -62,4 +58,4 @@ public LogModule(IRavenClient ravenClient) }; } } -} \ No newline at end of file +} diff --git a/src/tests/SharpRaven.Nancy.UnitTests/SharpRaven.Nancy.UnitTests.csproj b/src/tests/SharpRaven.Nancy.UnitTests/SharpRaven.Nancy.UnitTests.csproj index 2576d513..414cd249 100644 --- a/src/tests/SharpRaven.Nancy.UnitTests/SharpRaven.Nancy.UnitTests.csproj +++ b/src/tests/SharpRaven.Nancy.UnitTests/SharpRaven.Nancy.UnitTests.csproj @@ -1,142 +1,43 @@ - - - + - Debug - AnyCPU - {7FE52A2B-430C-4C6F-BEA9-0855AF973D0C} - Exe - Properties - SharpRaven.Nancy.UnitTests - SharpRaven.Nancy.UnitTests - v4.5 - 512 - true - - a120c3a0 - - - bin\Release\net40\ - TRACE;net40 - true - pdbonly - AnyCPU - prompt - MinimumRecommendedRules.ruleset - true - - - true - bin\Debug\net40\ - TRACE;DEBUG;net40 - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - true - - - bin\Release\net45\ - TRACE - true - pdbonly - AnyCPU - prompt - MinimumRecommendedRules.ruleset - true - - - true - bin\Debug\net45\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - true + net45;net40 + false + Debug;Release;Debug-net35;Release-net35;Debug-net40;Release-net40;Debug-net45;Release-net45;Release-netstandard2.0;Debug-netstandard2.0;Release-netstandard2.0 + + + - - False - ..\..\packages\CsQuery.1.3.4\lib\net40\CsQuery.dll - - - - ..\..\packages\Nancy.1.4.3\lib\net40\Nancy.dll - True - - - ..\..\packages\Nancy.Hosting.Self.1.4.1\lib\net40\Nancy.Hosting.Self.dll - True - - - ..\..\packages\Nancy.Testing.1.4.1\lib\net40\Nancy.Testing.dll - True - - - ..\..\packages\NSubstitute.1.8.0.0\lib\net45\NSubstitute.dll - - - False - ..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - + + + + + - - - - - - Properties\CommonAssemblyInfo.cs - - - - - - - + - - - + + + + + + + + + - + + + Always - - + + Always - - + + Always - - - - - {abe22746-6eeb-4970-a608-c02bc3b8bda3} - SharpRaven.Nancy - - - {cc80a2e1-ae39-44de-8da3-4eef42f90fb1} - SharpRaven - - - - + - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - \ No newline at end of file + diff --git a/src/tests/SharpRaven.Nancy.UnitTests/packages.config b/src/tests/SharpRaven.Nancy.UnitTests/packages.config deleted file mode 100644 index c8a1e0d1..00000000 --- a/src/tests/SharpRaven.Nancy.UnitTests/packages.config +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/src/tests/SharpRaven.UnitTests/Data/HttpRequestBodyConverterTests.cs b/src/tests/SharpRaven.UnitTests/Data/HttpRequestBodyConverterTests.cs index b65e67e0..e7b255e1 100644 --- a/src/tests/SharpRaven.UnitTests/Data/HttpRequestBodyConverterTests.cs +++ b/src/tests/SharpRaven.UnitTests/Data/HttpRequestBodyConverterTests.cs @@ -58,7 +58,7 @@ public void Convert_Form_ReturnsForm() httpContext.Request.ContentType = "application/x-www-form-urlencoded"; httpContext.Request.Form = new NameValueCollection { { "Key", "Value" } }; - var converted = HttpRequestBodyConverter.Convert(httpContext); + object converted = HttpRequestBodyConverter.Convert(httpContext); Assert.That(converted, Is.Not.Null); Assert.That(converted, Is.TypeOf>()); @@ -86,14 +86,14 @@ public void Convert_Json_ReturnsDictionary(string jsonContentType) var converted = HttpRequestBodyConverter.Convert(httpContext); - Assert.That(converted, Is.Not.Null); - Assert.That(converted, Is.TypeOf>()); - Assert.That(converted, Has.Member(new KeyValuePair("String", "value"))); - Assert.That(converted, Has.Member(new KeyValuePair("Int", 100))); - Assert.That(converted["Array"], Is.Not.Null); - Assert.That(converted["Array"].ToObject(), Is.EquivalentTo(new[] { "hello", "world", "!" })); - Assert.That(converted["ObjectArray"], Is.Not.Null); - Assert.That(converted["ObjectArray"].ToObject>(), + Assert.That((object)converted, Is.Not.Null); + Assert.That((object)converted, Is.TypeOf>()); + Assert.That((object)converted, Has.Member(new KeyValuePair("String", "value"))); + Assert.That((object)converted, Has.Member(new KeyValuePair("Int", 100))); + Assert.That((object)converted["Array"], Is.Not.Null); + Assert.That((string[])converted["Array"].ToObject(), Is.EquivalentTo(new[] { "hello", "world", "!" })); + Assert.That((object)converted["ObjectArray"], Is.Not.Null); + Assert.That((Dictionary)converted["ObjectArray"].ToObject>(), Has.Member(new KeyValuePair("b", 2.0))); } @@ -106,7 +106,7 @@ public void Convert_MultiPartForm_ReturnsForm() httpContext.Request.ContentType = "multipart/form-data"; httpContext.Request.Form = new NameValueCollection { { "Key", "Value" } }; - var converted = HttpRequestBodyConverter.Convert(httpContext); + object converted = HttpRequestBodyConverter.Convert(httpContext); Assert.That(converted, Is.Not.Null); Assert.That(converted, Is.TypeOf>()); @@ -122,7 +122,7 @@ public void Convert_UnknownType_ReturnsString() httpContext.Request.ContentType = "unkown/type"; httpContext.Request.InputStream = new MemoryStream(Encoding.UTF8.GetBytes("Hello world!")); - var converted = HttpRequestBodyConverter.Convert(httpContext); + object converted = HttpRequestBodyConverter.Convert(httpContext); Assert.That(converted, Is.EqualTo("Hello world!")); } diff --git a/src/tests/SharpRaven.UnitTests/Data/JsonPacketFactoryTests.cs b/src/tests/SharpRaven.UnitTests/Data/JsonPacketFactoryTests.cs index 2b6ae2c7..8b5d0dd3 100644 --- a/src/tests/SharpRaven.UnitTests/Data/JsonPacketFactoryTests.cs +++ b/src/tests/SharpRaven.UnitTests/Data/JsonPacketFactoryTests.cs @@ -97,6 +97,26 @@ public void Create_ExtraIsEnumerable_ExtraIsSerializedWithOnlyKeyValues() Assert.That(jExtra.Property("key2").Value.ToString(), Is.EqualTo("value2")); } + [Test] + public void Create_ExtraIsNotSerializable() + { + var project = Guid.NewGuid().ToString(); + var exception = new Exception("Error"); + var extra = "Hello"; + var type = extra.GetType().ToString(); + var json = this.jsonPacketFactory.Create(project, exception, extra: extra); + var jsonString = JsonConvert.SerializeObject(json.Extra, Formatting.Indented); + Console.WriteLine(jsonString); + + Assert.That(jsonString, Is.Not.StringContaining("Count")); + Assert.That(jsonString, Is.Not.StringContaining("Keys")); + Assert.That(jsonString, Is.Not.StringContaining("Values")); + Assert.That(jsonString, Is.Not.StringContaining("Comparer")); + + var jExtra = (JObject)json.Extra; + Assert.That(jExtra.Property(type), Is.Not.Null, type); + Assert.That(jExtra.Property(type).Value.ToString(), Is.EqualTo("Hello")); + } [Test] public void Create_InvokesOnCreate() diff --git a/src/tests/SharpRaven.UnitTests/RavenClientTests.Net45.cs b/src/tests/SharpRaven.UnitTests/RavenClientTests.Net45.cs deleted file mode 100644 index 0835f841..00000000 --- a/src/tests/SharpRaven.UnitTests/RavenClientTests.Net45.cs +++ /dev/null @@ -1,208 +0,0 @@ -#region License - -// Copyright (c) 2014 The Sentry Team and individual contributors. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, are permitted -// provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of -// conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of -// conditions and the following disclaimer in the documentation and/or other materials -// provided with the distribution. -// -// 3. Neither the name of the Sentry nor the names of its contributors may be used to -// endorse or promote products derived from this software without specific prior written -// permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -#if (!net40) - -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -using NSubstitute; - -using NUnit.Framework; - -using SharpRaven.Data; -using SharpRaven.Logging; -using SharpRaven.UnitTests.Utilities; - -namespace SharpRaven.UnitTests -{ - [TestFixture] - public partial class RavenClientTests - { - [Test] - public async Task CaptureMessageAsync_ClientEnvironmentIsIgnored() - { - var jsonPacketFactory = new TestableJsonPacketFactory(environment : "keep-me"); - var client = new TestableRavenClient(dsnUri, jsonPacketFactory) { Environment = "foobar" }; - await client.CaptureMessageAsync("Test"); - - var lastEvent = client.LastPacket; - - Assert.That(lastEvent.Environment, Is.EqualTo("keep-me")); - } - - - [Test] - public async Task CaptureMessageAsync_ClientLoggerIsIgnored() - { - var jsonPacketFactory = new TestableJsonPacketFactory(logger : "keep-me"); - var client = new TestableRavenClient(dsnUri, jsonPacketFactory) { Logger = "foobar" }; - await client.CaptureMessageAsync("Test"); - - var lastEvent = client.LastPacket; - - Assert.That(lastEvent.Logger, Is.EqualTo("keep-me")); - } - - - [Test] - public async Task CaptureMessageAsync_ClientReleaseIsIgnored() - { - var jsonPacketFactory = new TestableJsonPacketFactory(release : "keep-me"); - var client = new TestableRavenClient(dsnUri, jsonPacketFactory) { Release = "foobar" }; - await client.CaptureMessageAsync("Test"); - - var lastEvent = client.LastPacket; - - Assert.That(lastEvent.Release, Is.EqualTo("keep-me")); - } - - - [Test] - public async Task CaptureMessageAsync_InvokesSend_AndJsonPacketFactoryOnCreate() - { - var project = Guid.NewGuid().ToString(); - var jsonPacketFactory = new TestableJsonPacketFactory(project); - var client = new TestableRavenClient(dsnUri, jsonPacketFactory); - var result = await client.CaptureMessageAsync("Test"); - - Assert.That(result, Is.EqualTo(project)); - } - - - [Test] - public async Task CaptureMessageAsync_OnlyDefaultTags() - { - var client = new TestableRavenClient(dsnUri); - client.Tags.Add("key", "value"); - client.Tags.Add("foo", "bar"); - // client.Tags = defaultTags; - await client.CaptureMessageAsync("Test", ErrorLevel.Info); - - var lastEvent = client.LastPacket; - - Assert.That(lastEvent.Tags["key"], Is.EqualTo("value")); - Assert.That(lastEvent.Tags["foo"], Is.EqualTo("bar")); - } - - - [Test] - public async Task CaptureMessageAsync_OnlyMessageTags() - { - var messageTags = new Dictionary { { "key", "value" }, { "foo", "bar" } }; - - var client = new TestableRavenClient(dsnUri); - await client.CaptureMessageAsync("Test", ErrorLevel.Info, messageTags); - - var lastEvent = client.LastPacket; - - Assert.That(lastEvent.Tags["key"], Is.EqualTo("value")); - Assert.That(lastEvent.Tags["foo"], Is.EqualTo("bar")); - } - - - [Test] - public async Task CaptureMessageAsync_ScrubberIsInvoked() - { - string message = Guid.NewGuid().ToString("n"); - - var client = new RavenClient(TestHelper.DsnUri); - client.LogScrubber = Substitute.For(); - client.LogScrubber.Scrub(Arg.Any()) - .Returns(c => - { - string json = c.Arg(); - Assert.That(json, Is.StringContaining(message)); - return json; - }); - - await client.CaptureMessageAsync(message); - - // Verify that we actually received a Scrub() call: - client.LogScrubber.Received().Scrub(Arg.Any()); - } - - - [Test] - public async Task CaptureMessageAsync_SendsEnvironment() - { - var client = new TestableRavenClient(dsnUri) { Environment = "foobar" }; - await client.CaptureMessageAsync("Test"); - - var lastEvent = client.LastPacket; - - Assert.That(lastEvent.Environment, Is.EqualTo("foobar")); - } - - - [Test] - public async Task CaptureMessageAsync_SendsLogger() - { - var client = new TestableRavenClient(dsnUri) { Logger = "foobar" }; - await client.CaptureMessageAsync("Test"); - - var lastEvent = client.LastPacket; - - Assert.That(lastEvent.Logger, Is.EqualTo("foobar")); - } - - - [Test] - public async Task CaptureMessageAsync_SendsRelease() - { - var client = new TestableRavenClient(dsnUri) { Release = "foobar" }; - await client.CaptureMessageAsync("Test"); - - var lastEvent = client.LastPacket; - - Assert.That(lastEvent.Release, Is.EqualTo("foobar")); - } - - - [Test] - public async Task CaptureMessageAsync_TagHandling() - { - var messageTags = new Dictionary { { "key", "another value" } }; - - var client = new TestableRavenClient(dsnUri); - client.Tags.Add("key", "value"); - client.Tags.Add("foo", "bar"); - await client.CaptureMessageAsync("Test", ErrorLevel.Info, messageTags); - - var lastEvent = client.LastPacket; - - Assert.That(lastEvent.Tags["key"], Is.EqualTo("another value")); - Assert.That(lastEvent.Tags["foo"], Is.EqualTo("bar")); - } - } -} - -#endif \ No newline at end of file diff --git a/src/tests/SharpRaven.UnitTests/SharpRaven.UnitTests.csproj b/src/tests/SharpRaven.UnitTests/SharpRaven.UnitTests.csproj index 3e12af02..47a74ef7 100644 --- a/src/tests/SharpRaven.UnitTests/SharpRaven.UnitTests.csproj +++ b/src/tests/SharpRaven.UnitTests/SharpRaven.UnitTests.csproj @@ -1,188 +1,33 @@ - - - + - Release 4.5 - AnyCPU - {E1DBEBBF-9448-4D99-B378-2B8CF1629F31} - Library - Properties - SharpRaven.UnitTests - SharpRaven.UnitTests - v4.5 - 512 - ..\ - - 69e16cb9 - - - true - full - false - bin\Debug\net35\ - TRACE;DEBUG;net35 - prompt - 4 - false - v3.5 - - - pdbonly - true - bin\Release\net35\ - TRACE;net35 - prompt - 4 - false - v3.5 - - - true - full - false - bin\Debug\net40\ - TRACE;DEBUG;net40 - prompt - 4 - false - v4.0 - - - pdbonly - true - bin\Release\net40\ - TRACE;net40 - prompt - 4 - false - v4.0 - - - true - bin\Debug\net45\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - false - - - bin\Release\net45\ - TRACE - true - pdbonly - AnyCPU - prompt - MinimumRecommendedRules.ruleset - false + net45;net40;net35 + false + + + - - - False - ..\..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll - - - False - ..\..\packages\Newtonsoft.Json.6.0.8\lib\net40\Newtonsoft.Json.dll - - - False - ..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll - - - False - ..\..\packages\NSubstitute.1.8.0.0\lib\net35\NSubstitute.dll - - - False - ..\..\packages\NSubstitute.1.8.0.0\lib\net40\NSubstitute.dll - - - False - ..\..\packages\NSubstitute.1.8.0.0\lib\net45\NSubstitute.dll - - - False - ..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - + + + + - - - Properties\CommonAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Designer - + + + + - - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1} - SharpRaven - + + + + - + + + - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - \ No newline at end of file + diff --git a/src/tests/SharpRaven.UnitTests/packages.config b/src/tests/SharpRaven.UnitTests/packages.config deleted file mode 100644 index 10e9d704..00000000 --- a/src/tests/SharpRaven.UnitTests/packages.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/tests/SharpRaven.WebTest/Default.aspx b/src/tests/SharpRaven.WebTest/Default.aspx deleted file mode 100644 index da1afa02..00000000 --- a/src/tests/SharpRaven.WebTest/Default.aspx +++ /dev/null @@ -1,55 +0,0 @@ -<%@ Page Language="C#" %> -<%@ Import Namespace="SharpRaven" %> - - - - - <%= Title %> - - -

<%= Title %>

-
- - -
- - \ No newline at end of file diff --git a/src/tests/SharpRaven.WebTest/Properties/AssemblyInfo.cs b/src/tests/SharpRaven.WebTest/Properties/AssemblyInfo.cs deleted file mode 100644 index 80ff958c..00000000 --- a/src/tests/SharpRaven.WebTest/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -#region License - -// Copyright (c) 2014 The Sentry Team and individual contributors. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, are permitted -// provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of -// conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of -// conditions and the following disclaimer in the documentation and/or other materials -// provided with the distribution. -// -// 3. Neither the name of the Sentry nor the names of its contributors may be used to -// endorse or promote products derived from this software without specific prior written -// permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly : AssemblyTitle("SharpRaven.WebTest")] -[assembly : Guid("7a9427ee-49db-4893-9fc6-60dda06f39fa")] \ No newline at end of file diff --git a/src/tests/SharpRaven.WebTest/SharpRaven.WebTest.csproj b/src/tests/SharpRaven.WebTest/SharpRaven.WebTest.csproj deleted file mode 100644 index 18b12972..00000000 --- a/src/tests/SharpRaven.WebTest/SharpRaven.WebTest.csproj +++ /dev/null @@ -1,155 +0,0 @@ - - - - - Release 4.5 - AnyCPU - - - 2.0 - {156621FC-2C48-4CDF-A368-9347BABE9089} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - SharpRaven.WebTest - SharpRaven.WebTest - v4.5 - true - - - - - - 22972567 - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - false - v3.5 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - false - v3.5 - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - false - v4.0 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - false - v4.0 - - - - - - - - - - - - Properties\CommonAssemblyInfo.cs - - - - - - - Web.config - - - Web.config - - - - - {CC80A2E1-AE39-44DE-8DA3-4EEF42F90FB1} - SharpRaven - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - true - bin\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - false - - - bin\ - TRACE - true - pdbonly - AnyCPU - prompt - MinimumRecommendedRules.ruleset - false - - - - - - - - - True - True - 0 - / - http://localhost:49230/ - False - False - - - False - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - \ No newline at end of file diff --git a/src/tests/SharpRaven.WebTest/SharpRaven.WebTest.csproj.DotSettings b/src/tests/SharpRaven.WebTest/SharpRaven.WebTest.csproj.DotSettings deleted file mode 100644 index 662f9568..00000000 --- a/src/tests/SharpRaven.WebTest/SharpRaven.WebTest.csproj.DotSettings +++ /dev/null @@ -1,2 +0,0 @@ - - CSharp50 \ No newline at end of file diff --git a/src/tests/SharpRaven.WebTest/Web.Debug.config b/src/tests/SharpRaven.WebTest/Web.Debug.config deleted file mode 100644 index f7c56123..00000000 --- a/src/tests/SharpRaven.WebTest/Web.Debug.config +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/src/tests/SharpRaven.WebTest/Web.Release.config b/src/tests/SharpRaven.WebTest/Web.Release.config deleted file mode 100644 index 52c6bbe3..00000000 --- a/src/tests/SharpRaven.WebTest/Web.Release.config +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/tests/SharpRaven.WebTest/Web.config b/src/tests/SharpRaven.WebTest/Web.config deleted file mode 100644 index 1ae16b5e..00000000 --- a/src/tests/SharpRaven.WebTest/Web.config +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/src/tests/SharpRaven.WebTest/packages.config b/src/tests/SharpRaven.WebTest/packages.config deleted file mode 100644 index 67680ed3..00000000 --- a/src/tests/SharpRaven.WebTest/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/tools/packages.config b/tools/packages.config new file mode 100644 index 00000000..747e13e6 --- /dev/null +++ b/tools/packages.config @@ -0,0 +1,4 @@ + + + +