diff --git a/.gitignore b/.gitignore index 3d41072a..71434377 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,610 @@ +# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,visualstudio,csharp,powershell +# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,visualstudio,csharp,powershell + +### Csharp ### +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore + +# User-specific files +*.rsuser *.suo -obj/ -bin/ -packages/ *.user -*.csproj.user -AssemblyVersion.cs -temp.txt -*.lock.*.docx# +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) *.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory .vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml + +### PowerShell ### +# Exclude packaged modules +*.zip + +# Exclude .NET assemblies from source +*.dll + +### VisualStudioCode ### +!.vscode/*.code-snippets + +# Local History for Visual Studio Code + +# Built Visual Studio Code Extensions +*.vsix + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +### VisualStudio ### + +# User-specific files + +# User-specific files (MonoDevelop/Xamarin Studio) + +# Mono auto generated files + +# Build results + +# Visual Studio 2015/2017 cache/options directory +# Uncomment if you have tasks that create the project's static files in wwwroot + +# Visual Studio 2017 auto generated files + +# MSTest test Results + +# NUnit + +# Build Results of an ATL Project + +# Benchmark Results + +# .NET Core + +# ASP.NET Scaffolding + +# StyleCop + +# Files built by Visual Studio + +# Chutzpah Test files + +# Visual C++ cache files + +# Visual Studio profiler + +# Visual Studio Trace Files + +# TFS 2012 Local Workspace + +# Guidance Automation Toolkit + +# ReSharper is a .NET coding add-in + +# TeamCity is a build add-in + +# DotCover is a Code Coverage Tool + +# AxoCover is a Code Coverage Tool + +# Coverlet is a free, cross platform Code Coverage Tool + +# Visual Studio code coverage results + +# NCrunch + +# MightyMoose + +# Web workbench (sass) + +# Installshield output folder + +# DocProject is a documentation generator add-in + +# Click-Once directory + +# Publish Web Output +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted + +# NuGet Packages +# NuGet Symbol Packages +# The packages folder can be ignored because of Package Restore +# except build/, which is used as an MSBuild target. +# Uncomment if necessary however generally it will be regenerated when needed +# NuGet v3's project.json files produces more ignorable files + +# Microsoft Azure Build Output + +# Microsoft Azure Emulator + +# Windows Store app package directories and files + +# Visual Studio cache files +# files ending in .cache can be ignored +# but keep track of directories ending in .cache + +# Others + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) + +# RIA/Silverlight projects + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) + +# SQL Server files + +# Business Intelligence projects + +# Microsoft Fakes + +# GhostDoc plugin setting file + +# Node.js Tools for Visual Studio + +# Visual Studio 6 build log + +# Visual Studio 6 workspace options file + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) + +# Visual Studio 6 technical files + +# Visual Studio LightSwitch build output + +# Paket dependency manager + +# FAKE - F# Make + +# CodeRush personal settings + +# Python Tools for Visual Studio (PTVS) + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio + +# Telerik's JustMock configuration file + +# BizTalk build output + +# OpenCover UI analysis results + +# Azure Stream Analytics local run output + +# MSBuild Binary and Structured Log + +# NVidia Nsight GPU debugger configuration file + +# MFractors (Xamarin productivity tool) working folder + +# Local History for Visual Studio + +# Visual Studio History (VSHistory) files + +# BeatPulse healthcheck temp database + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 + +# Ionide (cross platform F# VS Code tools) working folder + +# Fody - auto-generated XML schema + +# VS Code files for those working on multiple tools + +# Local History for Visual Studio Code + +# Windows Installer files from build outputs + +# JetBrains Rider + +### VisualStudio Patch ### +# Additional files built by Visual Studio + +# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,visualstudio,csharp,powershell + +packages/ +AssemblyVersion.cs +*.userprefs *.scgdat /Data -/.tmp +/.nuke/temp/ diff --git a/.nuke b/.nuke deleted file mode 100644 index 7360e257..00000000 --- a/.nuke +++ /dev/null @@ -1 +0,0 @@ -src/LogExpert.sln \ No newline at end of file diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json new file mode 100644 index 00000000..948bfd2a --- /dev/null +++ b/.nuke/build.schema.json @@ -0,0 +1,183 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "definitions": { + "Host": { + "type": "string", + "enum": [ + "AppVeyor", + "AzurePipelines", + "Bamboo", + "Bitbucket", + "Bitrise", + "GitHubActions", + "GitLab", + "Jenkins", + "Rider", + "SpaceAutomation", + "TeamCity", + "Terminal", + "TravisCI", + "VisualStudio", + "VSCode" + ] + }, + "ExecutableTarget": { + "type": "string", + "enum": [ + "BuildChocolateyPackage", + "ChangeVersionNumber", + "Clean", + "CleanPackage", + "CleanupAppDataLogExpert", + "CleanupDocumentsLogExpert", + "ColumnizerLibCreate", + "ColumnizerLibCreateNuget", + "Compile", + "CopyFilesForSetup", + "CopyOutputForChocolatey", + "CreatePackage", + "CreateSetup", + "Pack", + "PackageSftpFileSystem", + "PrepareChocolateyTemplates", + "Publish", + "PublishChocolatey", + "PublishColumnizerNuget", + "PublishGithub", + "PublishToAppveyor", + "Restore", + "Test" + ] + }, + "Verbosity": { + "type": "string", + "description": "", + "enum": [ + "Verbose", + "Normal", + "Minimal", + "Quiet" + ] + }, + "NukeBuild": { + "properties": { + "Continue": { + "type": "boolean", + "description": "Indicates to continue a previously failed build attempt" + }, + "Help": { + "type": "boolean", + "description": "Shows the help text for this build assembly" + }, + "Host": { + "description": "Host for execution. Default is 'automatic'", + "$ref": "#/definitions/Host" + }, + "NoLogo": { + "type": "boolean", + "description": "Disables displaying the NUKE logo" + }, + "Partition": { + "type": "string", + "description": "Partition to use on CI" + }, + "Plan": { + "type": "boolean", + "description": "Shows the execution plan (HTML)" + }, + "Profile": { + "type": "array", + "description": "Defines the profiles to load", + "items": { + "type": "string" + } + }, + "Root": { + "type": "string", + "description": "Root directory during build execution" + }, + "Skip": { + "type": "array", + "description": "List of targets to be skipped. Empty list skips all dependencies", + "items": { + "$ref": "#/definitions/ExecutableTarget" + } + }, + "Target": { + "type": "array", + "description": "List of targets to be invoked. Default is '{default_target}'", + "items": { + "$ref": "#/definitions/ExecutableTarget" + } + }, + "Verbosity": { + "description": "Logging verbosity during build execution. Default is 'Normal'", + "$ref": "#/definitions/Verbosity" + } + } + } + }, + "allOf": [ + { + "properties": { + "ChocolateyApiKey": { + "type": "string", + "description": "Chocolatey api key" + }, + "Configuration": { + "type": "string", + "description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)", + "enum": [ + "Debug", + "Release" + ] + }, + "ExcludeDirectoryGlob": { + "type": "array", + "description": "Exlcude directory glob", + "items": { + "type": "string" + } + }, + "ExcludeFileGlob": { + "type": "array", + "description": "Exclude file globs", + "items": { + "type": "string" + } + }, + "GitHubApiKey": { + "type": "string", + "description": "GitHub Api key" + }, + "my_variable": { + "type": "string", + "description": "My variable" + }, + "NugetApiKey": { + "type": "string", + "description": "Nuget api key" + }, + "Solution": { + "type": "string", + "description": "Path to a solution file that is automatically loaded" + }, + "VersionFileString": { + "type": "string", + "description": "Version file string" + }, + "VersionInformationString": { + "type": "string", + "description": "Version Information string" + }, + "VersionString": { + "type": "string", + "description": "Version string" + } + } + }, + { + "$ref": "#/definitions/NukeBuild" + } + ] +} diff --git a/.nuke/parameters.json b/.nuke/parameters.json new file mode 100644 index 00000000..3615de21 --- /dev/null +++ b/.nuke/parameters.json @@ -0,0 +1,4 @@ +{ + "$schema": "build.schema.json", + "Solution": "src/LogExpert.sln" +} diff --git a/appveyor-release.yml b/appveyor-release.yml index b97387a3..37913b57 100644 --- a/appveyor-release.yml +++ b/appveyor-release.yml @@ -2,8 +2,17 @@ version: 1.8.{build} branches: only: - master -image: Visual Studio 2017 + +install: +- ps: dotnet tool restore +- ps: dotnet restore --use-current-runtime +- ps: dotnet build --no-restore + +build: + project: LogExpert.sln + environment: + DOTNET_CLI_TELEMETRY_OPTOUT: 1 my_variable: secure: Qpq/4cyuTUzmt/r4HsQxioG6WXrZSK3mzVq5iUJC2RI= NugetApiKey: @@ -12,6 +21,5 @@ environment: secure: mXmzLqgFyDEjGRcE4UpqwqOXmdiCm9HwJ2V3LzSAz06GL1OaBDoTzidw7Rly+UHk GitHubApiKey: secure: N83nQZ/QQVqpRnl0D6F/xSbKjn062y07JdskpUpbWryMY2JDo4Be9lUXmob+xcOO -build_script: -- cmd: PowerShell.exe -NoProfile -ExecutionPolicy Bypass -Command "& '.\build.ps1' --target Clean Pack Publish CreateSetup PublishToAppveyor ChangeVersionNumber --Configuration Release" + test: off diff --git a/appveyor.yml b/appveyor.yml index 3dcc7637..fd9ffe65 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@ version: 0.0.{build} -image: Visual Studio 2019 +image: Visual Studio 2022 environment: my_variable: secure: Qpq/4cyuTUzmt/r4HsQxioG6WXrZSK3mzVq5iUJC2RI= diff --git a/build.cmd b/build.cmd new file mode 100644 index 00000000..b08cc590 --- /dev/null +++ b/build.cmd @@ -0,0 +1,7 @@ +:; set -eo pipefail +:; SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) +:; ${SCRIPT_DIR}/build.sh "$@" +:; exit $? + +@ECHO OFF +powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0build.ps1" %* diff --git a/build.ps1 b/build.ps1 index cb7fbdb2..4634dc03 100644 --- a/build.ps1 +++ b/build.ps1 @@ -4,9 +4,9 @@ Param( [string[]]$BuildArguments ) -Write-Output "Windows PowerShell $($Host.Version)" +Write-Output "PowerShell $($PSVersionTable.PSEdition) version $($PSVersionTable.PSVersion)" -Set-StrictMode -Version 2.0; $ErrorActionPreference = "Stop"; $ConfirmPreference = "None"; trap { exit 1 } +Set-StrictMode -Version 2.0; $ErrorActionPreference = "Stop"; $ConfirmPreference = "None"; trap { Write-Error $_ -ErrorAction Continue; exit 1 } $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent ########################################################################### @@ -14,14 +14,14 @@ $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent ########################################################################### $BuildProjectFile = "$PSScriptRoot\build\_build.csproj" -$TempDirectory = "$PSScriptRoot\\.tmp" +$TempDirectory = "$PSScriptRoot\\.nuke\temp" $DotNetGlobalFile = "$PSScriptRoot\\global.json" -$DotNetInstallUrl = "https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.ps1" -$DotNetChannel = "Current" +$DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1" +$DotNetChannel = "STS" -$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1 $env:DOTNET_CLI_TELEMETRY_OPTOUT = 1 +$env:DOTNET_NOLOGO = 1 ########################################################################### # EXECUTION @@ -32,37 +32,43 @@ function ExecSafe([scriptblock] $cmd) { if ($LASTEXITCODE) { exit $LASTEXITCODE } } -# If global.json exists, load expected version -if (Test-Path $DotNetGlobalFile) { - $DotNetGlobal = $(Get-Content $DotNetGlobalFile | Out-String | ConvertFrom-Json) - if ($DotNetGlobal.PSObject.Properties["sdk"] -and $DotNetGlobal.sdk.PSObject.Properties["version"]) { - $DotNetVersion = $DotNetGlobal.sdk.version - } -} - -# If dotnet is installed locally, and expected version is not set or installation matches the expected version -if ((Get-Command "dotnet" -ErrorAction SilentlyContinue) -ne $null -and ` - (!(Test-Path variable:DotNetVersion) -or $(& dotnet --version) -eq $DotNetVersion)) { +# If dotnet CLI is installed globally and it matches requested version, use for execution +if ($null -ne (Get-Command "dotnet" -ErrorAction SilentlyContinue) -and ` + $(dotnet --version) -and $LASTEXITCODE -eq 0) { $env:DOTNET_EXE = (Get-Command "dotnet").Path } else { - $DotNetDirectory = "$TempDirectory\dotnet-win" - $env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe" - # Download install script $DotNetInstallFile = "$TempDirectory\dotnet-install.ps1" - md -force $TempDirectory > $null + New-Item -ItemType Directory -Path $TempDirectory -Force | Out-Null + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 (New-Object System.Net.WebClient).DownloadFile($DotNetInstallUrl, $DotNetInstallFile) + # If global.json exists, load expected version + if (Test-Path $DotNetGlobalFile) { + $DotNetGlobal = $(Get-Content $DotNetGlobalFile | Out-String | ConvertFrom-Json) + if ($DotNetGlobal.PSObject.Properties["sdk"] -and $DotNetGlobal.sdk.PSObject.Properties["version"]) { + $DotNetVersion = $DotNetGlobal.sdk.version + } + } + # Install by channel or version + $DotNetDirectory = "$TempDirectory\dotnet-win" if (!(Test-Path variable:DotNetVersion)) { - ExecSafe { & $DotNetInstallFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath } + ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath } } else { - ExecSafe { & $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath } + ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath } } + $env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe" + $env:PATH = "$DotNetDirectory;$env:PATH" } -Write-Output "Microsoft (R) .NET Core SDK version $(& $env:DOTNET_EXE --version)" +Write-Output "Microsoft (R) .NET SDK version $(& $env:DOTNET_EXE --version)" + +if (Test-Path env:NUKE_ENTERPRISE_TOKEN) { + & $env:DOTNET_EXE nuget remove source "nuke-enterprise" > $null + & $env:DOTNET_EXE nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password $env:NUKE_ENTERPRISE_TOKEN > $null +} -ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false } +ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet } ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments } diff --git a/build.sh b/build.sh index 6d6e2ad4..fdff0c62 100644 --- a/build.sh +++ b/build.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -echo $(bash --version 2>&1 | head -n 1) +bash --version 2>&1 | head -n 1 set -eo pipefail SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) @@ -10,53 +10,58 @@ SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) ########################################################################### BUILD_PROJECT_FILE="$SCRIPT_DIR/build/_build.csproj" -TEMP_DIRECTORY="$SCRIPT_DIR//.tmp" +TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp" DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json" -DOTNET_INSTALL_URL="https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.sh" -DOTNET_CHANNEL="Current" +DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh" +DOTNET_CHANNEL="STS" export DOTNET_CLI_TELEMETRY_OPTOUT=1 -export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 +export DOTNET_NOLOGO=1 ########################################################################### # EXECUTION ########################################################################### function FirstJsonValue { - perl -nle 'print $1 if m{"'$1'": "([^"\-]+)",?}' <<< ${@:2} + perl -nle 'print $1 if m{"'"$1"'": "([^"]+)",?}' <<< "${@:2}" } -# If global.json exists, load expected version -if [ -f "$DOTNET_GLOBAL_FILE" ]; then - DOTNET_VERSION=$(FirstJsonValue "version" $(cat "$DOTNET_GLOBAL_FILE")) - if [ "$DOTNET_VERSION" == "" ]; then - unset DOTNET_VERSION - fi -fi - -# If dotnet is installed locally, and expected version is not set or installation matches the expected version -if [[ -x "$(command -v dotnet)" && (-z ${DOTNET_VERSION+x} || $(dotnet --version) == "$DOTNET_VERSION") ]]; then +# If dotnet CLI is installed globally and it matches requested version, use for execution +if [ -x "$(command -v dotnet)" ] && dotnet --version &>/dev/null; then export DOTNET_EXE="$(command -v dotnet)" else - DOTNET_DIRECTORY="$TEMP_DIRECTORY/dotnet-unix" - export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet" - # Download install script DOTNET_INSTALL_FILE="$TEMP_DIRECTORY/dotnet-install.sh" mkdir -p "$TEMP_DIRECTORY" curl -Lsfo "$DOTNET_INSTALL_FILE" "$DOTNET_INSTALL_URL" chmod +x "$DOTNET_INSTALL_FILE" - + + # If global.json exists, load expected version + if [[ -f "$DOTNET_GLOBAL_FILE" ]]; then + DOTNET_VERSION=$(FirstJsonValue "version" "$(cat "$DOTNET_GLOBAL_FILE")") + if [[ "$DOTNET_VERSION" == "" ]]; then + unset DOTNET_VERSION + fi + fi + # Install by channel or version - if [ -z ${DOTNET_VERSION+x} ]; then + DOTNET_DIRECTORY="$TEMP_DIRECTORY/dotnet-unix" + if [[ -z ${DOTNET_VERSION+x} ]]; then "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --channel "$DOTNET_CHANNEL" --no-path else "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "$DOTNET_VERSION" --no-path fi + export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet" + export PATH="$DOTNET_DIRECTORY:$PATH" fi -echo "Microsoft (R) .NET Core SDK version $("$DOTNET_EXE" --version)" +echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)" + +if [[ ! -z ${NUKE_ENTERPRISE_TOKEN+x} && "$NUKE_ENTERPRISE_TOKEN" != "" ]]; then + "$DOTNET_EXE" nuget remove source "nuke-enterprise" &>/dev/null || true + "$DOTNET_EXE" nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password "$NUKE_ENTERPRISE_TOKEN" --store-password-in-clear-text &>/dev/null || true +fi -"$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false +"$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet "$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" --no-build -- "$@" diff --git a/build/Build.cs b/build/Build.cs index 57b74734..7d1b3aec 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -1,9 +1,3 @@ -using System; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Text.RegularExpressions; -using System.Threading.Tasks; using Nuke.Common; using Nuke.Common.CI.AppVeyor; using Nuke.Common.Execution; @@ -11,22 +5,27 @@ using Nuke.Common.IO; using Nuke.Common.ProjectModel; using Nuke.Common.Tooling; -using Nuke.Common.Tools.MSBuild; using Nuke.Common.Tools.DotNet; using Nuke.Common.Tools.GitVersion; +using Nuke.Common.Tools.MSBuild; using Nuke.Common.Tools.NuGet; using Nuke.Common.Utilities.Collections; using Nuke.GitHub; + +using Serilog; + +using System; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text.RegularExpressions; +using System.Threading.Tasks; + using static Nuke.Common.EnvironmentInfo; -using static Nuke.Common.IO.FileSystemTasks; -using static Nuke.Common.Tools.MSBuild.MSBuildTasks; using static Nuke.Common.Tools.DotNet.DotNetTasks; -using static Nuke.Common.IO.TextTasks; -using static Nuke.Common.IO.CompressionTasks; +using static Nuke.Common.Tools.MSBuild.MSBuildTasks; using static Nuke.GitHub.GitHubTasks; -using static Nuke.Common.ControlFlow; -[CheckBuildProjectConfigurations] [UnsetVisualStudioEnvironmentVariables] class Build : NukeBuild { @@ -37,12 +36,13 @@ class Build : NukeBuild /// - Microsoft VSCode https://nuke.build/vscode public static int Main() => Execute(x => x.Test); - [Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")] + [Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")] readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release; + [Solution] readonly Solution Solution; [GitRepository] readonly GitRepository GitRepository; - [GitVersion(UpdateBuildNumber = true)] + [GitVersion(UpdateBuildNumber = true)] readonly Nuke.Common.Tools.GitVersion.GitVersion GitVersion; AbsolutePath SourceDirectory => RootDirectory / "src"; @@ -93,12 +93,12 @@ Version Version string VersionFileString => $"{Version.Major}.{Version.Minor}.0"; [Parameter("Exclude file globs")] - string[] ExcludeFileGlob => new[] {"**/*.xml", "**/*.XML", "**/*.pdb"}; + string[] ExcludeFileGlob => ["**/*.xml", "**/*.XML", "**/*.pdb"]; - [PathExecutable("choco.exe")] readonly Tool Chocolatey; + [PathVariable("choco.exe")] readonly Tool Chocolatey; [Parameter("Exlcude directory glob")] - string[] ExcludeDirectoryGlob => new[] {"**/pluginsx86"}; + string[] ExcludeDirectoryGlob => ["**/pluginsx86"]; [Parameter("My variable", Name = "my_variable")] string MyVariable = null; @@ -108,8 +108,8 @@ Version Version [Parameter("GitHub Api key")] string GitHubApiKey = null; - AbsolutePath[] AppveyorArtifacts => new[] - { + AbsolutePath[] AppveyorArtifacts => + [ (BinDirectory / $"LogExpert-Setup-{VersionString}.exe"), BinDirectory / $"LogExpert-CI-{VersionString}.zip", BinDirectory / $"LogExpert.{VersionString}.zip", @@ -117,7 +117,7 @@ Version Version BinDirectory / $"SftpFileSystem.x64.{VersionString}.zip", BinDirectory / $"SftpFileSystem.x86.{VersionString}.zip", ChocolateyDirectory / $"logexpert.{VersionString}.nupkg" - }; + ]; protected override void OnBuildInitialized() { @@ -130,38 +130,38 @@ protected override void OnBuildInitialized() .Before(Compile, Restore) .Executes(() => { - SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(DeleteDirectory); + SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(dir => dir.DeleteDirectory()); - if (DirectoryExists(BinDirectory)) + if (BinDirectory.DirectoryExists()) { - BinDirectory.GlobFiles("*", "*.*", ".*").ForEach(DeleteFile); - BinDirectory.GlobDirectories("*").ForEach(DeleteDirectory); + BinDirectory.GlobFiles("*", "*.*", ".*").ForEach(file => file.DeleteFile()); + BinDirectory.GlobDirectories("*").ForEach(dir => dir.DeleteDirectory()); - DeleteDirectory(BinDirectory); + BinDirectory.DeleteDirectory(); - EnsureCleanDirectory(BinDirectory); + BinDirectory.CreateOrCleanDirectory(); } }); Target CleanPackage => _ => _ .Before(Compile, Restore) - .OnlyWhenDynamic(() => DirectoryExists(BinDirectory)) + .OnlyWhenDynamic(() => BinDirectory.DirectoryExists()) .Executes(() => { - BinDirectory.GlobFiles("**/*.zip", "**/*.nupkg").ForEach(DeleteFile); + BinDirectory.GlobFiles("**/*.zip", "**/*.nupkg").ForEach(file => file.DeleteFile()); - if (DirectoryExists(PackageDirectory)) + if (PackageDirectory.DirectoryExists()) { - DeleteDirectory(PackageDirectory); + PackageDirectory.DeleteDirectory(); - EnsureCleanDirectory(PackageDirectory); + PackageDirectory.CreateOrCleanDirectory(); } - if (DirectoryExists(ChocolateyDirectory)) + if (ChocolateyDirectory.DirectoryExists()) { - DeleteDirectory(ChocolateyDirectory); + ChocolateyDirectory.DeleteDirectory(); - EnsureCleanDirectory(ChocolateyDirectory); + ChocolateyDirectory.CreateOrCleanDirectory(); } }); @@ -177,7 +177,8 @@ protected override void OnBuildInitialized() .DependsOn(Restore) .Executes(() => { - Logger.Info($"Version: '{VersionString}'"); + + Log.Information($"Version: '{VersionString}'"); MSBuild(s => s .SetTargetPath(Solution) @@ -193,10 +194,10 @@ protected override void OnBuildInitialized() .DependsOn(Compile) .Executes(() => { - DotNetTest(c =>c + DotNetTest(c => c .SetConfiguration(Configuration) .EnableNoBuild() - .CombineWith(SourceDirectory.GlobFiles("**/*Tests.csproj"), (settings, path) => + .CombineWith(SourceDirectory.GlobFiles("**/*Tests.csproj"), (settings, path) => settings.SetProjectFile(path)), degreeOfParallelism: 4, completeOnFailure: true); }); @@ -204,7 +205,7 @@ protected override void OnBuildInitialized() .DependsOn(CleanPackage) .Executes(() => { - CopyDirectoryRecursively(ChocolateyTemplateFiles, ChocolateyDirectory, DirectoryExistsPolicy.Merge); + ChocolateyTemplateFiles.Copy(ChocolateyDirectory, ExistsPolicy.MergeAndOverwriteIfNewer); ChocolateyDirectory.GlobFiles("**/*.template").ForEach(path => TransformTemplateFile(path, true)); }); @@ -213,9 +214,10 @@ protected override void OnBuildInitialized() .DependsOn(Compile, Test) .Executes(() => { - CopyDirectoryRecursively(OutputDirectory, ChocolateyDirectory / "tools", DirectoryExistsPolicy.Merge); - ChocolateyDirectory.GlobFiles(ExcludeFileGlob).ForEach(DeleteFile); - ChocolateyDirectory.GlobDirectories(ExcludeDirectoryGlob).ForEach(DeleteDirectory); + + OutputDirectory.Copy(ChocolateyDirectory / "tools", ExistsPolicy.MergeAndOverwriteIfNewer); + ChocolateyDirectory.GlobFiles(ExcludeFileGlob).ForEach(file => file.DeleteFile()); + ChocolateyDirectory.GlobDirectories(ExcludeDirectoryGlob).ForEach(dir => dir.DeleteDirectory()); }); Target BuildChocolateyPackage => _ => _ @@ -229,23 +231,23 @@ protected override void OnBuildInitialized() .DependsOn(Compile, Test) .Executes(() => { - CopyDirectoryRecursively(OutputDirectory, PackageDirectory, DirectoryExistsPolicy.Merge); - PackageDirectory.GlobFiles(ExcludeFileGlob).ForEach(DeleteFile); + OutputDirectory.Copy(PackageDirectory, ExistsPolicy.MergeAndOverwriteIfNewer); + PackageDirectory.GlobFiles(ExcludeFileGlob).ForEach(file => file.DeleteFile()); - PackageDirectory.GlobDirectories(ExcludeDirectoryGlob).ForEach(DeleteDirectory); + PackageDirectory.GlobDirectories(ExcludeDirectoryGlob).ForEach(dir => dir.DeleteDirectory()); - Compress(PackageDirectory, BinDirectory / $"LogExpert.{VersionString}.zip"); + CompressionExtensions.ZipTo(PackageDirectory, BinDirectory / $"LogExpert.{VersionString}.zip"); }); Target ChangeVersionNumber => _ => _ .Before(Compile) .Executes(() => { - Logger.Info($"AssemblyVersion {VersionString}\r\nAssemblyFileVersion {VersionFileString}\r\nAssemblyInformationalVersion {VersionInformationString}"); + Log.Information($"AssemblyVersion {VersionString}\r\nAssemblyFileVersion {VersionFileString}\r\nAssemblyInformationalVersion {VersionInformationString}"); AbsolutePath assemblyVersion = SourceDirectory / "Solution Items" / "AssemblyVersion.cs"; - string text = ReadAllText(assemblyVersion); + string text = assemblyVersion.ReadAllText(); Regex configurationRegex = new Regex(@"(\[assembly: AssemblyConfiguration\()(""[^""]*"")(\)\])"); Regex assemblyVersionRegex = new Regex(@"(\[assembly: AssemblyVersion\("")([^""]*)(""\)\])"); Regex assemblyFileVersionRegex = new Regex(@"(\[assembly: AssemblyFileVersion\("")([^""]*)(""\)\])"); @@ -256,11 +258,11 @@ protected override void OnBuildInitialized() text = assemblyFileVersionRegex.Replace(text, (match) => ReplaceVersionMatch(match, VersionFileString)); text = assemblyInformationalVersionRegex.Replace(text, (match) => ReplaceVersionMatch(match, VersionInformationString)); - Logger.Trace("Content of AssemblyVersion file"); - Logger.Trace(text); - Logger.Trace("End of Content"); + Log.Verbose("Content of AssemblyVersion file"); + Log.Verbose(text); + Log.Verbose("End of Content"); - WriteAllText(assemblyVersion, text); + assemblyVersion.WriteAllText(text); SourceDirectory.GlobFiles("**sftp-plugin/*.cs").ForEach(file => { @@ -269,14 +271,14 @@ protected override void OnBuildInitialized() return; } - string fileText = ReadAllText(file); + string fileText = file.ReadAllText(); Regex reg = new Regex(@"\w\w{2}[_]p?[tso]?[erzliasx]+[_rhe]{5}", RegexOptions.IgnoreCase); if (reg.IsMatch(fileText)) { fileText = reg.Replace(fileText, MyVariable); - WriteAllText(file, fileText); + file.WriteAllText(fileText); } }); }); @@ -285,13 +287,24 @@ protected override void OnBuildInitialized() .DependsOn(Compile, Test) .Executes(() => { - string[] files = new[] {"SftpFileSystem.dll", "Renci.SshNet.dll" }; + string[] files = ["SftpFileSystem.dll", "Renci.SshNet.dll"]; + + OutputDirectory.GlobFiles(files.Select(a => $"plugins/{a}").ToArray()).ForEach(file => file.CopyToDirectory(SftpFileSystemPackagex64, ExistsPolicy.FileOverwrite)); + OutputDirectory.GlobFiles(files.Select(a => $"pluginsx86/{a}").ToArray()).ForEach(file => file.CopyToDirectory(SftpFileSystemPackagex86, ExistsPolicy.FileOverwrite)); - OutputDirectory.GlobFiles(files.Select(a => $"plugins/{a}").ToArray()).ForEach(file => CopyFileToDirectory(file, SftpFileSystemPackagex64, FileExistsPolicy.Overwrite)); - OutputDirectory.GlobFiles(files.Select(a => $"pluginsx86/{a}").ToArray()).ForEach(file => CopyFileToDirectory(file, SftpFileSystemPackagex86, FileExistsPolicy.Overwrite)); + CompressionExtensions.ZipTo(SftpFileSystemPackagex64, BinDirectory / $"SftpFileSystem.x64.{VersionString}.zip"); + CompressionExtensions.ZipTo(SftpFileSystemPackagex86, BinDirectory / $"SftpFileSystem.x86.{VersionString}.zip"); + }); - Compress(SftpFileSystemPackagex64, BinDirectory / $"SftpFileSystem.x64.{VersionString}.zip"); - Compress(SftpFileSystemPackagex86, BinDirectory / $"SftpFileSystem.x86.{VersionString}.zip"); + Target ColumnizerLibCreate => _ => _.DependsOn(Compile, Test) + .Executes(() => + { + var columnizerFolder = SourceDirectory / "ColumnizerLib"; + DotNetPack(s => s + .SetProject(columnizerFolder / "ColumnizerLib.csproj") + .SetConfiguration(Configuration) + .SetOutputDirectory(BinDirectory) + .SetVersion(VersionString)); }); Target ColumnizerLibCreateNuget => _ => _ @@ -303,7 +316,7 @@ protected override void OnBuildInitialized() NuGetTasks.NuGetPack(s => { s = s.SetTargetPath(columnizerFolder / "ColumnizerLib.csproj") - .DisableBuild() + .EnableBuild() .SetConfiguration(Configuration) .SetProperty("version", VersionString) .SetOutputDirectory(BinDirectory); @@ -313,17 +326,18 @@ protected override void OnBuildInitialized() }); Target Pack => _ => _ - .DependsOn(BuildChocolateyPackage, CreatePackage, PackageSftpFileSystem, ColumnizerLibCreateNuget); + .DependsOn(BuildChocolateyPackage, CreatePackage, PackageSftpFileSystem, ColumnizerLibCreate); + //.DependsOn(BuildChocolateyPackage, CreatePackage, PackageSftpFileSystem, ColumnizerLibCreateNuget); Target CopyFilesForSetup => _ => _ .DependsOn(Compile) .After(Test) .Executes(() => { - CopyDirectoryRecursively(OutputDirectory, SetupDirectory, DirectoryExistsPolicy.Merge); - SetupDirectory.GlobFiles(ExcludeFileGlob).ForEach(DeleteFile); + OutputDirectory.Copy(SetupDirectory, ExistsPolicy.DirectoryMerge); + SetupDirectory.GlobFiles(ExcludeFileGlob).ForEach(file => file.DeleteFile()); - SetupDirectory.GlobDirectories(ExcludeDirectoryGlob).ForEach(DeleteDirectory); + SetupDirectory.GlobDirectories(ExcludeDirectoryGlob).ForEach(dir => dir.DeleteDirectory()); }); Target CreateSetup => _ => _ @@ -333,13 +347,13 @@ protected override void OnBuildInitialized() .Executes(() => { var publishCombinations = - from framework in new[] {(AbsolutePath) SpecialFolder(SpecialFolders.ProgramFilesX86), (AbsolutePath) SpecialFolder(SpecialFolders.LocalApplicationData) / "Programs"} - from version in new[] {"5", "6"} + from framework in new[] { SpecialFolder(SpecialFolders.ProgramFilesX86), SpecialFolder(SpecialFolders.LocalApplicationData) / "Programs" } + from version in new[] { "5", "6" } select framework / $"Inno Setup {version}" / "iscc.exe"; bool executed = false; foreach (var setupCombinations in publishCombinations) { - if (!FileExists(setupCombinations)) + if (!setupCombinations.FileExists()) { //Search for next combination continue; @@ -352,19 +366,20 @@ protected override void OnBuildInitialized() if (!executed) { - Fail("Inno setup was not found"); + Assert.True(true, "Inno setup was not found"); } }); Target PublishColumnizerNuget => _ => _ - .DependsOn(ColumnizerLibCreateNuget) + .DependsOn(ColumnizerLibCreate) + //.DependsOn(ColumnizerLibCreateNuget) .Requires(() => NugetApiKey) //.OnlyWhenDynamic(() => GitVersion.BranchName.Equals("master") || GitVersion.BranchName.Equals("origin/master")) .Executes(() => { BinDirectory.GlobFiles("**/LogExpert.ColumnizerLib.*.nupkg").ForEach(file => { - Logger.Normal($"Publish nuget {file}"); + Log.Debug($"Publish nuget {file}"); NuGetTasks.NuGetPush(s => { @@ -385,7 +400,7 @@ protected override void OnBuildInitialized() { ChocolateyDirectory.GlobFiles("**/*.nupkg").ForEach(file => { - Logger.Normal($"Publish chocolatey package {file}"); + Log.Debug($"Publish chocolatey package {file}"); Chocolatey($"push {file} --key {ChocolateyApiKey} --source https://push.chocolatey.org/", WorkingDirectory = ChocolateyDirectory); }); @@ -425,7 +440,7 @@ protected override void OnBuildInitialized() .OnlyWhenDynamic(() => AppVeyor.Instance != null) .Executes(() => { - CompressZip(BinDirectory / Configuration, BinDirectory / $"LogExpert-CI-{VersionString}.zip"); + CompressionExtensions.ZipTo(BinDirectory / Configuration, BinDirectory / $"LogExpert-CI-{VersionString}.zip"); AppveyorArtifacts.ForEach((artifact) => { @@ -433,14 +448,14 @@ protected override void OnBuildInitialized() proc.StartInfo = new ProcessStartInfo("appveyor", $"PushArtifact \"{artifact}\""); if (!proc.Start()) { - Fail("Failed to start appveyor pushartifact"); + Assert.True(true, "Failed to start appveyor pushartifact"); } proc.WaitForExit(); if (proc.ExitCode != 0) { - Fail($"Exit code is {proc.ExitCode}"); + Assert.True(true, $"Exit code is {proc.ExitCode}"); } }); }); @@ -448,42 +463,42 @@ protected override void OnBuildInitialized() Target CleanupAppDataLogExpert => _ => _ .Executes(() => { - AbsolutePath logExpertApplicationData = ((AbsolutePath) SpecialFolder(SpecialFolders.ApplicationData)) / "LogExpert"; + AbsolutePath logExpertApplicationData = SpecialFolder(SpecialFolders.ApplicationData) / "LogExpert"; DirectoryInfo info = new DirectoryInfo(logExpertApplicationData); info.GetDirectories().ForEach(a => a.Delete(true)); - DeleteDirectory(logExpertApplicationData); + logExpertApplicationData.DeleteDirectory(); }); Target CleanupDocumentsLogExpert => _ => _ .Executes(() => { - AbsolutePath logExpertDocuments = (AbsolutePath) SpecialFolder(SpecialFolders.UserProfile) / "Documents" / "LogExpert"; + AbsolutePath logExpertDocuments = SpecialFolder(SpecialFolders.UserProfile) / "Documents" / "LogExpert"; DirectoryInfo info = new DirectoryInfo(logExpertDocuments); info.GetDirectories().ForEach(a => a.Delete(true)); - DeleteDirectory(logExpertDocuments); + logExpertDocuments.DeleteDirectory(); }); private void ExecuteInnoSetup(AbsolutePath innoPath) { Process proc = new Process(); - Logger.Info($"Start '{innoPath}' {SetupCommandLineParameter} \"{InnoSetupScript}\""); + Log.Information($"Start '{innoPath}' {SetupCommandLineParameter} \"{InnoSetupScript}\""); proc.StartInfo = new ProcessStartInfo(innoPath, $"{SetupCommandLineParameter} \"{InnoSetupScript}\""); if (!proc.Start()) { - Fail($"Failed to start {innoPath} with \"{SetupCommandLineParameter}\" \"{InnoSetupScript}\""); + Assert.True(true, $"Failed to start {innoPath} with \"{SetupCommandLineParameter}\" \"{InnoSetupScript}\""); } proc.WaitForExit(); - Logger.Info($"Executed '{innoPath}' with exit code {proc.ExitCode}"); + Log.Information($"Executed '{innoPath}' with exit code {proc.ExitCode}"); if (proc.ExitCode != 0) { - Fail($"Error during execution of {innoPath}, exitcode {proc.ExitCode}"); + Nuke.Common.Assert.True(true, $"Error during execution of {innoPath}, exitcode {proc.ExitCode}"); } } @@ -494,13 +509,14 @@ private string ReplaceVersionMatch(Match match, string replacement) private void TransformTemplateFile(AbsolutePath path, bool deleteTemplate) { - string text = ReadAllText(path); + string text = path.ReadAllText(); text = text.Replace("##version##", VersionString); - WriteAllText($"{Regex.Replace(path, "\\.template$", "")}", text); + AbsolutePath template = $"{Regex.Replace(path, "\\.template$", "")}"; + template.WriteAllText(text); if (deleteTemplate) { - DeleteFile(path); + path.DeleteFile(); } } } \ No newline at end of file diff --git a/build/_build.csproj b/build/_build.csproj index 5d02c51d..121a3b6b 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -1,51 +1,37 @@  - Exe net8.0 - false False CS0649;CS0169 + 1 - - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers - - - + + + - - - - - - - - - - - - - - - - + + + + \ No newline at end of file diff --git a/global.json b/global.json new file mode 100644 index 00000000..b6b5c9f5 --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "9.0.101" + } +} diff --git a/src/AutoColumnizer/AutoColumnizer.csproj b/src/AutoColumnizer/AutoColumnizer.csproj index ef385fe6..b0fe0c63 100644 --- a/src/AutoColumnizer/AutoColumnizer.csproj +++ b/src/AutoColumnizer/AutoColumnizer.csproj @@ -3,35 +3,33 @@ net8.0-windows Library false - - - ..\..\bin\Debug\plugins\ - - - ..\..\bin\Release\plugins\ - - + AutoColumnizer true - - ..\Solution Items\Key.snk - AutoColumnizer + false + $(SolutionDir)..\bin\$(Configuration)\plugins + + + False + + True + + Properties\AssemblyVersion.cs + Key.snk - - - - + + \ No newline at end of file diff --git a/src/ColumnizerLib.UnitTests/ColumnTests.cs b/src/ColumnizerLib.UnitTests/ColumnTests.cs index 1314286d..e61e57c5 100644 --- a/src/ColumnizerLib.UnitTests/ColumnTests.cs +++ b/src/ColumnizerLib.UnitTests/ColumnTests.cs @@ -1,8 +1,7 @@ -using System; -using System.Text; -using LogExpert; +using LogExpert; using NUnit.Framework; -using NUnit.Framework.Legacy; +using System; +using System.Text; namespace ColumnizerLib.UnitTests { @@ -26,8 +25,8 @@ public void Column_LineCutOf() column.FullValue = builder.ToString(); - ClassicAssert.AreEqual(expected, column.DisplayValue); - ClassicAssert.AreEqual(builder.ToString(), column.FullValue); + Assert.That(column.DisplayValue, Is.EqualTo(expected)); + Assert.That(column.FullValue, Is.EqualTo(builder.ToString())); } [Test] @@ -46,8 +45,8 @@ public void Column_NoLineCutOf() column.FullValue = expected; - ClassicAssert.AreEqual(expected, column.DisplayValue); - ClassicAssert.AreEqual(expected, column.FullValue); + Assert.That(column.DisplayValue, Is.EqualTo(expected)); + Assert.That(column.FullValue, Is.EqualTo(expected)); } [Test] @@ -62,14 +61,14 @@ public void Column_NullCharReplacement() //only one implementation depending on the windows version is executed if (Environment.Version >= Version.Parse("6.2")) { - ClassicAssert.AreEqual("asdf␀", column.DisplayValue); + Assert.That(column.DisplayValue, Is.EqualTo("asdf␀")); } else { - ClassicAssert.AreEqual("asdf ", column.DisplayValue); + Assert.That(column.DisplayValue, Is.EqualTo("asdf ")); } - ClassicAssert.AreEqual("asdf\0", column.FullValue); + Assert.That(column.FullValue, Is.EqualTo("asdf\0")); } [Test] @@ -79,8 +78,8 @@ public void Column_TabReplacement() column.FullValue = "asdf\t"; - ClassicAssert.AreEqual("asdf ", column.DisplayValue); - ClassicAssert.AreEqual("asdf\t", column.FullValue); + Assert.That(column.DisplayValue, Is.EqualTo("asdf ")); + Assert.That(column.FullValue, Is.EqualTo("asdf\t")); } } } \ No newline at end of file diff --git a/src/ColumnizerLib.UnitTests/ColumnizerLib.UnitTests.csproj b/src/ColumnizerLib.UnitTests/ColumnizerLib.UnitTests.csproj index c9664e3b..6a5ebd72 100644 --- a/src/ColumnizerLib.UnitTests/ColumnizerLib.UnitTests.csproj +++ b/src/ColumnizerLib.UnitTests/ColumnizerLib.UnitTests.csproj @@ -10,21 +10,15 @@ Copyright © Microsoft 2018 1.0.0.0 1.0.0.0 + false + bin\$(Configuration) - - - - - - 4.0.1 - - - 4.5.0 - - + + + \ No newline at end of file diff --git a/src/ColumnizerLib.UnitTests/Extensions/LogLineExtensionsTests.cs b/src/ColumnizerLib.UnitTests/Extensions/LogLineExtensionsTests.cs index 4cd3b476..a412642c 100644 --- a/src/ColumnizerLib.UnitTests/Extensions/LogLineExtensionsTests.cs +++ b/src/ColumnizerLib.UnitTests/Extensions/LogLineExtensionsTests.cs @@ -1,6 +1,5 @@ using LogExpert; using NUnit.Framework; -using NUnit.Framework.Legacy; namespace ColumnizerLib.UnitTests.Extensions { @@ -26,7 +25,7 @@ public void ToClipBoardText_ReturnsExpected() LineNumber = 89, Text = "a text" }; - ClassicAssert.AreEqual("\t90\ta fullLine", underTest.ToClipBoardText()); + Assert.That(underTest.ToClipBoardText(), Is.EqualTo("\t90\ta fullLine")); } } } diff --git a/src/ColumnizerLib/ColumnizerLib.csproj b/src/ColumnizerLib/ColumnizerLib.csproj index 1b4ef1fd..ef98bb3a 100644 --- a/src/ColumnizerLib/ColumnizerLib.csproj +++ b/src/ColumnizerLib/ColumnizerLib.csproj @@ -1,18 +1,21 @@  - netcoreapp3.1 + net8.0-windows Library LogExpert false true true + $(SolutionDir)..\bin\Docs\ColumnizerLib.xml + false + $(SolutionDir)..\bin\$(Configuration) + CS1591; - - ..\..\bin\Debug\ - ..\..\bin\Debug\ColumnizerLib.XML + + False - - ..\..\bin\Release\ + + True true diff --git a/src/CsvColumnizer/CsvColumnizer.cs b/src/CsvColumnizer/CsvColumnizer.cs index f2664317..1b06162b 100644 --- a/src/CsvColumnizer/CsvColumnizer.cs +++ b/src/CsvColumnizer/CsvColumnizer.cs @@ -1,12 +1,12 @@ -using System; -using System.Collections.Generic; +using CsvHelper; using LogExpert; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; using System.Windows.Forms; -using CsvHelper; -using Newtonsoft.Json; namespace CsvColumnizer { @@ -212,10 +212,9 @@ public void Configure(ILogLineColumnizerCallback callback, string configDir) public void LoadConfig(string configDir) { - string configPath = configDir + "\\" + _configFileName; - FileSystemInfo fileInfo = new FileInfo(configPath); + string configPath = Path.Combine(configDir, _configFileName); - if (fileInfo.Exists == false) + if (!File.Exists(configPath)) { _config = new CsvColumnizerConfig(); _config.InitDefaults(); @@ -224,7 +223,7 @@ public void LoadConfig(string configDir) { try { - _config = JsonConvert.DeserializeObject(File.ReadAllText($"{fileInfo.FullName}")); + _config = JsonConvert.DeserializeObject(File.ReadAllText(configPath)); _config.ConfigureReaderConfiguration(); } catch (Exception e) diff --git a/src/CsvColumnizer/CsvColumnizer.csproj b/src/CsvColumnizer/CsvColumnizer.csproj index ebd255c0..14cc9985 100644 --- a/src/CsvColumnizer/CsvColumnizer.csproj +++ b/src/CsvColumnizer/CsvColumnizer.csproj @@ -5,12 +5,16 @@ false true true + false + $(SolutionDir)..\bin\$(Configuration)\plugins + true + CA1416; - - ..\..\bin\Debug\plugins\ + + False - - ..\..\bin\Release\plugins\ + + True true @@ -32,10 +36,8 @@ - - 31.0.0 - - + + CsvColumnizer diff --git a/src/DefaultPlugins/DefaultPlugins.csproj b/src/DefaultPlugins/DefaultPlugins.csproj index c86b76ba..49d16e19 100644 --- a/src/DefaultPlugins/DefaultPlugins.csproj +++ b/src/DefaultPlugins/DefaultPlugins.csproj @@ -6,12 +6,15 @@ false true true + false + $(SolutionDir)..\bin\$(Configuration)\plugins + CA1416; - - ..\..\bin\Debug\plugins\ + + False - - ..\..\bin\Release\plugins\ + + True true @@ -33,7 +36,6 @@ - + - \ No newline at end of file diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 00000000..11a29ac4 --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,10 @@ + + + 8.2.0 + 2.0.0.0 + 2.0.0.0 + 2.0.0.0-rc1 + Hirogen, zarunbal, RandallFlagg, TheNicker + Log Expert + + \ No newline at end of file diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props new file mode 100644 index 00000000..2ad39c43 --- /dev/null +++ b/src/Directory.Packages.props @@ -0,0 +1,31 @@ + + + true + true + $(NoWarn);NU1507 + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/FlashIconHighlighter/FlashIconHighlighter.csproj b/src/FlashIconHighlighter/FlashIconHighlighter.csproj index 908588c4..82ce3396 100644 --- a/src/FlashIconHighlighter/FlashIconHighlighter.csproj +++ b/src/FlashIconHighlighter/FlashIconHighlighter.csproj @@ -5,12 +5,15 @@ false true true + false + $(SolutionDir)..\bin\$(Configuration)\plugins + CA1416; - - ..\..\bin\Debug\plugins\ + + False - - ..\..\bin\Release\plugins\ + + True true diff --git a/src/GlassfishColumnizer/GlassfishColumnizer.csproj b/src/GlassfishColumnizer/GlassfishColumnizer.csproj index 4cb94d81..886688ac 100644 --- a/src/GlassfishColumnizer/GlassfishColumnizer.csproj +++ b/src/GlassfishColumnizer/GlassfishColumnizer.csproj @@ -3,12 +3,14 @@ net8.0-windows Library false + false + $(SolutionDir)..\bin\$(Configuration)\plugins - - ..\..\bin\Debug\plugins\ + + False - - ..\..\bin\Release\plugins\ + + True true diff --git a/src/JsonColumnizer/JsonColumnizer.csproj b/src/JsonColumnizer/JsonColumnizer.csproj index ce08aaa2..87c0c21e 100644 --- a/src/JsonColumnizer/JsonColumnizer.csproj +++ b/src/JsonColumnizer/JsonColumnizer.csproj @@ -5,12 +5,14 @@ false true true + false + $(SolutionDir)..\bin\$(Configuration)\plugins - - ..\..\bin\Debug\plugins\ + + False - - ..\..\bin\Release\plugins\ + + True true @@ -35,6 +37,6 @@ JsonColumnizer - + \ No newline at end of file diff --git a/src/JsonCompactColumnizer/JsonCompactColumnizer.csproj b/src/JsonCompactColumnizer/JsonCompactColumnizer.csproj index 090b1588..f2827595 100644 --- a/src/JsonCompactColumnizer/JsonCompactColumnizer.csproj +++ b/src/JsonCompactColumnizer/JsonCompactColumnizer.csproj @@ -6,12 +6,14 @@ false true true + false + $(SolutionDir)..\bin\$(Configuration)\plugins - - ..\..\bin\Debug\plugins\ + + False - - ..\..\bin\Release\plugins\ + + True true @@ -37,6 +39,6 @@ JsonCompactColumnizer - + \ No newline at end of file diff --git a/src/Log4jXmlColumnizer/Log4jXmlColumnizer.csproj b/src/Log4jXmlColumnizer/Log4jXmlColumnizer.csproj index b4ced092..fdfcdb54 100644 --- a/src/Log4jXmlColumnizer/Log4jXmlColumnizer.csproj +++ b/src/Log4jXmlColumnizer/Log4jXmlColumnizer.csproj @@ -5,12 +5,15 @@ false true true + false + $(SolutionDir)..\bin\$(Configuration)\plugins + CA1416; - - ..\..\bin\Debug\plugins\ + + False - - ..\..\bin\Release\plugins\ + + True true @@ -35,7 +38,6 @@ - + - \ No newline at end of file diff --git a/src/LogExpert.Tests/BufferShiftTest.cs b/src/LogExpert.Tests/BufferShiftTest.cs index 212bd93c..e5bb7275 100644 --- a/src/LogExpert.Tests/BufferShiftTest.cs +++ b/src/LogExpert.Tests/BufferShiftTest.cs @@ -1,9 +1,8 @@ -using System.Collections.Generic; -using System.Text; -using LogExpert.Classes.Log; +using LogExpert.Classes.Log; using LogExpert.Entities; using NUnit.Framework; -using NUnit.Framework.Legacy; +using System.Collections.Generic; +using System.Text; namespace LogExpert.Tests { @@ -37,13 +36,14 @@ public void TestShiftBuffers1() reader.ReadFiles(); IList lil = reader.GetLogFileInfoList(); - ClassicAssert.AreEqual(files.Count, lil.Count); + Assert.That(lil.Count, Is.EqualTo(files.Count)); + LinkedList.Enumerator enumerator = files.GetEnumerator(); enumerator.MoveNext(); foreach (LogFileInfo li in lil) { string fileName = enumerator.Current; - ClassicAssert.AreEqual(fileName, li.FullName); + Assert.That(li.FullName, Is.EqualTo(fileName)); enumerator.MoveNext(); } int oldCount = lil.Count; @@ -57,19 +57,19 @@ public void TestShiftBuffers1() reader.ShiftBuffers(); lil = reader.GetLogFileInfoList(); - ClassicAssert.AreEqual(oldCount + 1, lil.Count); + Assert.That(lil.Count, Is.EqualTo(oldCount + 1)); - ClassicAssert.AreEqual(linesPerFile * lil.Count, reader.LineCount); + Assert.That(reader.LineCount, Is.EqualTo(linesPerFile * lil.Count)); // Check if rollover'd file names have been handled by LogfileReader // - ClassicAssert.AreEqual(files.Count, lil.Count); + Assert.That(lil.Count, Is.EqualTo(files.Count)); enumerator = files.GetEnumerator(); enumerator.MoveNext(); foreach (LogFileInfo li in lil) { string fileName = enumerator.Current; - ClassicAssert.AreEqual(fileName, li.FullName); + Assert.That(li.FullName, Is.EqualTo(fileName)); enumerator.MoveNext(); } @@ -82,8 +82,8 @@ public void TestShiftBuffers1() int startLine = 0; foreach (LogBuffer logBuffer in logBuffers) { - ClassicAssert.AreEqual(logBuffer.FileInfo.FullName, enumerator.Current); - ClassicAssert.AreEqual(startLine, logBuffer.StartLine); + Assert.That(enumerator.Current, Is.EqualTo(logBuffer.FileInfo.FullName)); + Assert.That(logBuffer.StartLine, Is.EqualTo(startLine)); startLine += 10; enumerator.MoveNext(); } @@ -99,7 +99,7 @@ public void TestShiftBuffers1() { LogBuffer logBuffer = logBuffers[i]; ILogLine line = logBuffer.GetLineOfBlock(0); - ClassicAssert.IsTrue(line.FullLine.Contains(enumerator.Current)); + Assert.That(line.FullLine.Contains(enumerator.Current)); enumerator.MoveNext(); } enumerator.MoveNext(); @@ -108,7 +108,7 @@ public void TestShiftBuffers1() { LogBuffer logBuffer = logBuffers[i]; ILogLine line = logBuffer.GetLineOfBlock(0); - ClassicAssert.IsTrue(line.FullLine.Contains(enumerator.Current)); + Assert.That(line.FullLine.Contains(enumerator.Current)); } oldCount = lil.Count; @@ -122,16 +122,16 @@ public void TestShiftBuffers1() reader.ShiftBuffers(); lil = reader.GetLogFileInfoList(); - ClassicAssert.AreEqual(oldCount, lil.Count); // same count because oldest file is deleted - ClassicAssert.AreEqual(files.Count, lil.Count); - ClassicAssert.AreEqual(linesPerFile * lil.Count, reader.LineCount); + Assert.That(lil.Count, Is.EqualTo(oldCount)); // same count because oldest file is deleted + Assert.That(lil.Count, Is.EqualTo(files.Count)); + Assert.That(reader.LineCount, Is.EqualTo(linesPerFile * lil.Count)); // Check first line to see if buffers are correct // ILogLine firstLine = reader.GetLogLine(0); string[] names = new string[files.Count]; files.CopyTo(names, 0); - ClassicAssert.IsTrue(firstLine.FullLine.Contains(names[2])); + Assert.That(firstLine.FullLine.Contains(names[2])); } } } \ No newline at end of file diff --git a/src/LogExpert.Tests/CSVColumnizerTest.cs b/src/LogExpert.Tests/CSVColumnizerTest.cs index 2e9dee75..9d759bd9 100644 --- a/src/LogExpert.Tests/CSVColumnizerTest.cs +++ b/src/LogExpert.Tests/CSVColumnizerTest.cs @@ -1,10 +1,8 @@ -using System; -using System.IO; -using LogExpert.Classes.Log; +using LogExpert.Classes.Log; using LogExpert.Entities; - using NUnit.Framework; -using NUnit.Framework.Legacy; +using System; +using System.IO; namespace LogExpert.Tests { @@ -20,16 +18,14 @@ public void Instantiat_CSVFile_BuildCorrectColumnizer(string filename, string[] string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, filename); LogfileReader reader = new LogfileReader(path, new EncodingOptions(), true, 40, 50, new MultiFileOptions()); reader.ReadFiles(); - - ILogLine line = reader.GetLogLineWithWait(0); + ILogLine line = reader.GetLogLine(0); IColumnizedLogLine logline = new ColumnizedLogLine(); if (line != null) { logline = csvColumnizer.SplitLine(null, line); } - string expectedResult = string.Join(",", expectedHeaders); - ClassicAssert.AreEqual(expectedResult, logline.LogLine.FullLine); + Assert.That(logline.LogLine.FullLine, Is.EqualTo(expectedResult)); } } } diff --git a/src/LogExpert.Tests/ColumnizerPickerTest.cs b/src/LogExpert.Tests/ColumnizerPickerTest.cs index 6951dcd5..f04e8ff3 100644 --- a/src/LogExpert.Tests/ColumnizerPickerTest.cs +++ b/src/LogExpert.Tests/ColumnizerPickerTest.cs @@ -1,13 +1,12 @@ using JsonColumnizer; +using LogExpert.Classes; using LogExpert.Classes.Columnizer; +using LogExpert.Classes.Log; +using LogExpert.Entities; using Moq; using NUnit.Framework; using System; using System.IO; -using LogExpert.Classes; -using LogExpert.Classes.Log; -using LogExpert.Entities; -using NUnit.Framework.Legacy; namespace LogExpert.Tests { @@ -58,7 +57,7 @@ public void FindColumnizer_ReturnCorrectColumnizer(string expectedColumnizerName var result = ColumnizerPicker.FindColumnizer(path, autoLogLineColumnizerCallbackMock.Object); - ClassicAssert.AreEqual(expectedColumnizerName, result.GetName()); + Assert.That(result.GetName(), Is.EqualTo(expectedColumnizerName)); } @@ -78,7 +77,7 @@ public void FindReplacementForAutoColumnizer_ValidTextFile_ReturnCorrectColumniz PluginRegistry.GetInstance().RegisteredColumnizers.Add(new JsonCompactColumnizer()); var result = ColumnizerPicker.FindReplacementForAutoColumnizer(fileName, reader, autoColumnizer.Object); - ClassicAssert.AreEqual(result.GetType(), columnizerType); + Assert.That(columnizerType, Is.EqualTo(result.GetType())); } [TestCase(@".\TestData\FileNotExists.txt", typeof(DefaultLogfileColumnizer))] @@ -92,7 +91,7 @@ public void DecideColumnizerByName_WhenReaderIsNotReady_ReturnCorrectColumnizer( var result = ColumnizerPicker.DecideColumnizerByName(fileName, PluginRegistry.GetInstance().RegisteredColumnizers); - ClassicAssert.AreEqual(result.GetType(), columnizerType); + Assert.That(columnizerType, Is.EqualTo(result.GetType())); } [TestCase(@"Invalid Name", typeof(DefaultLogfileColumnizer))] @@ -108,7 +107,7 @@ public void DecideColumnizerByName_ValidTextFile_ReturnCorrectColumnizer( var result = ColumnizerPicker.DecideColumnizerByName(columnizerName, PluginRegistry.GetInstance().RegisteredColumnizers); - ClassicAssert.AreEqual(result.GetType(), columnizerType); + Assert.That(columnizerType, Is.EqualTo(result.GetType())); } private class TestLogLine : ILogLine diff --git a/src/LogExpert.Tests/DateFormatParserTest.cs b/src/LogExpert.Tests/DateFormatParserTest.cs index 4825dbef..e04c3633 100644 --- a/src/LogExpert.Tests/DateFormatParserTest.cs +++ b/src/LogExpert.Tests/DateFormatParserTest.cs @@ -1,9 +1,10 @@ -using NUnit.Framework; +using LogExpert.Classes.DateTimeParser; +using NUnit.Framework; using System; +using System.Collections.Generic; using System.Globalization; using System.Linq; -using LogExpert.Classes.DateTimeParser; -using NUnit.Framework.Legacy; +using System.Text; namespace LogExpert.Tests { @@ -15,27 +16,36 @@ public void CanParseAllCultures() { var cultures = CultureInfo.GetCultures(CultureTypes.AllCultures); + // HashSet exclude = ["dz", "ckb-IR", "ar-SA", "lrc" , "lrc-IR", "mzn" , "mzn-IR", "ps"]; + foreach (var culture in cultures) { - if (culture.Name == "dz" || culture.Name.StartsWith("dz-")) + if (culture.Name == "dz" || culture.Name == "ar" || culture.Name.StartsWith("ar-") || culture.Name.StartsWith("dz-")) { - Console.WriteLine("The dz (Dzongkha) time format is not supported yet."); + Console.WriteLine($"The ${culture.Name} (${culture.DisplayName}) time format is not supported yet."); continue; } var datePattern = GetDateAndTimeFormat(culture); + + if (datePattern.StartsWith('g')) + { + Console.WriteLine("time format that starts with g is not supported yet."); + continue; + } + var message = $"Culture: {culture.Name} ({culture.EnglishName} {datePattern})"; var sections = Parser.ParseSections(datePattern, out bool syntaxError); - ClassicAssert.IsFalse(syntaxError, message); + Assert.That(syntaxError, Is.False, message); var dateSection = sections.FirstOrDefault(); - ClassicAssert.IsNotNull(dateSection, message); + Assert.That(dateSection, Is.Not.Null, message); var now = DateTime.Now; var expectedFormattedDate = now.ToString(datePattern); var actualFormattedDate = now.ToString(string.Join("", dateSection.GeneralTextDateDurationParts)); - ClassicAssert.AreEqual(expectedFormattedDate, actualFormattedDate, message); + Assert.That(actualFormattedDate, Is.EqualTo(expectedFormattedDate), message); } } @@ -43,7 +53,7 @@ public void CanParseAllCultures() [TestCase("en-US", "MM", "dd", "yyyy", "hh", "mm", "ss", "tt")] [TestCase("fr-FR", "dd", "MM", "yyyy", "HH", "mm", "ss")] [TestCase("de-DE", "dd", "MM", "yyyy", "HH", "mm", "ss")] - [TestCase("ar-TN", "dd", "MM", "yyyy", "HH", "mm", "ss")] + [TestCase("ar-TN", "dd", "MM", "yyyy", "hh", "mm", "ss", "tt")] [TestCase("as", "dd", "MM", "yyyy", "tt", "hh", "mm", "ss")] [TestCase("bg", "dd", "MM", "yyyy", "HH", "mm", "ss")] public void TestDateFormatParserFromCulture(string cultureInfoName, params string[] expectedDateParts) @@ -56,10 +66,10 @@ public void TestDateFormatParserFromCulture(string cultureInfoName, params strin var message = $"Culture: {culture.EnglishName}, Actual date pattern: {datePattern}"; - ClassicAssert.IsFalse(syntaxError, message); + Assert.That(syntaxError, Is.False, message); var dateSection = sections.FirstOrDefault(); - ClassicAssert.IsNotNull(dateSection); + Assert.That(dateSection, Is.Not.Null); var dateParts = dateSection .GeneralTextDateDurationParts @@ -67,23 +77,50 @@ public void TestDateFormatParserFromCulture(string cultureInfoName, params strin .Select(p => DateFormatPartAdjuster.AdjustDateTimeFormatPart(p)) .ToArray(); - ClassicAssert.AreEqual(expectedDateParts.Length, dateParts.Length, message); + Assert.That(dateParts.Length, Is.EqualTo(expectedDateParts.Length), message); for (var i = 0; i < expectedDateParts.Length; i++) { var expected = expectedDateParts[i]; var actual = dateParts[i]; - ClassicAssert.AreEqual(expected, actual, message); + Assert.That(actual, Is.EqualTo(expected), message); + } + } + + static string RemoveCharacters(string input, string charsToRemove) + { + HashSet charsToRemoveSet = new HashSet(charsToRemove); + StringBuilder result = new StringBuilder(); + + foreach (char c in input) + { + if (!charsToRemoveSet.Contains(c)) + { + result.Append(c); + } } + + return result.ToString(); } private string GetDateAndTimeFormat(CultureInfo culture) { - return string.Concat( - culture.DateTimeFormat.ShortDatePattern, + + string InvisibleUNICODEmarkers = + "\u00AD\u034F\u061C\u115F\u1160\u17B4\u17B5" + + "\u180B\u180C\u180D\u180E\u200B\u200C\u200D\u200E\u200F" + + "\u202A\u202B\u202C\u202D\u202E\u202F\u205F\u2060\u2062" + + "\u2063\u2064\u2066\u2067\u2068\u2069\u2800\u3164\uFE00" + + "\uFE01\uFE02\uFE03\uFE04\uFE05\uFE06\uFE07\uFE08\uFE09" + + "\uFE0A\uFE0B\uFE0C\uFE0D\uFE0E\uFE0F"; + + + string dateTime = string.Concat(culture.DateTimeFormat.ShortDatePattern.ToString(), " ", - culture.DateTimeFormat.LongTimePattern - ); + culture.DateTimeFormat.LongTimePattern.ToString()); + + return RemoveCharacters(dateTime, InvisibleUNICODEmarkers); + } } } \ No newline at end of file diff --git a/src/LogExpert.Tests/Extensions/EnumerableTests.cs b/src/LogExpert.Tests/Extensions/EnumerableTests.cs index 0f977b7d..f2986a06 100644 --- a/src/LogExpert.Tests/Extensions/EnumerableTests.cs +++ b/src/LogExpert.Tests/Extensions/EnumerableTests.cs @@ -1,8 +1,7 @@ -using System; -using System.Collections.Generic; -using LogExpert.Extensions; +using LogExpert.Extensions; using NUnit.Framework; -using NUnit.Framework.Legacy; +using System; +using System.Collections.Generic; namespace LogExpert.Tests.Extensions { @@ -14,7 +13,7 @@ public void Extensions_IsEmpty_NullArray() { object[] arrayObject = null; - ClassicAssert.IsTrue(arrayObject.IsEmpty()); + Assert.That(arrayObject.IsEmpty(), Is.True); } [Test] @@ -22,7 +21,7 @@ public void Extensions_IsEmpty_EmptyArray() { object[] arrayObject = Array.Empty(); - ClassicAssert.IsTrue(arrayObject.IsEmpty()); + Assert.That(arrayObject.IsEmpty(), Is.True); } [Test] @@ -30,7 +29,7 @@ public void Extensions_IsEmpty_FilledArray() { object[] arrayObject = {new object()}; - ClassicAssert.IsFalse(arrayObject.IsEmpty()); + Assert.That(!arrayObject.IsEmpty(), Is.True); } [Test] @@ -38,7 +37,7 @@ public void Extensions_IsEmpty_NullIEnumerable() { IEnumerable arrayObject = null; - ClassicAssert.IsTrue(arrayObject.IsEmpty()); + Assert.That(arrayObject.IsEmpty(), Is.True); } [Test] @@ -46,7 +45,7 @@ public void Extensions_IsEmpty_EmptyIEnumerable() { IEnumerable arrayObject = new List(); - ClassicAssert.IsTrue(arrayObject.IsEmpty()); + Assert.That(arrayObject.IsEmpty(), Is.True); } [Test] @@ -54,7 +53,7 @@ public void Extensions_IsEmpty_FilledIEnumerable() { IEnumerable arrayObject = new List(new []{new object()}); - ClassicAssert.IsFalse(arrayObject.IsEmpty()); + Assert.That(!arrayObject.IsEmpty(), Is.True); } } } \ No newline at end of file diff --git a/src/LogExpert.Tests/JSONSaveTest.cs b/src/LogExpert.Tests/JSONSaveTest.cs index 173412d6..e78be754 100644 --- a/src/LogExpert.Tests/JSONSaveTest.cs +++ b/src/LogExpert.Tests/JSONSaveTest.cs @@ -1,8 +1,7 @@ -using System.IO; -using LogExpert.Config; +using LogExpert.Config; using Newtonsoft.Json; using NUnit.Framework; -using NUnit.Framework.Legacy; +using System.IO; namespace LogExpert.Tests { @@ -20,16 +19,17 @@ public void SaveOptionsAsJSON() Settings settings = null; Assert.DoesNotThrow(CastSettings); - ClassicAssert.NotNull(settings); - ClassicAssert.True(settings.alwaysOnTop); + Assert.That(settings, Is.Not.Null); + Assert.That(settings.alwaysOnTop, Is.True); ConfigManager.Settings.alwaysOnTop = false; ConfigManager.Save(SettingsFlags.All); settings = null; Assert.DoesNotThrow(CastSettings); - ClassicAssert.NotNull(settings); - ClassicAssert.False(settings.alwaysOnTop); + + Assert.That(settings, !Is.Null); + Assert.That(settings.alwaysOnTop, Is.False); void CastSettings() diff --git a/src/LogExpert.Tests/JsonColumnizerTest.cs b/src/LogExpert.Tests/JsonColumnizerTest.cs index 58f4a826..33b2a43e 100644 --- a/src/LogExpert.Tests/JsonColumnizerTest.cs +++ b/src/LogExpert.Tests/JsonColumnizerTest.cs @@ -1,9 +1,8 @@ -using NUnit.Framework; +using LogExpert.Classes.Log; +using LogExpert.Entities; +using NUnit.Framework; using System; using System.IO; -using LogExpert.Classes.Log; -using LogExpert.Entities; -using NUnit.Framework.Legacy; namespace LogExpert.Tests { @@ -18,13 +17,13 @@ public void GetColumnNames_HappyFile_ColumnNameMatches(string fileName, string e LogfileReader reader = new LogfileReader(path, new EncodingOptions(), true, 40, 50, new MultiFileOptions()); reader.ReadFiles(); - ILogLine line = reader.GetLogLineWithWait(0); + ILogLine line = reader.GetLogLine(0); if (line != null) { jsonColumnizer.SplitLine(null, line); } - line = reader.GetLogLineWithWait(1); + line = reader.GetLogLine(1); if (line != null) { jsonColumnizer.SplitLine(null, line); @@ -32,7 +31,7 @@ public void GetColumnNames_HappyFile_ColumnNameMatches(string fileName, string e var columnHeaders = jsonColumnizer.GetColumnNames(); var result = string.Join(" ", columnHeaders); - ClassicAssert.AreEqual(result, expectedHeaders); + Assert.That(expectedHeaders, Is.EqualTo(result)); } } } diff --git a/src/LogExpert.Tests/JsonCompactColumnizerTest.cs b/src/LogExpert.Tests/JsonCompactColumnizerTest.cs index f4a7a6cc..70536b82 100644 --- a/src/LogExpert.Tests/JsonCompactColumnizerTest.cs +++ b/src/LogExpert.Tests/JsonCompactColumnizerTest.cs @@ -1,10 +1,9 @@ -using NUnit.Framework; +using LogExpert.Classes.Log; +using LogExpert.Entities; +using NUnit.Framework; using System; using System.Collections.Generic; using System.IO; -using LogExpert.Classes.Log; -using LogExpert.Entities; -using NUnit.Framework.Legacy; namespace LogExpert.Tests { @@ -37,7 +36,7 @@ public void GetPriority_HappyFile_PriorityMatches(string fileName, Priority prio }; var result = jsonCompactColumnizer.GetPriority(path, loglines); - ClassicAssert.AreEqual(result, priority); + Assert.That(result, Is.EqualTo(priority)); } } } diff --git a/src/LogExpert.Tests/LocalFileSystemTest.cs b/src/LogExpert.Tests/LocalFileSystemTest.cs index d9a58f5d..fd7fb42f 100644 --- a/src/LogExpert.Tests/LocalFileSystemTest.cs +++ b/src/LogExpert.Tests/LocalFileSystemTest.cs @@ -1,8 +1,7 @@ -using System; -using System.IO; -using LogExpert.Classes; +using LogExpert.Classes; using NUnit.Framework; -using NUnit.Framework.Legacy; +using System; +using System.IO; namespace LogExpert.Tests { @@ -26,10 +25,10 @@ public void Boot() public void TestUriHandle() { LocalFileSystem fs = new LocalFileSystem(); - ClassicAssert.True(fs.CanHandleUri("file:///c:/logfile.txt")); - ClassicAssert.True(fs.CanHandleUri("file:///c:\\logfile.txt")); - ClassicAssert.True(fs.CanHandleUri("c:/logfile.txt")); - ClassicAssert.True(fs.CanHandleUri("c:\\logfile.txt")); + Assert.That(fs.CanHandleUri("file:///c:/logfile.txt"), Is.True); + Assert.That(fs.CanHandleUri("file:///c:\\logfile.txt"), Is.True); + Assert.That(fs.CanHandleUri("c:/logfile.txt"), Is.True); + Assert.That(fs.CanHandleUri("c:\\logfile.txt"), Is.True); } [Test] @@ -40,13 +39,13 @@ public void TestUriToFileStream() LocalFileSystem fs = new LocalFileSystem(); ILogFileInfo info = fs.GetLogfileInfo(fullName); - ClassicAssert.True(info.Length > 0); - ClassicAssert.True(info.OriginalLength == info.Length); + Assert.That(info.Length > 0, Is.True); + Assert.That(info.OriginalLength == info.Length, Is.True); Stream stream = info.OpenStream(); - ClassicAssert.True(stream.CanSeek); + Assert.That(stream.CanSeek, Is.True); StreamReader reader = new StreamReader(stream); string line = reader.ReadLine(); - ClassicAssert.True(line.StartsWith("line number", StringComparison.InvariantCultureIgnoreCase)); + Assert.That(line.StartsWith("line number", StringComparison.InvariantCultureIgnoreCase), Is.True); reader.Close(); } } diff --git a/src/LogExpert.Tests/LogExpert.Tests.csproj b/src/LogExpert.Tests/LogExpert.Tests.csproj index 893daa96..2ab7bfe2 100644 --- a/src/LogExpert.Tests/LogExpert.Tests.csproj +++ b/src/LogExpert.Tests/LogExpert.Tests.csproj @@ -6,6 +6,9 @@ false true true + false + bin\$(Configuration) + true true @@ -19,15 +22,10 @@ 1.0.0.0 - - 4.20.70 - - - 4.0.1 - - - 4.5.0 - + + + + diff --git a/src/LogExpert.Tests/LogStreamReaderTest.cs b/src/LogExpert.Tests/LogStreamReaderTest.cs index b2e4f0dc..9bb51099 100644 --- a/src/LogExpert.Tests/LogStreamReaderTest.cs +++ b/src/LogExpert.Tests/LogStreamReaderTest.cs @@ -1,6 +1,5 @@ using LogExpert.Classes.Log; using NUnit.Framework; -using NUnit.Framework.Legacy; using System.IO; using System.Text; using LogExpert.Entities; @@ -32,11 +31,12 @@ public void ReadLinesWithSystemNewLine(string text, int expectedLines) lineCount += 1; - StringAssert.StartsWith($"Line {lineCount}", line, $"Invalid line: {line}"); + Assert.That(line.StartsWith($"Line {lineCount}"), $"Invalid line: {line}"); } - ClassicAssert.AreEqual(expectedLines, lineCount, $"Unexpected lines:\n{text}"); + Assert.That(expectedLines, Is.EqualTo(lineCount), $"Unexpected lines:\n{text}"); } + [Test] [TestCase("\n\n\n", 3)] [TestCase("\r\n\r\n\r\n", 3)] @@ -51,7 +51,7 @@ public void CountLinesWithSystemNewLine(string text, int expectedLines) lineCount += 1; } - ClassicAssert.AreEqual(expectedLines, lineCount, $"Unexpected lines:\n{text}"); + Assert.That(expectedLines, Is.EqualTo(lineCount), $"Unexpected lines:\n{text}"); } [Test] @@ -77,10 +77,10 @@ public void ReadLinesWithLegacyNewLine(string text, int expectedLines) lineCount += 1; - StringAssert.StartsWith($"Line {lineCount}", line, $"Invalid line: {line}"); + Assert.That(line.StartsWith($"Line {lineCount}"), $"Invalid line: {line}"); } - ClassicAssert.AreEqual(expectedLines, lineCount, $"Unexpected lines:\n{text}"); + Assert.That(expectedLines, Is.EqualTo(lineCount), $"Unexpected lines:\n{text}"); } } [Test] @@ -98,7 +98,8 @@ public void CountLinesWithLegacyNewLine(string text, int expectedLines) lineCount += 1; } - ClassicAssert.AreEqual(expectedLines, lineCount, $"Unexpected lines:\n{text}"); + + Assert.That(expectedLines, Is.EqualTo(lineCount), $"Unexpected lines:\n{text}"); } } } diff --git a/src/LogExpert.Tests/LogWindowTest.cs b/src/LogExpert.Tests/LogWindowTest.cs index 75d76b18..a6da5685 100644 --- a/src/LogExpert.Tests/LogWindowTest.cs +++ b/src/LogExpert.Tests/LogWindowTest.cs @@ -1,12 +1,11 @@  -using CsvColumnizerType=CsvColumnizer.CsvColumnizer; -using NUnit.Framework; -using System; using LogExpert.Classes; using LogExpert.Controls.LogTabWindow; using LogExpert.Controls.LogWindow; using LogExpert.Entities; -using NUnit.Framework.Legacy; +using NUnit.Framework; +using System; +using CsvColumnizerType = CsvColumnizer.CsvColumnizer; namespace LogExpert.Tests { @@ -18,10 +17,9 @@ public class LogWindowTest public void Instantiate_JsonFile_BuildCorrectColumnizer(string fileName, Type columnizerType) { LogTabWindow logTabWindow = new LogTabWindow(null, 0, false); - LogWindow logWindow = - new LogWindow(logTabWindow, fileName, false, false); + LogWindow logWindow = new LogWindow(logTabWindow, fileName, false, false); - ClassicAssert.AreEqual(columnizerType, logWindow.CurrentColumnizer.GetType()); + Assert.That(columnizerType, Is.EqualTo(logWindow.CurrentColumnizer.GetType())); } [TestCase(@".\TestData\XmlTest_01.xml")] @@ -34,7 +32,7 @@ public void Instantiate_AnyFile_NotCrash(string fileName) LogTabWindow logTabWindow = new LogTabWindow(null, 0, false); LogWindow logWindow = new LogWindow(logTabWindow, fileName, false, false); - ClassicAssert.True(true); + Assert.That(true, Is.True); } } } diff --git a/src/LogExpert.Tests/ReaderTest.cs b/src/LogExpert.Tests/ReaderTest.cs index 3f4569cb..6b76076b 100644 --- a/src/LogExpert.Tests/ReaderTest.cs +++ b/src/LogExpert.Tests/ReaderTest.cs @@ -1,11 +1,10 @@ -using System; -using System.IO; -using System.Text; -using LogExpert.Classes.Log; +using LogExpert.Classes.Log; using LogExpert.Entities; using LogExpert.Interface; using NUnit.Framework; -using NUnit.Framework.Legacy; +using System; +using System.IO; +using System.Text; namespace LogExpert.Tests { @@ -41,16 +40,16 @@ private void CompareReaderImplementationsInternal(string fileName, Encoding enc, break; } - ClassicAssert.AreEqual(line1, line2, "File " + fileName); + Assert.That(line1, Is.EqualTo(line2), "File " + fileName); if (r1.Position != maxPosition) { - ClassicAssert.AreEqual(r1.Position, r2.Position, "Line " + lineNum + ", File: " + fileName); + Assert.That(r2.Position, Is.EqualTo(r1.Position), "Line " + lineNum + ", File: " + fileName); } else { //Its desired that the position of the new implementation is 2 bytes ahead to fix the problem of empty lines every time a new line is appended. - ClassicAssert.AreEqual(r1.Position, r2.Position - 2, "Line " + lineNum + ", File: " + fileName); + Assert.That(r2.Position - 2, Is.EqualTo(r1.Position), "Line " + lineNum + ", File: " + fileName); } } } diff --git a/src/LogExpert.Tests/RollingNameTest.cs b/src/LogExpert.Tests/RollingNameTest.cs index d0045e62..1eaa9312 100644 --- a/src/LogExpert.Tests/RollingNameTest.cs +++ b/src/LogExpert.Tests/RollingNameTest.cs @@ -1,6 +1,5 @@ using LogExpert.Classes.Log; using NUnit.Framework; -using NUnit.Framework.Legacy; namespace LogExpert.Tests { @@ -21,7 +20,7 @@ public void TestFilename1(string expectedResult, string formatString) RolloverFilenameBuilder fnb = new RolloverFilenameBuilder(formatString); fnb.SetFileName(expectedResult); string name = fnb.BuildFileName(); - ClassicAssert.AreEqual(expectedResult, name); + Assert.That(name, Is.EqualTo(expectedResult)); } [Test] @@ -39,7 +38,7 @@ public void TestFilenameAnd1(string fileName, string expectedResult, string form fnb.SetFileName(fileName); fnb.Index += 1; string name = fnb.BuildFileName(); - ClassicAssert.AreEqual(expectedResult, name); + Assert.That(name, Is.EqualTo(expectedResult)); } [Test] @@ -51,7 +50,7 @@ public void TestFilenameAnd2(string fileName, string expectedResult, string form fnb.SetFileName(fileName); fnb.Index += 2; string name = fnb.BuildFileName(); - ClassicAssert.AreEqual(expectedResult, name); + Assert.That(name, Is.EqualTo(expectedResult)); } @@ -63,7 +62,7 @@ public void TestFilenameMinus1(string fileName, string expectedResult, string fo fnb.SetFileName(fileName); fnb.Index -= 1; string name = fnb.BuildFileName(); - ClassicAssert.AreEqual("engine.log", name); + Assert.That(name, Is.EqualTo("engine.log")); } } } \ No newline at end of file diff --git a/src/LogExpert.Tests/RolloverHandlerTest.cs b/src/LogExpert.Tests/RolloverHandlerTest.cs index cbe5c995..4b091bc0 100644 --- a/src/LogExpert.Tests/RolloverHandlerTest.cs +++ b/src/LogExpert.Tests/RolloverHandlerTest.cs @@ -3,7 +3,6 @@ using LogExpert.Classes.Log; using LogExpert.Entities; using NUnit.Framework; -using NUnit.Framework.Legacy; namespace LogExpert.Tests { @@ -26,7 +25,7 @@ public void TestFilenameListWithAppendedIndex(string format, int retries) RolloverFilenameHandler handler = new RolloverFilenameHandler(info, options); LinkedList fileList = handler.GetNameList(); - ClassicAssert.AreEqual(files, fileList); + Assert.That(fileList, Is.EqualTo(files)); Cleanup(); } @@ -47,7 +46,7 @@ public void TestFilenameListWithDate(string format, int retries) RolloverFilenameHandler handler = new RolloverFilenameHandler(info, options); LinkedList fileList = handler.GetNameList(); - ClassicAssert.AreEqual(files, fileList); + Assert.That(fileList, Is.EqualTo(files)); Cleanup(); } diff --git a/src/LogExpert.Tests/SquareBracketColumnizerTest.cs b/src/LogExpert.Tests/SquareBracketColumnizerTest.cs index b1267f18..bdd908b3 100644 --- a/src/LogExpert.Tests/SquareBracketColumnizerTest.cs +++ b/src/LogExpert.Tests/SquareBracketColumnizerTest.cs @@ -5,7 +5,6 @@ using LogExpert.Classes.Log; using LogExpert.Entities; using NUnit.Framework; -using NUnit.Framework.Legacy; namespace LogExpert.Tests { @@ -39,7 +38,7 @@ public void GetPriority_HappyFile_ColumnCountMatches(string fileName, int count) }; squareBracketColumnizer.GetPriority(path, loglines); - ClassicAssert.AreEqual(squareBracketColumnizer.GetColumnCount(), count); + Assert.That(count, Is.EqualTo(squareBracketColumnizer.GetColumnCount())); } } diff --git a/src/LogExpert.sln b/src/LogExpert.sln index ce58293e..c5d5aa5a 100644 --- a/src/LogExpert.sln +++ b/src/LogExpert.sln @@ -62,325 +62,83 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|Win32 = Debug|Win32 - DebugNoTimeout|Any CPU = DebugNoTimeout|Any CPU - DebugNoTimeout|Mixed Platforms = DebugNoTimeout|Mixed Platforms - DebugNoTimeout|Win32 = DebugNoTimeout|Win32 Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {F0C0D370-F416-44ED-939A-B4827D15AC14}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F0C0D370-F416-44ED-939A-B4827D15AC14}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F0C0D370-F416-44ED-939A-B4827D15AC14}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F0C0D370-F416-44ED-939A-B4827D15AC14}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {F0C0D370-F416-44ED-939A-B4827D15AC14}.Debug|Win32.ActiveCfg = Debug|Any CPU - {F0C0D370-F416-44ED-939A-B4827D15AC14}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {F0C0D370-F416-44ED-939A-B4827D15AC14}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {F0C0D370-F416-44ED-939A-B4827D15AC14}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F0C0D370-F416-44ED-939A-B4827D15AC14}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {F0C0D370-F416-44ED-939A-B4827D15AC14}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU {F0C0D370-F416-44ED-939A-B4827D15AC14}.Release|Any CPU.ActiveCfg = Release|Any CPU {F0C0D370-F416-44ED-939A-B4827D15AC14}.Release|Any CPU.Build.0 = Release|Any CPU - {F0C0D370-F416-44ED-939A-B4827D15AC14}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {F0C0D370-F416-44ED-939A-B4827D15AC14}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {F0C0D370-F416-44ED-939A-B4827D15AC14}.Release|Win32.ActiveCfg = Release|Any CPU {2563526E-4566-40CB-AA27-587B904FD25B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2563526E-4566-40CB-AA27-587B904FD25B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2563526E-4566-40CB-AA27-587B904FD25B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {2563526E-4566-40CB-AA27-587B904FD25B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {2563526E-4566-40CB-AA27-587B904FD25B}.Debug|Win32.ActiveCfg = Debug|Any CPU - {2563526E-4566-40CB-AA27-587B904FD25B}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {2563526E-4566-40CB-AA27-587B904FD25B}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {2563526E-4566-40CB-AA27-587B904FD25B}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {2563526E-4566-40CB-AA27-587B904FD25B}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {2563526E-4566-40CB-AA27-587B904FD25B}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU {2563526E-4566-40CB-AA27-587B904FD25B}.Release|Any CPU.ActiveCfg = Release|Any CPU {2563526E-4566-40CB-AA27-587B904FD25B}.Release|Any CPU.Build.0 = Release|Any CPU - {2563526E-4566-40CB-AA27-587B904FD25B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {2563526E-4566-40CB-AA27-587B904FD25B}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {2563526E-4566-40CB-AA27-587B904FD25B}.Release|Win32.ActiveCfg = Release|Any CPU {E72C2BB1-34DE-4D66-A830-9647C3837833}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E72C2BB1-34DE-4D66-A830-9647C3837833}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E72C2BB1-34DE-4D66-A830-9647C3837833}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {E72C2BB1-34DE-4D66-A830-9647C3837833}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {E72C2BB1-34DE-4D66-A830-9647C3837833}.Debug|Win32.ActiveCfg = Debug|Any CPU - {E72C2BB1-34DE-4D66-A830-9647C3837833}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {E72C2BB1-34DE-4D66-A830-9647C3837833}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {E72C2BB1-34DE-4D66-A830-9647C3837833}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {E72C2BB1-34DE-4D66-A830-9647C3837833}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {E72C2BB1-34DE-4D66-A830-9647C3837833}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU {E72C2BB1-34DE-4D66-A830-9647C3837833}.Release|Any CPU.ActiveCfg = Release|Any CPU {E72C2BB1-34DE-4D66-A830-9647C3837833}.Release|Any CPU.Build.0 = Release|Any CPU - {E72C2BB1-34DE-4D66-A830-9647C3837833}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {E72C2BB1-34DE-4D66-A830-9647C3837833}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {E72C2BB1-34DE-4D66-A830-9647C3837833}.Release|Win32.ActiveCfg = Release|Any CPU {C41A517B-7502-4B17-9119-55D5716FAD65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C41A517B-7502-4B17-9119-55D5716FAD65}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C41A517B-7502-4B17-9119-55D5716FAD65}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {C41A517B-7502-4B17-9119-55D5716FAD65}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {C41A517B-7502-4B17-9119-55D5716FAD65}.Debug|Win32.ActiveCfg = Debug|Any CPU - {C41A517B-7502-4B17-9119-55D5716FAD65}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {C41A517B-7502-4B17-9119-55D5716FAD65}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {C41A517B-7502-4B17-9119-55D5716FAD65}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {C41A517B-7502-4B17-9119-55D5716FAD65}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {C41A517B-7502-4B17-9119-55D5716FAD65}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU {C41A517B-7502-4B17-9119-55D5716FAD65}.Release|Any CPU.ActiveCfg = Release|Any CPU {C41A517B-7502-4B17-9119-55D5716FAD65}.Release|Any CPU.Build.0 = Release|Any CPU - {C41A517B-7502-4B17-9119-55D5716FAD65}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {C41A517B-7502-4B17-9119-55D5716FAD65}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {C41A517B-7502-4B17-9119-55D5716FAD65}.Release|Win32.ActiveCfg = Release|Any CPU {00ED9F5D-742B-441C-B48B-16940B070B77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {00ED9F5D-742B-441C-B48B-16940B070B77}.Debug|Any CPU.Build.0 = Debug|Any CPU - {00ED9F5D-742B-441C-B48B-16940B070B77}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {00ED9F5D-742B-441C-B48B-16940B070B77}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {00ED9F5D-742B-441C-B48B-16940B070B77}.Debug|Win32.ActiveCfg = Debug|Any CPU - {00ED9F5D-742B-441C-B48B-16940B070B77}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {00ED9F5D-742B-441C-B48B-16940B070B77}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {00ED9F5D-742B-441C-B48B-16940B070B77}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {00ED9F5D-742B-441C-B48B-16940B070B77}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {00ED9F5D-742B-441C-B48B-16940B070B77}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU {00ED9F5D-742B-441C-B48B-16940B070B77}.Release|Any CPU.ActiveCfg = Release|Any CPU {00ED9F5D-742B-441C-B48B-16940B070B77}.Release|Any CPU.Build.0 = Release|Any CPU - {00ED9F5D-742B-441C-B48B-16940B070B77}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {00ED9F5D-742B-441C-B48B-16940B070B77}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {00ED9F5D-742B-441C-B48B-16940B070B77}.Release|Win32.ActiveCfg = Release|Any CPU {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.Debug|Win32.ActiveCfg = Debug|Any CPU - {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.Release|Any CPU.ActiveCfg = Release|Any CPU {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.Release|Any CPU.Build.0 = Release|Any CPU - {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.Release|Win32.ActiveCfg = Release|Any CPU {F5E81EBE-3E6F-409F-B510-918E97F59072}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F5E81EBE-3E6F-409F-B510-918E97F59072}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F5E81EBE-3E6F-409F-B510-918E97F59072}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F5E81EBE-3E6F-409F-B510-918E97F59072}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {F5E81EBE-3E6F-409F-B510-918E97F59072}.Debug|Win32.ActiveCfg = Debug|Any CPU - {F5E81EBE-3E6F-409F-B510-918E97F59072}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {F5E81EBE-3E6F-409F-B510-918E97F59072}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {F5E81EBE-3E6F-409F-B510-918E97F59072}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F5E81EBE-3E6F-409F-B510-918E97F59072}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {F5E81EBE-3E6F-409F-B510-918E97F59072}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU {F5E81EBE-3E6F-409F-B510-918E97F59072}.Release|Any CPU.ActiveCfg = Release|Any CPU {F5E81EBE-3E6F-409F-B510-918E97F59072}.Release|Any CPU.Build.0 = Release|Any CPU - {F5E81EBE-3E6F-409F-B510-918E97F59072}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {F5E81EBE-3E6F-409F-B510-918E97F59072}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {F5E81EBE-3E6F-409F-B510-918E97F59072}.Release|Win32.ActiveCfg = Release|Any CPU {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Debug|Win32.ActiveCfg = Debug|Any CPU - {C75532C4-765B-418E-B09B-46D36B2ABDB1}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {C75532C4-765B-418E-B09B-46D36B2ABDB1}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {C75532C4-765B-418E-B09B-46D36B2ABDB1}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {C75532C4-765B-418E-B09B-46D36B2ABDB1}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {C75532C4-765B-418E-B09B-46D36B2ABDB1}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Release|Any CPU.ActiveCfg = Release|Any CPU {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Release|Any CPU.Build.0 = Release|Any CPU - {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Release|Win32.ActiveCfg = Release|Any CPU {4C899885-E361-410A-B6AC-C2F236C436FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4C899885-E361-410A-B6AC-C2F236C436FA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.Debug|Win32.ActiveCfg = Debug|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.Debug|Win32.Build.0 = Debug|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.DebugNoTimeout|Win32.Build.0 = Debug|Any CPU {4C899885-E361-410A-B6AC-C2F236C436FA}.Release|Any CPU.ActiveCfg = Release|Any CPU {4C899885-E361-410A-B6AC-C2F236C436FA}.Release|Any CPU.Build.0 = Release|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.Release|Win32.ActiveCfg = Release|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.Release|Win32.Build.0 = Release|Any CPU {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.Debug|Win32.ActiveCfg = Debug|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.Debug|Win32.Build.0 = Debug|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.DebugNoTimeout|Win32.Build.0 = Debug|Any CPU {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.Release|Any CPU.ActiveCfg = Release|Any CPU {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.Release|Any CPU.Build.0 = Release|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.Release|Win32.ActiveCfg = Release|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.Release|Win32.Build.0 = Release|Any CPU {B5A7DFA4-48A8-4616-8008-7441699EC946}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B5A7DFA4-48A8-4616-8008-7441699EC946}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.Debug|Win32.ActiveCfg = Debug|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.Debug|Win32.Build.0 = Debug|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.DebugNoTimeout|Win32.Build.0 = Debug|Any CPU {B5A7DFA4-48A8-4616-8008-7441699EC946}.Release|Any CPU.ActiveCfg = Release|Any CPU {B5A7DFA4-48A8-4616-8008-7441699EC946}.Release|Any CPU.Build.0 = Release|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.Release|Win32.ActiveCfg = Release|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.Release|Win32.Build.0 = Release|Any CPU {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.Debug|Win32.ActiveCfg = Debug|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.Debug|Win32.Build.0 = Debug|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.DebugNoTimeout|Win32.Build.0 = Debug|Any CPU {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.Release|Any CPU.ActiveCfg = Release|Any CPU {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.Release|Any CPU.Build.0 = Release|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.Release|Win32.ActiveCfg = Release|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.Release|Win32.Build.0 = Release|Any CPU {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.Debug|Win32.ActiveCfg = Debug|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.Debug|Win32.Build.0 = Debug|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.DebugNoTimeout|Win32.Build.0 = Debug|Any CPU {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.Release|Any CPU.ActiveCfg = Release|Any CPU {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.Release|Any CPU.Build.0 = Release|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.Release|Win32.ActiveCfg = Release|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.Release|Win32.Build.0 = Release|Any CPU {003535EC-4186-4958-9DD9-C641F089AEED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {003535EC-4186-4958-9DD9-C641F089AEED}.Debug|Any CPU.Build.0 = Debug|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.Debug|Win32.ActiveCfg = Debug|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.Debug|Win32.Build.0 = Debug|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.DebugNoTimeout|Win32.Build.0 = Debug|Any CPU {003535EC-4186-4958-9DD9-C641F089AEED}.Release|Any CPU.ActiveCfg = Release|Any CPU {003535EC-4186-4958-9DD9-C641F089AEED}.Release|Any CPU.Build.0 = Release|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.Release|Win32.ActiveCfg = Release|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.Release|Win32.Build.0 = Release|Any CPU {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.Debug|Win32.ActiveCfg = Debug|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.Debug|Win32.Build.0 = Debug|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.DebugNoTimeout|Win32.Build.0 = Debug|Any CPU {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.Release|Any CPU.ActiveCfg = Release|Any CPU {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.Release|Any CPU.Build.0 = Release|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.Release|Win32.ActiveCfg = Release|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.Release|Win32.Build.0 = Release|Any CPU {CFA0360E-BA8D-4D6F-AF76-63D8282109FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CFA0360E-BA8D-4D6F-AF76-63D8282109FA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {CFA0360E-BA8D-4D6F-AF76-63D8282109FA}.Debug|Win32.ActiveCfg = Debug|Any CPU - {CFA0360E-BA8D-4D6F-AF76-63D8282109FA}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {CFA0360E-BA8D-4D6F-AF76-63D8282109FA}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {CFA0360E-BA8D-4D6F-AF76-63D8282109FA}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU {CFA0360E-BA8D-4D6F-AF76-63D8282109FA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CFA0360E-BA8D-4D6F-AF76-63D8282109FA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {CFA0360E-BA8D-4D6F-AF76-63D8282109FA}.Release|Win32.ActiveCfg = Release|Any CPU {3D01E923-5219-488B-B0A7-98521841E680}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3D01E923-5219-488B-B0A7-98521841E680}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.Debug|Win32.ActiveCfg = Debug|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.Debug|Win32.Build.0 = Debug|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.DebugNoTimeout|Win32.Build.0 = Debug|Any CPU {3D01E923-5219-488B-B0A7-98521841E680}.Release|Any CPU.ActiveCfg = Release|Any CPU {3D01E923-5219-488B-B0A7-98521841E680}.Release|Any CPU.Build.0 = Release|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.Release|Win32.ActiveCfg = Release|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.Release|Win32.Build.0 = Release|Any CPU {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.Debug|Win32.ActiveCfg = Debug|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.Debug|Win32.Build.0 = Debug|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.DebugNoTimeout|Win32.Build.0 = Debug|Any CPU {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.Release|Any CPU.ActiveCfg = Release|Any CPU {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.Release|Any CPU.Build.0 = Release|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.Release|Win32.ActiveCfg = Release|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.Release|Win32.Build.0 = Release|Any CPU {D31D1721-9DEA-45A4-B813-D5023B2EC2CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D31D1721-9DEA-45A4-B813-D5023B2EC2CC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D31D1721-9DEA-45A4-B813-D5023B2EC2CC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {D31D1721-9DEA-45A4-B813-D5023B2EC2CC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {D31D1721-9DEA-45A4-B813-D5023B2EC2CC}.Debug|Win32.ActiveCfg = Debug|Any CPU - {D31D1721-9DEA-45A4-B813-D5023B2EC2CC}.Debug|Win32.Build.0 = Debug|Any CPU - {D31D1721-9DEA-45A4-B813-D5023B2EC2CC}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {D31D1721-9DEA-45A4-B813-D5023B2EC2CC}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {D31D1721-9DEA-45A4-B813-D5023B2EC2CC}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {D31D1721-9DEA-45A4-B813-D5023B2EC2CC}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {D31D1721-9DEA-45A4-B813-D5023B2EC2CC}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU - {D31D1721-9DEA-45A4-B813-D5023B2EC2CC}.DebugNoTimeout|Win32.Build.0 = Debug|Any CPU {D31D1721-9DEA-45A4-B813-D5023B2EC2CC}.Release|Any CPU.ActiveCfg = Release|Any CPU {D31D1721-9DEA-45A4-B813-D5023B2EC2CC}.Release|Any CPU.Build.0 = Release|Any CPU - {D31D1721-9DEA-45A4-B813-D5023B2EC2CC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {D31D1721-9DEA-45A4-B813-D5023B2EC2CC}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {D31D1721-9DEA-45A4-B813-D5023B2EC2CC}.Release|Win32.ActiveCfg = Release|Any CPU - {D31D1721-9DEA-45A4-B813-D5023B2EC2CC}.Release|Win32.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/LogExpert/Classes/CmdLine.cs b/src/LogExpert/Classes/CmdLine.cs index a82ceedc..f99bffb4 100644 --- a/src/LogExpert/Classes/CmdLine.cs +++ b/src/LogExpert/Classes/CmdLine.cs @@ -268,7 +268,7 @@ public CmdLineParameter this[string name] /// /// Registers a parameter to be used and adds it to the help screen. /// - /// The parameter to add. + /// The parameter to add. public void RegisterParameter(CmdLineParameter parameter) { if (parameters.ContainsKey(parameter.Name)) @@ -281,7 +281,7 @@ public void RegisterParameter(CmdLineParameter parameter) /// /// Registers parameters to be used and adds hem to the help screen. /// - /// The parameter to add. + /// The parameter to add. public void RegisterParameter(CmdLineParameter[] parameters) { foreach (CmdLineParameter p in parameters) diff --git a/src/LogExpert/Classes/ColumnCache.cs b/src/LogExpert/Classes/ColumnCache.cs index 1d4d32da..ba71a4e4 100644 --- a/src/LogExpert/Classes/ColumnCache.cs +++ b/src/LogExpert/Classes/ColumnCache.cs @@ -21,7 +21,7 @@ internal IColumnizedLogLine GetColumnsForLine(LogfileReader logFileReader, int l { _lastColumnizer = columnizer; _lastLineNumber = lineNumber; - ILogLine line = logFileReader.GetLogLineWithWait(lineNumber); + ILogLine line = logFileReader.GetLogLineWithWait(lineNumber).Result; if (line != null) { columnizerCallback.LineNum = lineNumber; diff --git a/src/LogExpert/Classes/DateTimeParser/Parser.cs b/src/LogExpert/Classes/DateTimeParser/Parser.cs index 3eacc1d3..55433027 100644 --- a/src/LogExpert/Classes/DateTimeParser/Parser.cs +++ b/src/LogExpert/Classes/DateTimeParser/Parser.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Runtime.CompilerServices; namespace LogExpert.Classes.DateTimeParser { diff --git a/src/LogExpert/Classes/Filter/FilterStarter.cs b/src/LogExpert/Classes/Filter/FilterStarter.cs index 0efb75e2..9ce8d025 100644 --- a/src/LogExpert/Classes/Filter/FilterStarter.cs +++ b/src/LogExpert/Classes/Filter/FilterStarter.cs @@ -1,7 +1,5 @@ using LogExpert.Classes.ILogLineColumnizerCallback; - using NLog; - using System; using System.Collections.Generic; using System.Threading; @@ -27,7 +25,6 @@ internal class FilterStarter private readonly SortedDictionary _lastFilterLinesDict; private ProgressCallback _progressCallback; - private Task _filterTask; private int _progressLineCount; private bool _shouldStop; diff --git a/src/LogExpert/Classes/Log/LogfileReader.cs b/src/LogExpert/Classes/Log/LogfileReader.cs index 123962b5..edffb493 100644 --- a/src/LogExpert/Classes/Log/LogfileReader.cs +++ b/src/LogExpert/Classes/Log/LogfileReader.cs @@ -139,8 +139,7 @@ public LogfileReader(string[] fileNames, EncodingOptions encodingOptions, int bu public delegate void FinishedLoadingEventHandler(object sender, EventArgs e); - private Func GetLogLineFxFunc; - private delegate ILogLine GetLogLineFx(int lineNum); + private delegate Task GetLogLineFx(int lineNum); public delegate void LoadingStartedEventHandler(object sender, LoadFileEventArgs e); @@ -409,7 +408,7 @@ public int ShiftBuffers() public ILogLine GetLogLine(int lineNum) { - return GetLogLineInternal(lineNum); + return GetLogLineInternal(lineNum).Result; } /// @@ -427,7 +426,7 @@ public ILogLine GetLogLine(int lineNum) /// /// line to retrieve /// - public ILogLine GetLogLineWithWait(int lineNum) + public async Task GetLogLineWithWait(int lineNum) { const int WAIT_TIME = 1000; @@ -453,7 +452,8 @@ public ILogLine GetLogLineWithWait(int lineNum) if (!_isFailModeCheckCallPending) { _isFailModeCheckCallPending = true; - _logLineFx.BeginInvoke(lineNum, GetLineFinishedCallback, _logLineFx); + var logLine = await _logLineFx(lineNum); + GetLineFinishedCallback(logLine); } } @@ -767,7 +767,7 @@ private ILogFileInfo AddFile(string fileName) return info; } - private ILogLine GetLogLineInternal(int lineNum) + private Task GetLogLineInternal(int lineNum) { if (_isDeleted) { @@ -803,7 +803,7 @@ private ILogLine GetLogLineInternal(int lineNum) _disposeLock.ReleaseReaderLock(); ReleaseBufferListReaderLock(); - return line; + return Task.FromResult(line); } private void InitLruBuffers() @@ -1425,11 +1425,9 @@ private LogBuffer GetBufferForLine(int lineNum) /// /// Async callback used to check if the GetLogLine() call is succeeding again after a detected timeout. /// - private void GetLineFinishedCallback(IAsyncResult res) + private void GetLineFinishedCallback(ILogLine line) { _isFailModeCheckCallPending = false; - GetLogLineFx logLineFx = (GetLogLineFx)res.AsyncState; - ILogLine line = logLineFx.EndInvoke(res); if (line != null) { _logger.Debug("'isFastFailOnGetLogLine' flag was reset"); diff --git a/src/LogExpert/Classes/PluginRegistry.cs b/src/LogExpert/Classes/PluginRegistry.cs index 1c48ffaa..ec2a7099 100644 --- a/src/LogExpert/Classes/PluginRegistry.cs +++ b/src/LogExpert/Classes/PluginRegistry.cs @@ -1,13 +1,14 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Reflection; -using System.Windows.Forms; -using LogExpert.Classes.Columnizer; +using LogExpert.Classes.Columnizer; using LogExpert.Config; using LogExpert.Entities; using LogExpert.Extensions; using NLog; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Windows.Forms; namespace LogExpert.Classes { @@ -78,110 +79,87 @@ internal void LoadPlugins() { _logger.Info("Loading plugins..."); - RegisteredColumnizers = new List(); - RegisteredColumnizers.Add(new DefaultLogfileColumnizer()); - RegisteredColumnizers.Add(new TimestampColumnizer()); - RegisteredColumnizers.Add(new SquareBracketColumnizer()); - RegisteredColumnizers.Add(new ClfColumnizer()); + RegisteredColumnizers = + [ + //TODO: Remove this plugins and load them as any other plugin + new DefaultLogfileColumnizer(), + new TimestampColumnizer(), + new SquareBracketColumnizer(), + new ClfColumnizer(), + ]; RegisteredFileSystemPlugins.Add(new LocalFileSystem()); - string pluginDir = Application.StartupPath + Path.DirectorySeparatorChar + "plugins"; - + string pluginDir = Path.Combine(Application.StartupPath, "plugins"); + //TODO: FIXME: This is a hack for the tests to pass. Need to find a better approach + if (!Directory.Exists(pluginDir)) { + pluginDir = "."; + } + AppDomain currentDomain = AppDomain.CurrentDomain; currentDomain.AssemblyResolve += ColumnizerResolveEventHandler; - if (Directory.Exists(pluginDir)) + + string interfaceName = typeof(ILogLineColumnizer).FullName; + foreach (string dllName in Directory.GetFiles(pluginDir, "*.dll")) { - string[] dllNames = Directory.GetFiles(pluginDir, "*.dll"); - foreach (string dllName in dllNames) + try { - try + Assembly assembly = Assembly.LoadFrom(dllName); + var types = assembly.GetTypes().Where(t => t.GetInterfaces().Any(i => i.FullName == interfaceName)); + foreach (var type in types) { - Assembly assemblyTmp = Assembly.ReflectionOnlyLoadFrom(dllName); - Assembly assembly = Assembly.Load(assemblyTmp.FullName); + _logger.Info($"Type {type.FullName} in assembly {assembly.FullName} implements {interfaceName}"); - Module[] modules = assembly.GetModules(false); - foreach (Module module in modules) + ConstructorInfo cti = type.GetConstructor(Type.EmptyTypes); + if (cti != null) { - Type[] types = module.FindTypes(Module.FilterTypeName, "*"); - foreach (Type type in types) + object o = cti.Invoke([]); + RegisteredColumnizers.Add((ILogLineColumnizer)o); + + if (o is IColumnizerConfigurator configurator) { - if (type.IsInterface) - { - continue; - } - - if (type.Name.EndsWith("Columnizer")) - { - Type t = typeof(ILogLineColumnizer); - Type inter = type.GetInterface(t.Name); - if (inter != null) - { - ConstructorInfo cti = type.GetConstructor(Type.EmptyTypes); - if (cti != null) - { - object o = cti.Invoke([]); - RegisteredColumnizers.Add((ILogLineColumnizer) o); - - if (o is IColumnizerConfigurator configurator) - { - configurator.LoadConfig(ConfigManager.Settings.preferences.PortableMode ? ConfigManager.PortableModeDir : ConfigManager.ConfigDir); - } - - if (o is ILogExpertPlugin plugin) - { - _pluginList.Add(plugin); - plugin.PluginLoaded(); - } - - _logger.Info("Added columnizer {0}", type.Name); - } - } - } - else - { - if (TryAsContextMenu(type)) - { - continue; - } - - if (TryAsKeywordAction(type)) - { - continue; - } - - if (TryAsFileSystem(type)) - { - continue; - } - } + configurator.LoadConfig(ConfigManager.Settings.preferences.PortableMode ? ConfigManager.PortableModeDir : ConfigManager.ConfigDir); } + + if (o is ILogExpertPlugin plugin) + { + _pluginList.Add(plugin); + plugin.PluginLoaded(); + } + + _logger.Info("Added columnizer {0}", type.Name); } } - catch (BadImageFormatException e) - { - _logger.Error(e, dllName); - // nothing... could be a DLL which is needed by any plugin - } - catch (FileLoadException e) - { - // can happen when a 32bit-only DLL is loaded on a 64bit system (or vice versa) - _logger.Error(e, dllName); - } - catch (ReflectionTypeLoadException ex) + } + catch (BadImageFormatException e) + { + _logger.Error(e, dllName); + // nothing... could be a DLL which is needed by any plugin + } + catch (FileLoadException e) + { + // can happen when a 32bit-only DLL is loaded on a 64bit system (or vice versa) + _logger.Error(e, dllName); + } + catch (ReflectionTypeLoadException ex) + { + // can happen when a dll dependency is missing + if (!ex.LoaderExceptions.IsEmpty()) { - if (!ex.LoaderExceptions.IsEmpty()) + foreach (Exception loaderException in ex.LoaderExceptions) { - foreach (Exception loaderException in ex.LoaderExceptions) - { - _logger.Error(loaderException, "Plugin load failed with '{0}'", dllName); - } + _logger.Error(loaderException, "Plugin load failed with '{0}'", dllName); } + } - _logger.Error(ex, "Loader exception during load of dll '{0}'", dllName); + _logger.Error(ex, "Loader exception during load of dll '{0}'", dllName); - throw; - } + throw; + } + catch (Exception ex) + { + _logger.Error(ex, $"General Exception for the file {dllName}, of type: {ex.GetType()}, with the message: {ex.Message}"); + throw; } } diff --git a/src/LogExpert/Classes/TimeSpreadCalculator.cs b/src/LogExpert/Classes/TimeSpreadCalculator.cs index 5736d804..4fed6941 100644 --- a/src/LogExpert/Classes/TimeSpreadCalculator.cs +++ b/src/LogExpert/Classes/TimeSpreadCalculator.cs @@ -171,7 +171,7 @@ public void SetDisplayHeight(int height) #region Private Methods - private async Task WorkerFx() + private void WorkerFx() { //Thread.CurrentThread.Name = "TimeSpreadCalculator Worker"; //Thread.CurrentThread.Priority = ThreadPriority.BelowNormal; @@ -191,11 +191,11 @@ private async Task WorkerFx() _logger.Debug("TimeSpreadCalculator: unbusy. starting calc."); if (TimeMode) { - await DoCalc_via_Time(); + DoCalc_via_Time(); } else { - await DoCalc(); + DoCalc(); } break; } @@ -207,7 +207,7 @@ private async Task WorkerFx() } } - private async Task DoCalc() + private void DoCalc() { OnStartCalc(EventArgs.Empty); _logger.Debug("TimeSpreadCalculator.DoCalc() begin"); @@ -276,7 +276,7 @@ private async Task DoCalc() } //TODO Refactor this method - private async Task DoCalc_via_Time() + private void DoCalc_via_Time() { OnStartCalc(EventArgs.Empty); _logger.Debug("TimeSpreadCalculator.DoCalc_via_Time() begin"); diff --git a/src/LogExpert/Classes/TimeSyncList.cs b/src/LogExpert/Classes/TimeSyncList.cs index 41317c2a..bdef4e90 100644 --- a/src/LogExpert/Classes/TimeSyncList.cs +++ b/src/LogExpert/Classes/TimeSyncList.cs @@ -66,6 +66,7 @@ public void RemoveWindow(LogWindow logWindow) /// Scrolls all LogWindows to the given timestamp /// /// + /// public void NavigateToTimestamp(DateTime timestamp, LogWindow sender) { this.CurrentTimestamp = timestamp; diff --git a/src/LogExpert/Classes/Util.cs b/src/LogExpert/Classes/Util.cs index bd3770b8..79d77d75 100644 --- a/src/LogExpert/Classes/Util.cs +++ b/src/LogExpert/Classes/Util.cs @@ -176,7 +176,7 @@ public static unsafe int YetiLevenshtein(string s1, string s2, int substitionCos /// /// Cetin Sert, David Necas - /// http://webcleaner.svn.sourceforge.net/viewvc/webcleaner/trunk/webcleaner2/wc/levenshtein.c?revision=6015&view=markup + /// Source Code /// /// /// @@ -375,7 +375,7 @@ public static unsafe int YetiLevenshtein(char* s1, int l1, char* s2, int l2, int /// /// Returns true, if the given string is null or empty /// - /// + /// /// public static bool IsNull(string toTest) { @@ -385,7 +385,7 @@ public static bool IsNull(string toTest) /// /// Returns true, if the given string is null or empty or contains only spaces /// - /// + /// /// public static bool IsNullOrSpaces(string toTest) { diff --git a/src/LogExpert/Controls/LogWindow/LogWindowEventHandlers.cs b/src/LogExpert/Controls/LogWindow/LogWindowEventHandlers.cs index c6ab7d23..4924211c 100644 --- a/src/LogExpert/Controls/LogWindow/LogWindowEventHandlers.cs +++ b/src/LogExpert/Controls/LogWindow/LogWindowEventHandlers.cs @@ -354,7 +354,7 @@ private void OnFilterGridViewCellPainting(object sender, DataGridViewCellPaintin } int lineNum = _filterResultList[e.RowIndex]; - ILogLine line = _logFileReader.GetLogLineWithWait(lineNum); + ILogLine line = _logFileReader.GetLogLineWithWait(lineNum).Result; if (line != null) { HilightEntry entry = FindFirstNoWordMatchHilightEntry(line); diff --git a/src/LogExpert/Controls/LogWindow/LogWindowPrivate.cs b/src/LogExpert/Controls/LogWindow/LogWindowPrivate.cs index 9d07730c..fbebae31 100644 --- a/src/LogExpert/Controls/LogWindow/LogWindowPrivate.cs +++ b/src/LogExpert/Controls/LogWindow/LogWindowPrivate.cs @@ -2765,6 +2765,7 @@ private void WriteFilterToTabFinished(FilterPipe pipe, string name, PersistenceD /// Used to create a new tab and pipe the given content into it. /// /// + /// internal void WritePipeTab(IList lineEntryList, string title) { FilterPipe pipe = new(new FilterParams(), this); diff --git a/src/LogExpert/Controls/LogWindow/LogWindowsPublic.cs b/src/LogExpert/Controls/LogWindow/LogWindowsPublic.cs index 2f5e2fb6..7f152532 100644 --- a/src/LogExpert/Controls/LogWindow/LogWindowsPublic.cs +++ b/src/LogExpert/Controls/LogWindow/LogWindowsPublic.cs @@ -395,7 +395,7 @@ public void CellPainting(DataGridView gridView, int rowIndex, DataGridViewCellPa return; } - ILogLine line = _logFileReader.GetLogLineWithWait(rowIndex); + ILogLine line = _logFileReader.GetLogLineWithWait(rowIndex).Result; if (line != null) { diff --git a/src/LogExpert/Dialogs/AboutBox.cs b/src/LogExpert/Dialogs/AboutBox.cs index dfd01946..c995a7df 100644 --- a/src/LogExpert/Dialogs/AboutBox.cs +++ b/src/LogExpert/Dialogs/AboutBox.cs @@ -1,4 +1,5 @@ using System.Diagnostics; +using System.IO; using System.Reflection; using System.Windows.Forms; @@ -57,7 +58,7 @@ public string AssemblyTitle return titleAttribute.Title; } } - return System.IO.Path.GetFileNameWithoutExtension(_assembly.CodeBase); + return Path.GetFileNameWithoutExtension(_assembly.Location); } } diff --git a/src/LogExpert/Extensions/ComboBoxExtensions.cs b/src/LogExpert/Extensions/ComboBoxExtensions.cs index 76781de1..b7488e55 100644 --- a/src/LogExpert/Extensions/ComboBoxExtensions.cs +++ b/src/LogExpert/Extensions/ComboBoxExtensions.cs @@ -4,7 +4,7 @@ namespace LogExpert.Extensions { public static class ComboBoxExtensions { - /// + /// public static int GetMaxTextWidth(this ComboBox comboBox) { var maxTextWidth = comboBox.Width; diff --git a/src/LogExpert/LogExpert.csproj b/src/LogExpert/LogExpert.csproj index 33e5c221..d3fd6c9a 100644 --- a/src/LogExpert/LogExpert.csproj +++ b/src/LogExpert/LogExpert.csproj @@ -6,23 +6,22 @@ false true true - - - ..\..\bin\Debug\ - - + $(SolutionDir)..\bin\Docs\LogExpert.xml true Auto - - - ..\..\bin\Release\ - true - - true - - ..\Solution Items\Key.snk + false + $(SolutionDir)..\bin\$(Configuration) + true + SystemAware + CS1591;CA1416; + + + False + + + True @@ -77,12 +76,14 @@ - - - - - - + + + + + + + + @@ -92,9 +93,4 @@ - - - - - \ No newline at end of file diff --git a/src/LogExpert/Program.cs b/src/LogExpert/Program.cs index fb3bb329..e4e3818a 100644 --- a/src/LogExpert/Program.cs +++ b/src/LogExpert/Program.cs @@ -1,21 +1,14 @@ using Grpc.Core; using Grpc.Net.Client; - using LogExpert.Classes; using LogExpert.Config; using LogExpert.Controls.LogTabWindow; using LogExpert.Dialogs; - using LogexpertGRPCService.Services; - using NLog; - using System; using System.Collections.Generic; using System.Diagnostics; -//using System.Runtime.Remoting.Channels.Ipc; -//using System.Runtime.Remoting.Channels; -//using System.Runtime.Remoting; using System.IO; using System.Reflection; using System.Security; @@ -28,11 +21,7 @@ namespace LogExpert internal static class Program { #region Fields - private static readonly ILogger _logger = LogManager.GetLogger("Program"); - private static LogExpertServiceImpl _logExpertService; - private static Grpc.LogExpertService.LogExpertServiceClient _logExpertServiceClient; - #endregion #region Private Methods diff --git a/src/LogexpertgRPCService/LogexpertgRPCService.csproj b/src/LogexpertgRPCService/LogexpertgRPCService.csproj index dcff72c9..80389635 100644 --- a/src/LogexpertgRPCService/LogexpertgRPCService.csproj +++ b/src/LogexpertgRPCService/LogexpertgRPCService.csproj @@ -1,17 +1,17 @@ - - + net8.0 enable enable - + + true + ..\Solution Items\Key.snk + - - + - - + \ No newline at end of file diff --git a/src/RegexColumnizer.UnitTests/RegexColumnizer.UnitTests.csproj b/src/RegexColumnizer.UnitTests/RegexColumnizer.UnitTests.csproj index c317c063..50861de0 100644 --- a/src/RegexColumnizer.UnitTests/RegexColumnizer.UnitTests.csproj +++ b/src/RegexColumnizer.UnitTests/RegexColumnizer.UnitTests.csproj @@ -2,7 +2,10 @@ net8.0-windows Library + true false + false + bin\$(Configuration) true @@ -15,22 +18,14 @@ 1.0.0.0 1.0.0.0 - - - - - 4.20.70 - - - 4.0.1 - - - 4.5.0 - + + + + \ No newline at end of file diff --git a/src/RegexColumnizer.UnitTests/RegexColumnizerTests.cs b/src/RegexColumnizer.UnitTests/RegexColumnizerTests.cs index 7e26bafc..f49869a6 100644 --- a/src/RegexColumnizer.UnitTests/RegexColumnizerTests.cs +++ b/src/RegexColumnizer.UnitTests/RegexColumnizerTests.cs @@ -1,7 +1,6 @@ using LogExpert; using Moq; using NUnit.Framework; -using NUnit.Framework.Legacy; namespace RegexColumnizer.UnitTests { @@ -19,7 +18,7 @@ public void SplitLine_ColumnCountMatches(string lineToParse, string regex, int e TestLogLine testLogLine = new TestLogLine(4, lineToParse); IColumnizedLogLine parsedLogLine = columnizer.SplitLine(Mock.Of(), testLogLine); - ClassicAssert.AreEqual(expectedNumberOfColumns, parsedLogLine.ColumnValues.Length); + Assert.That(expectedNumberOfColumns, Is.EqualTo(parsedLogLine.ColumnValues.Length)); } //Using "" for empty string since string.Empty can't be passed to the TestCase attribute. @@ -35,7 +34,7 @@ public void SplitLine_ColumnValues(string lineToParse, string regex, int columnI TestLogLine testLogLine = new TestLogLine(3, lineToParse); IColumnizedLogLine parsedLogLine = columnizer.SplitLine(Mock.Of(), testLogLine); - ClassicAssert.AreEqual(expectedColumnValue, parsedLogLine.ColumnValues[columnIndexToTest].Text); + Assert.That(expectedColumnValue, Is.EqualTo(parsedLogLine.ColumnValues[columnIndexToTest].Text)); } private Regex1Columnizer CreateInitializedColumnizer(string regex) diff --git a/src/RegexColumnizer/RegexColumnizer.csproj b/src/RegexColumnizer/RegexColumnizer.csproj index 0d155c76..f546544b 100644 --- a/src/RegexColumnizer/RegexColumnizer.csproj +++ b/src/RegexColumnizer/RegexColumnizer.csproj @@ -5,12 +5,15 @@ false true true + false + $(SolutionDir)..\bin\$(Configuration)\plugins + CA1416; - - ..\..\bin\Debug\plugins\ + + False - - ..\..\bin\Release\plugins\ + + True true @@ -32,7 +35,7 @@ - - + + \ No newline at end of file diff --git a/src/SftpFileSystemx64/SftpFileSystemx64.csproj b/src/SftpFileSystemx64/SftpFileSystemx64.csproj index 59be2709..6026a0cc 100644 --- a/src/SftpFileSystemx64/SftpFileSystemx64.csproj +++ b/src/SftpFileSystemx64/SftpFileSystemx64.csproj @@ -7,12 +7,15 @@ false true true + false + $(SolutionDir)..\bin\$(Configuration)\plugins + CA1416; - - ..\..\bin\Debug\plugins\ + + False - - ..\..\bin\Release\plugins\ + + True true @@ -31,9 +34,7 @@ - - 2023.0.1 - + diff --git a/src/SftpFileSystemx86/SftpFileSystemx86.csproj b/src/SftpFileSystemx86/SftpFileSystemx86.csproj index 249579e4..45b3096f 100644 --- a/src/SftpFileSystemx86/SftpFileSystemx86.csproj +++ b/src/SftpFileSystemx86/SftpFileSystemx86.csproj @@ -8,12 +8,15 @@ true true SftpFileSystemx86 + false + $(SolutionDir)..\bin\$(Configuration)\pluginsx86 + CA1416; - - ..\..\bin\Debug\pluginsx86\ + + False - - ..\..\bin\Release\pluginsx86\ + + True @@ -62,10 +65,8 @@ - - - 2023.0.1 - - + + + \ No newline at end of file diff --git a/src/WinFormsUI/Docking/DockPane.cs b/src/WinFormsUI/Docking/DockPane.cs index 378c415c..ec395b13 100644 --- a/src/WinFormsUI/Docking/DockPane.cs +++ b/src/WinFormsUI/Docking/DockPane.cs @@ -1,11 +1,8 @@ using System; using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; using System.Drawing; -using System.Drawing.Drawing2D; using System.Windows.Forms; -using System.Runtime.InteropServices; -using System.Security.Permissions; -using System.Diagnostics.CodeAnalysis; namespace WeifenLuo.WinFormsUI.Docking { @@ -955,7 +952,6 @@ protected override void OnLayout(LayoutEventArgs levent) base.OnLayout(levent); } - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] protected override void WndProc(ref Message m) { if (m.Msg == (int) Win32.Msgs.WM_MOUSEACTIVATE) diff --git a/src/WinFormsUI/Docking/DockPaneCaptionBase.cs b/src/WinFormsUI/Docking/DockPaneCaptionBase.cs index 4d79a777..2c2d5f92 100644 --- a/src/WinFormsUI/Docking/DockPaneCaptionBase.cs +++ b/src/WinFormsUI/Docking/DockPaneCaptionBase.cs @@ -1,8 +1,5 @@ -using System; -using System.Windows.Forms; using System.Drawing; -using System.Runtime.InteropServices; -using System.Security.Permissions; +using System.Windows.Forms; namespace WeifenLuo.WinFormsUI.Docking { @@ -83,7 +80,6 @@ protected override void OnMouseDown(MouseEventArgs e) } } - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] protected override void WndProc(ref Message m) { if (m.Msg == (int) Win32.Msgs.WM_LBUTTONDBLCLK) diff --git a/src/WinFormsUI/Docking/DockPaneStripBase.cs b/src/WinFormsUI/Docking/DockPaneStripBase.cs index f460ea95..62fce1bf 100644 --- a/src/WinFormsUI/Docking/DockPaneStripBase.cs +++ b/src/WinFormsUI/Docking/DockPaneStripBase.cs @@ -1,11 +1,10 @@ using System; -using System.Windows.Forms; -using System.Drawing; -using System.Drawing.Drawing2D; using System.Collections; using System.Collections.Generic; -using System.Security.Permissions; using System.Diagnostics.CodeAnalysis; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Windows.Forms; namespace WeifenLuo.WinFormsUI.Docking { @@ -121,7 +120,6 @@ protected override void OnMouseUp(MouseEventArgs e) } } - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] protected override void WndProc(ref Message m) { if (m.Msg == (int) Win32.Msgs.WM_LBUTTONDBLCLK) diff --git a/src/WinFormsUI/Docking/DockPanel.cs b/src/WinFormsUI/Docking/DockPanel.cs index e376e327..3b196b31 100644 --- a/src/WinFormsUI/Docking/DockPanel.cs +++ b/src/WinFormsUI/Docking/DockPanel.cs @@ -1,20 +1,18 @@ using System; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; +using System.Collections.Generic; using System.ComponentModel; -using System.Runtime.InteropServices; -using System.IO; -using System.Text; using System.Diagnostics.CodeAnalysis; -using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; // To simplify the process of finding the toolbox bitmap resource: // #1 Create an internal class called "resfinder" outside of the root namespace. // #2 Use "resfinder" in the toolbox bitmap attribute instead of the control name. // #3 use the "." string to locate the resource. // See: http://www.bobpowell.net/toolboxbitmap.htm +#pragma warning disable CS8981 // The type name only contains lower-cased ascii characters. Such names may become reserved for the language. internal class resfinder +#pragma warning restore CS8981 // The type name only contains lower-cased ascii characters. Such names may become reserved for the language. { } diff --git a/src/WinFormsUI/Docking/FloatWindow.cs b/src/WinFormsUI/Docking/FloatWindow.cs index 033df661..e341137a 100644 --- a/src/WinFormsUI/Docking/FloatWindow.cs +++ b/src/WinFormsUI/Docking/FloatWindow.cs @@ -1,10 +1,7 @@ using System; -using System.Collections; +using System.Diagnostics.CodeAnalysis; using System.Drawing; using System.Windows.Forms; -using System.Runtime.InteropServices; -using System.Security.Permissions; -using System.Diagnostics.CodeAnalysis; namespace WeifenLuo.WinFormsUI.Docking { @@ -223,7 +220,6 @@ protected override void SetBoundsCore(int x, int y, int width, int height, Bound base.SetBoundsCore(x, y, width, height, specified); } - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] protected override void WndProc(ref Message m) { if (m.Msg == (int) Win32.Msgs.WM_NCLBUTTONDOWN) diff --git a/src/WinFormsUI/WinFormsUI.csproj b/src/WinFormsUI/WinFormsUI.csproj index 0372df17..c5025e9b 100644 --- a/src/WinFormsUI/WinFormsUI.csproj +++ b/src/WinFormsUI/WinFormsUI.csproj @@ -28,12 +28,15 @@ false true true + false + $(SolutionDir)..\bin\$(Configuration) + CA1416; - - ..\..\bin\Debug\ + + False - - ..\..\bin\Release\ + + True @@ -105,16 +108,4 @@ - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - \ No newline at end of file