From 9b6dc190fefe05c357cd697425d72f6e65cff798 Mon Sep 17 00:00:00 2001 From: alexvaluyskiy Date: Tue, 11 Apr 2017 17:15:01 +0300 Subject: [PATCH] Support for NetStandard1.5 --- .gitattributes | 65 ++++ .gitignore | 69 +---- build.bat | 33 -- build.cmd | 1 + build.fsx | 281 +++++++++--------- build.ps1 | 129 ++++++++ .../ZipkinExample/Properties/AssemblyInfo.cs | 24 -- examples/ZipkinExample/ZipkinExample.csproj | 80 +---- src/CommonAssemblyInfo.cs | 15 - src/Zipkin.Collector.Kafka/KafkaSettings.cs | 2 + .../Properties/AssemblyInfo.cs | 3 - .../Zipkin.Collector.Kafka.csproj | 92 ++---- .../Zipkin.Collector.Kafka.nuspec | 22 -- src/Zipkin.Collector.Kafka/packages.config | 4 - src/Zipkin.Core/HttpCollector.cs | 2 + src/Zipkin.Core/Properties/AssemblyInfo.cs | 4 - src/Zipkin.Core/Thrift/Annotation.cs | 4 +- src/Zipkin.Core/Thrift/BinaryAnnotation.cs | 4 +- src/Zipkin.Core/Thrift/Endpoint.cs | 4 +- src/Zipkin.Core/Thrift/Span.cs | 5 +- src/Zipkin.Core/Zipkin.Core.csproj | 100 ++----- src/Zipkin.Core/Zipkin.Core.nuspec | 21 -- src/Zipkin.Core/ZipkinCollectorException.cs | 4 + src/Zipkin.Core/packages.config | 4 - .../Properties/AssemblyInfo.cs | 25 -- .../Zipkin.Core.Tests.csproj | 96 +----- tests/Zipkin.Core.Tests/packages.config | 9 - 27 files changed, 445 insertions(+), 657 deletions(-) create mode 100644 .gitattributes delete mode 100644 build.bat create mode 100644 build.cmd create mode 100644 build.ps1 delete mode 100644 src/CommonAssemblyInfo.cs delete mode 100644 src/Zipkin.Collector.Kafka/Zipkin.Collector.Kafka.nuspec delete mode 100644 src/Zipkin.Collector.Kafka/packages.config delete mode 100644 src/Zipkin.Core/Zipkin.Core.nuspec delete mode 100644 src/Zipkin.Core/packages.config delete mode 100644 tests/Zipkin.Core.Tests/packages.config diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3682a20 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,65 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain + +build.sh eol=lf diff --git a/.gitignore b/.gitignore index 454ede4..a50662f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,6 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. -# thrift-generated csharp files -gen-csharp/ - # User-specific files *.suo *.user @@ -20,14 +17,17 @@ gen-csharp/ [Rr]eleases/ x64/ x86/ +build/ bld/ [Bb]in/ [Oo]bj/ +.fake/ +TestResults/ +PerfResults/ +*.lock.json -# Visual Studio 2015 cache/options directory +# Visual Studo 2015 cache/options directory .vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ # MSTest test Results [Tt]est[Rr]esult*/ @@ -42,10 +42,6 @@ TestResult.xml [Rr]eleasePS/ dlldata.c -# DNX -project.lock.json -artifacts/ - *_i.c *_p.c *_i.h @@ -78,7 +74,6 @@ _Chutzpah* ipch/ *.aps *.ncb -*.opendb *.opensdf *.sdf *.cachefile @@ -87,7 +82,6 @@ ipch/ *.psess *.vsp *.vspx -*.sap # TFS 2012 Local Workspace $tf/ @@ -100,7 +94,7 @@ _ReSharper*/ *.[Rr]e[Ss]harper *.DotSettings.user -# JustCode is a .NET coding add-in +# JustCode is a .NET coding addin-in .JustCode # TeamCity is a build add-in @@ -112,7 +106,6 @@ _TeamCity* # NCrunch _NCrunch_* .*crunch*.local.xml -nCrunchTemp_* # MightyMoose *.mm.* @@ -140,7 +133,7 @@ publish/ # Publish Web Output *.[Pp]ublish.xml *.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings +# TODO: 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 @@ -153,33 +146,18 @@ publish/ !**/packages/build/ # Uncomment if necessary however generally it will be regenerated when needed #!**/packages/repositories.config -# NuGet v3's project.json files produces more ignoreable files -*.nuget.props -*.nuget.targets -# Microsoft Azure Build Output +# Windows Azure Build Output csx/ *.build.csdef -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Microsoft Azure ApplicationInsights config file -ApplicationInsights.config - # Windows Store app package directory AppPackages/ -BundleArtifacts/ - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ # Others +*.[Cc]ache ClientBin/ +[Ss]tyle[Cc]op.* ~$* *~ *.dbmdl @@ -187,7 +165,7 @@ ClientBin/ *.pfx *.publishsettings node_modules/ -orleans.codegen.cs +bower_components/ # RIA/Silverlight projects Generated_Code/ @@ -212,9 +190,6 @@ UpgradeLog*.htm # Microsoft Fakes FakesAssemblies/ -# GhostDoc plugin setting file -*.GhostDoc.xml - # Node.js Tools for Visual Studio .ntvs_analysis.dat @@ -224,19 +199,7 @@ FakesAssemblies/ # Visual Studio 6 workspace options file *.opt -# 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 - -# FAKE - F# Make -.fake/ - -# test results -TestResults.xml +tools/ +build/ +.nuget/ +.dotnet/ \ No newline at end of file diff --git a/build.bat b/build.bat deleted file mode 100644 index 224571c..0000000 --- a/build.bat +++ /dev/null @@ -1,33 +0,0 @@ -@echo off - -pushd %~dp0 - -SETLOCAL -SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe - -IF EXIST %CACHED_NUGET% goto copynuget -echo Downloading latest version of NuGet.exe... -IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet -@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'" - -:copynuget -IF EXIST .nuget\nuget.exe goto restore -md .nuget -copy %CACHED_NUGET% .nuget\nuget.exe > nul - -:restore - -.nuget\NuGet.exe update -self - -pushd %~dp0 - -.nuget\NuGet.exe update -self -.nuget\NuGet.exe install FAKE -ConfigFile .nuget\Nuget.Config -OutputDirectory packages -ExcludeVersion -Version 4.16.1 -.nuget\NuGet.exe install xunit.runner.console -ConfigFile .nuget\Nuget.Config -OutputDirectory packages -ExcludeVersion -Version 2.0.0 - -rem cls - -set encoding=utf-8 -packages\FAKE\tools\FAKE.exe build.fsx %* - -popd diff --git a/build.cmd b/build.cmd new file mode 100644 index 0000000..3cb534e --- /dev/null +++ b/build.cmd @@ -0,0 +1 @@ +PowerShell.exe -file "build.ps1" %* \ No newline at end of file diff --git a/build.fsx b/build.fsx index 33720a5..603da0f 100644 --- a/build.fsx +++ b/build.fsx @@ -1,172 +1,173 @@ -// -------------------------------------------------------------------------------------- -// FAKE build script -// -------------------------------------------------------------------------------------- +#I @"tools/FAKE/tools" +#r "FakeLib.dll" -#r @"packages/FAKE/tools/FakeLib.dll" -open Fake -open Fake.Git -open Fake.AssemblyInfoFile -open Fake.ReleaseNotesHelper open System open System.IO +open System.Text -let project = "Zipkin" -let summary = "A minimalistic .NET client library for Twitter Zipkin tracing." -let solutionFile = "Zipkin.sln" -let testAssemblies = "tests/**/bin/Release/*Tests*.dll" -let gitOwner = "openzipkin" -let gitHome = "https://github.com/" + gitOwner -let gitName = "Zipkin-csharp" -let gitRaw = environVarOrDefault "gitRaw" "https://raw.github.com/openzipkin" - -let binDir = currentDirectory @@ "bin" - -// Read additional information from the release notes document -let release = LoadReleaseNotes "RELEASE_NOTES.md" - -// Helper active pattern for project types -let (|Fsproj|Csproj|Vbproj|) (projFileName:string) = - match projFileName with - | f when f.EndsWith("fsproj") -> Fsproj - | f when f.EndsWith("csproj") -> Csproj - | f when f.EndsWith("vbproj") -> Vbproj - | _ -> failwith (sprintf "Project file %s not supported. Unknown project type." projFileName) - - - -// Copies binaries from default VS location to expected bin folder -// But keeps a subdirectory structure for each project in the -// src folder to support multiple project outputs -Target "CopyBinaries" (fun _ -> - !! "src/**/*.??proj" - |> Seq.map (fun f -> ((System.IO.Path.GetDirectoryName f) @@ "bin/Release", "bin" @@ (System.IO.Path.GetFileNameWithoutExtension f))) - |> Seq.iter (fun (fromDir, toDir) -> CopyDir toDir fromDir (fun _ -> true)) -) - -// -------------------------------------------------------------------------------------- -// Restore Packages +open Fake +open Fake.DotNetCli -Target "RestorePackages" (fun _ -> - let nugetExe = NuGetHelper.NuGetDefaults().ToolPath - let nugetCmd = "restore" - let result = ExecProcess (fun info -> - info.FileName <- nugetExe - info.Arguments <- nugetCmd)(TimeSpan.FromSeconds 10.0) - printfn "Restored packages." -) +// Variables +let configuration = "Release" -// -------------------------------------------------------------------------------------- -// Clean build results +// Directories +let output = __SOURCE_DIRECTORY__ @@ "bin" +let outputTests = output @@ "TestResults" +let outputNuGet = output @@ "nuget" Target "Clean" (fun _ -> - CleanDirs ["bin"; "temp"] -) + CleanDir output + CleanDir outputTests + CleanDir outputNuGet -Target "CleanDocs" (fun _ -> - CleanDirs ["docs/output"] + CleanDirs !! "./**/bin" + CleanDirs !! "./**/obj" ) -// -------------------------------------------------------------------------------------- -// Build library & test project +Target "RestorePackages" (fun _ -> + DotNetCli.Restore + (fun p -> + { p with + Project = "./Zipkin.sln" + NoCache = false }) +) Target "Build" (fun _ -> - !! solutionFile - |> MSBuildRelease "" "Rebuild" - |> ignore + let projects = !! "./**/*.csproj" + + let runSingleProject project = + DotNetCli.Build + (fun p -> + { p with + Project = project + Configuration = configuration }) + + projects |> Seq.iter (runSingleProject) ) -// -------------------------------------------------------------------------------------- -// Run the unit tests using test runner -open Fake.Testing.XUnit2 Target "RunTests" (fun _ -> - !! testAssemblies - |> xUnit2 (fun p -> - { p with - TimeOut = TimeSpan.FromMinutes 20. - XmlOutputPath = Some "TestResults.xml" - ToolPath = "packages/xunit.runner.console/tools/xunit.console.exe" }) -) + let projects = !! "./**/*.Tests.csproj" -// -------------------------------------------------------------------------------------- -// Build a NuGet package - -Target "NuGet" (fun _ -> - !! "src/**/*.nuspec" - |> Seq.toArray - |> Array.iter (fun nuspec -> - let project = Path.GetFileNameWithoutExtension nuspec - let dir = (Path.GetDirectoryName nuspec) - let packagesFile = dir @@ "packages.config" - let dependencies = NuGetHelper.getDependencies packagesFile - let buildDir = binDir @@ project - NuGetHelper.NuGetPack - (fun p -> + let runSingleProject project = + DotNetCli.Test + (fun p -> { p with - Copyright = "OpenZipkin Developers" - Project = project - Properties = ["Configuration", "Release"] - ReleaseNotes = release.Notes |> String.concat "\n" - Version = release.NugetVersion - IncludeReferencedProjects = true - OutputPath = buildDir - WorkingDir = dir - Dependencies = dependencies }) - (nuspec.Replace(".nuspec", ".csproj"))) -) + Project = project + Configuration = configuration }) -Target "PublishNuget" (fun _ -> - let rec publishPackage trialsLeft nupkg = - let nugetExe = NuGetHelper.NuGetDefaults().ToolPath - let key = getBuildParam "key" - let url = "https://www.nuget.org/api/v2/package" - let nugetCmd = sprintf "push \"%s\" %s -source %s" nupkg key url - tracefn "Pushing %s Attempts left: %d" nupkg trialsLeft - try - let result = ExecProcess (fun info -> - info.FileName <- nugetExe - info.WorkingDirectory <- (Path.GetDirectoryName nupkg) - info.Arguments <- nugetCmd) (TimeSpan.FromSeconds 10.0) - if result <> 0 then failwithf "Error during NuGet symbol push. %s %s" nugetExe nugetCmd - with exn -> - if (trialsLeft > 0) then (publishPackage (trialsLeft-1) nupkg) - else raise exn - - !! "**/*.nupkg" - |> Seq.toArray - |> Array.iter (publishPackage 5) + projects |> Seq.iter (runSingleProject) ) -Target "KeepRunning" (fun _ -> - use watcher = new FileSystemWatcher(DirectoryInfo("docs/content").FullName,"*.*") - watcher.EnableRaisingEvents <- true +//-------------------------------------------------------------------------------- +// Nuget targets +//-------------------------------------------------------------------------------- - traceImportant "Waiting for help edits. Press any key to stop." +Target "CreateNuget" (fun _ -> + let versionSuffix = getBuildParamOrDefault "versionsuffix" "" - System.Console.ReadKey() |> ignore + let projects = !! "src/**/Zipkin.Core.csproj" + ++ "src/**/Zipkin.Collector.Kafka.csproj" - watcher.EnableRaisingEvents <- false - watcher.Dispose() -) + let runSingleProject project = + DotNetCli.Pack + (fun p -> + { p with + Project = project + Configuration = configuration + AdditionalArgs = ["--include-symbols"] + VersionSuffix = versionSuffix + OutputPath = outputNuGet }) -Target "BuildPackage" DoNothing + projects |> Seq.iter (runSingleProject) +) -// -------------------------------------------------------------------------------------- -// Run all targets by default. Invoke 'build ' to override +Target "PublishNuget" (fun _ -> + let projects = !! "./build/nuget/*.nupkg" -- "./build/nuget/*.symbols.nupkg" + let apiKey = getBuildParamOrDefault "nugetkey" "" + let source = getBuildParamOrDefault "nugetpublishurl" "" + let symbolSource = getBuildParamOrDefault "symbolspublishurl" "" + + let runSingleProject project = + DotNetCli.RunCommand + (fun p -> + { p with + TimeOut = TimeSpan.FromMinutes 10. }) + (sprintf "nuget push %s --api-key %s --source %s --symbol-source %s" project apiKey source symbolSource) + + projects |> Seq.iter (runSingleProject) +) +//-------------------------------------------------------------------------------- +// Help +//-------------------------------------------------------------------------------- + +Target "Help" <| fun _ -> + List.iter printfn [ + "usage:" + "/build [target]" + "" + " Targets for building:" + " * Build Builds" + " * Nuget Create and optionally publish nugets packages" + " * RunTests Runs tests" + " * All Builds, run tests, creates and optionally publish nuget packages" + "" + " Other Targets" + " * Help Display this help" + ""] + +Target "HelpNuget" <| fun _ -> + List.iter printfn [ + "usage: " + "build Nuget [nugetkey= [nugetpublishurl=]] " + " [symbolspublishurl=] " + "" + "In order to publish a nuget package, keys must be specified." + "If a key is not specified the nuget packages will only be created on disk" + "After a build you can find them in build/nuget" + "" + "For pushing nuget packages to nuget.org and symbols to symbolsource.org" + "you need to specify nugetkey=" + " build Nuget nugetKey=" + "" + "For pushing the ordinary nuget packages to another place than nuget.org specify the url" + " nugetkey= nugetpublishurl= " + "" + "For pushing symbols packages specify:" + " symbolskey= symbolspublishurl= " + "" + "Examples:" + " build Nuget Build nuget packages to the build/nuget folder" + "" + " build Nuget versionsuffix=beta1 Build nuget packages with the custom version suffix" + "" + " build Nuget nugetkey=123 Build and publish to nuget.org and symbolsource.org" + "" + " build Nuget nugetprerelease=dev nugetkey=123 nugetpublishurl=http://abcsymbolspublishurl=http://xyz" + ""] + +//-------------------------------------------------------------------------------- +// Target dependencies +//-------------------------------------------------------------------------------- + +Target "BuildRelease" DoNothing Target "All" DoNothing +Target "Nuget" DoNothing + +// build dependencies +"Clean" ==> "RestorePackages" ==> "Build" ==> "BuildRelease" -"Clean" - ==> "RestorePackages" - ==> "Build" - ==> "CopyBinaries" - ==> "RunTests" - ==> "All" +// tests dependencies +"Clean" ==> "RestorePackages" ==> "Build" ==> "RunTests" -"All" - ==> "NuGet" - ==> "BuildPackage" +// nuget dependencies +"Clean" ==> "RestorePackages" ==> "Build" ==> "CreateNuget" +"CreateNuget" ==> "PublishNuget" +"PublishNuget" ==> "Nuget" -"BuildPackage" - ==> "PublishNuget" +// all +"BuildRelease" ==> "All" +"RunTests" ==> "All" -RunTargetOrDefault "All" +RunTargetOrDefault "Help" \ No newline at end of file diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 0000000..b5d7b4a --- /dev/null +++ b/build.ps1 @@ -0,0 +1,129 @@ +<# +.SYNOPSIS +This is a Powershell script to bootstrap a Fake build. +.DESCRIPTION +This Powershell script will download NuGet if missing, restore NuGet tools (including Fake) +and execute your Fake build script with the parameters you provide. +.PARAMETER Target +The build script target to run. +.PARAMETER Configuration +The build configuration to use. +.PARAMETER Verbosity +Specifies the amount of information to be displayed. +.PARAMETER WhatIf +Performs a dry run of the build script. +No tasks will be executed. +.PARAMETER ScriptArgs +Remaining arguments are added here. +#> + +[CmdletBinding()] +Param( + [string]$Target = "Default", + [ValidateSet("Release", "Debug")] + [string]$Configuration = "Release", + [ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")] + [string]$Verbosity = "Verbose", + [switch]$WhatIf, + [Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)] + [string[]]$ScriptArgs +) + +$FakeVersion = "4.58.5" +$DotNetChannel = "preview"; +$DotNetVersion = "1.0.1"; +$DotNetInstallerUri = "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.ps1"; +$NugetVersion = "4.1.0"; +$NugetUrl = "https://dist.nuget.org/win-x86-commandline/v$NugetVersion/nuget.exe" + +# Make sure tools folder exists +$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent +$ToolPath = Join-Path $PSScriptRoot "tools" +if (!(Test-Path $ToolPath)) { + Write-Verbose "Creating tools directory..." + New-Item -Path $ToolPath -Type directory | out-null +} + +########################################################################### +# INSTALL .NET CORE CLI +########################################################################### + +Function Remove-PathVariable([string]$VariableToRemove) +{ + $path = [Environment]::GetEnvironmentVariable("PATH", "User") + if ($path -ne $null) + { + $newItems = $path.Split(';', [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove } + [Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "User") + } + + $path = [Environment]::GetEnvironmentVariable("PATH", "Process") + if ($path -ne $null) + { + $newItems = $path.Split(';', [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove } + [Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "Process") + } +} + +# Get .NET Core CLI path if installed. +$FoundDotNetCliVersion = $null; +if (Get-Command dotnet -ErrorAction SilentlyContinue) { + $FoundDotNetCliVersion = dotnet --version; +} + +if($FoundDotNetCliVersion -ne $DotNetVersion) { + $InstallPath = Join-Path $PSScriptRoot ".dotnet" + if (!(Test-Path $InstallPath)) { + mkdir -Force $InstallPath | Out-Null; + } + (New-Object System.Net.WebClient).DownloadFile($DotNetInstallerUri, "$InstallPath\dotnet-install.ps1"); + & $InstallPath\dotnet-install.ps1 -Channel $DotNetChannel -Version $DotNetVersion -InstallDir $InstallPath; + + Remove-PathVariable "$InstallPath" + $env:PATH = "$InstallPath;$env:PATH" + $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + $env:DOTNET_CLI_TELEMETRY_OPTOUT=1 +} + +########################################################################### +# INSTALL NUGET +########################################################################### + +# Make sure nuget.exe exists. +$NugetPath = Join-Path $ToolPath "nuget.exe" +if (!(Test-Path $NugetPath)) { + Write-Host "Downloading NuGet.exe..." + (New-Object System.Net.WebClient).DownloadFile($NugetUrl, $NugetPath); +} + +########################################################################### +# INSTALL FAKE +########################################################################### +# Make sure Fake has been installed. + +$FakeExePath = Join-Path $ToolPath "FAKE/tools/FAKE.exe" +if (!(Test-Path $FakeExePath)) { + Write-Host "Installing Fake..." + Invoke-Expression "&`"$NugetPath`" install Fake -ExcludeVersion -Version $FakeVersion -OutputDirectory `"$ToolPath`"" | Out-Null; + if ($LASTEXITCODE -ne 0) { + Throw "An error occured while restoring Fake from NuGet." + } +} + +########################################################################### +# RUN BUILD SCRIPT +########################################################################### + +# Build the argument list. +$Arguments = @{ + target=$Target; + configuration=$Configuration; + verbosity=$Verbosity; + dryrun=$WhatIf; +}.GetEnumerator() | %{"--{0}=`"{1}`"" -f $_.key, $_.value }; + +# Start Fake +Write-Host "Running build script..." +Invoke-Expression "$FakeExePath `"build.fsx`" $ScriptArgs $Arguments" + +exit $LASTEXITCODE \ No newline at end of file diff --git a/examples/ZipkinExample/Properties/AssemblyInfo.cs b/examples/ZipkinExample/Properties/AssemblyInfo.cs index a1a8b04..4b9f2cd 100644 --- a/examples/ZipkinExample/Properties/AssemblyInfo.cs +++ b/examples/ZipkinExample/Properties/AssemblyInfo.cs @@ -2,17 +2,6 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ZipkinExample")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ZipkinExample")] -[assembly: AssemblyCopyright("Copyright © 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from @@ -21,16 +10,3 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("7d03ba73-ecc3-4295-9740-7b8e00552341")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/examples/ZipkinExample/ZipkinExample.csproj b/examples/ZipkinExample/ZipkinExample.csproj index a31596c..64e9c0b 100644 --- a/examples/ZipkinExample/ZipkinExample.csproj +++ b/examples/ZipkinExample/ZipkinExample.csproj @@ -1,69 +1,21 @@ - - - + + - Debug - AnyCPU - {7D03BA73-ECC3-4295-9740-7B8E00552341} - Exe - Properties - ZipkinExample - ZipkinExample - v4.5 - 512 + ZipkinExample + net45 - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - + - - {bb1c4b54-9638-40cb-a785-6228b391e621} - Zipkin.Collector.Kafka - - - {4bb262e2-3927-4e75-952a-f0cf8ddb36b9} - Zipkin.Core - + + - - + + + $(DefineConstants);SERIALIZATION + + + + $(DefineConstants);RELEASE + + \ No newline at end of file diff --git a/src/CommonAssemblyInfo.cs b/src/CommonAssemblyInfo.cs deleted file mode 100644 index 5584c04..0000000 --- a/src/CommonAssemblyInfo.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Reflection; - -[assembly: AssemblyVersion("0.1.0")] -[assembly: AssemblyFileVersion("0.1.0")] -[assembly: AssemblyCompany("OpenZipkin Developers")] -[assembly: AssemblyCopyright("OpenZipkin 2017")] -[assembly: AssemblyTrademark("Zipkin")] - -namespace System -{ - internal static class AssemblyVersionInformation - { - internal const string Version = "0.1.0"; - } -} diff --git a/src/Zipkin.Collector.Kafka/KafkaSettings.cs b/src/Zipkin.Collector.Kafka/KafkaSettings.cs index 218486a..41a5e74 100644 --- a/src/Zipkin.Collector.Kafka/KafkaSettings.cs +++ b/src/Zipkin.Collector.Kafka/KafkaSettings.cs @@ -9,7 +9,9 @@ namespace Zipkin.Tracer.Kafka { +#if SERIALIZATION [Serializable] +#endif public sealed class KafkaSettings { public static KafkaSettings Default => new KafkaSettings("zipkin", 20, 1000, new []{ "http://localhost:9092" }); diff --git a/src/Zipkin.Collector.Kafka/Properties/AssemblyInfo.cs b/src/Zipkin.Collector.Kafka/Properties/AssemblyInfo.cs index 87b9693..8c8fe67 100644 --- a/src/Zipkin.Collector.Kafka/Properties/AssemblyInfo.cs +++ b/src/Zipkin.Collector.Kafka/Properties/AssemblyInfo.cs @@ -2,7 +2,4 @@ using System.Reflection; using System.Runtime.CompilerServices; -[assembly: AssemblyTitleAttribute("Zipkin.Collector.Kafka")] -[assembly: AssemblyProductAttribute("Zipkin")] -[assembly: AssemblyDescriptionAttribute("A minimalistic .NET client library for Twitter Zipkin tracing.")] [assembly: InternalsVisibleToAttribute("Zipkin.Core.Tests")] diff --git a/src/Zipkin.Collector.Kafka/Zipkin.Collector.Kafka.csproj b/src/Zipkin.Collector.Kafka/Zipkin.Collector.Kafka.csproj index 1c3213d..509652e 100644 --- a/src/Zipkin.Collector.Kafka/Zipkin.Collector.Kafka.csproj +++ b/src/Zipkin.Collector.Kafka/Zipkin.Collector.Kafka.csproj @@ -1,72 +1,30 @@ - - - + + - Debug - AnyCPU - {BB1C4B54-9638-40CB-A785-6228B391E621} - Library - Properties - Zipkin.Collector.Kafka - Zipkin.Collector.Kafka - v4.5 - 512 + Zipkin.Collector.Kafka + A minimalistic .NET client library for Twitter Zipkin tracing. + Copyright 2017 Openzipkin + 0.2.0 + beta + OpenZipkin Developers + net45 + zipkin;tracing;distributed;performance;kafka + https://github.com/openzipkin/zipkin-csharp + https://github.com/openzipkin/zipkin-csharp/blob/master/LICENSE - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\packages\kafka-net.0.9.0.65\lib\net45\kafka-net.dll - True - - - - - - - - - - - - - Properties\CommonAssemblyInfo.cs - - - - - - - - {4bb262e2-3927-4e75-952a-f0cf8ddb36b9} - Zipkin.Core - - + - - + + + - - + + + $(DefineConstants);SERIALIZATION + + + + $(DefineConstants);RELEASE + + \ No newline at end of file diff --git a/src/Zipkin.Collector.Kafka/Zipkin.Collector.Kafka.nuspec b/src/Zipkin.Collector.Kafka/Zipkin.Collector.Kafka.nuspec deleted file mode 100644 index 38338a0..0000000 --- a/src/Zipkin.Collector.Kafka/Zipkin.Collector.Kafka.nuspec +++ /dev/null @@ -1,22 +0,0 @@ - - - - Zipkin.Collector.Kafka - $title$ - $version$ - $author$ - $author$ - false - https://github.com/openzipkin/zipkin-csharp/blob/master/LICENSE - https://github.com/openzipkin/zipkin-csharp - $description$ - $description$ - Nuget package - Openzipkin 2017 - zipkin tracing distributed performance - - - - - - \ No newline at end of file diff --git a/src/Zipkin.Collector.Kafka/packages.config b/src/Zipkin.Collector.Kafka/packages.config deleted file mode 100644 index 3a49418..0000000 --- a/src/Zipkin.Collector.Kafka/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/Zipkin.Core/HttpCollector.cs b/src/Zipkin.Core/HttpCollector.cs index 2ce0516..8cf32f6 100644 --- a/src/Zipkin.Core/HttpCollector.cs +++ b/src/Zipkin.Core/HttpCollector.cs @@ -47,7 +47,9 @@ public async Task CollectAsync(params Span[] spans) { ThriftSpanSerializer.WriteSpans(spans, output); output.Position = 0; +#if NET45 request.ContentLength = output.Length; +#endif using (var stream = await request.GetRequestStreamAsync()) { await output.CopyToAsync(stream); diff --git a/src/Zipkin.Core/Properties/AssemblyInfo.cs b/src/Zipkin.Core/Properties/AssemblyInfo.cs index bd397cd..90f3bf1 100644 --- a/src/Zipkin.Core/Properties/AssemblyInfo.cs +++ b/src/Zipkin.Core/Properties/AssemblyInfo.cs @@ -1,8 +1,4 @@ // -using System.Reflection; using System.Runtime.CompilerServices; -[assembly: AssemblyTitleAttribute("Zipkin.Core")] -[assembly: AssemblyProductAttribute("Zipkin")] -[assembly: AssemblyDescriptionAttribute("A minimalistic .NET client library for Twitter Zipkin tracing.")] [assembly: InternalsVisibleToAttribute("Zipkin.Core.Tests")] diff --git a/src/Zipkin.Core/Thrift/Annotation.cs b/src/Zipkin.Core/Thrift/Annotation.cs index bc0a715..7d16692 100644 --- a/src/Zipkin.Core/Thrift/Annotation.cs +++ b/src/Zipkin.Core/Thrift/Annotation.cs @@ -16,7 +16,7 @@ namespace Zipkin.Thrift /// /// Unlike log statements, annotations are often codes: for example "sr". /// -#if !SILVERLIGHT +#if SERIALIZATION [Serializable] #endif internal sealed class Annotation : TBase @@ -78,7 +78,7 @@ public Endpoint Host internal Isset __isset; -#if !SILVERLIGHT +#if SERIALIZATION [Serializable] #endif internal struct Isset diff --git a/src/Zipkin.Core/Thrift/BinaryAnnotation.cs b/src/Zipkin.Core/Thrift/BinaryAnnotation.cs index 6139cd3..43b6b59 100644 --- a/src/Zipkin.Core/Thrift/BinaryAnnotation.cs +++ b/src/Zipkin.Core/Thrift/BinaryAnnotation.cs @@ -25,7 +25,7 @@ namespace Zipkin.Thrift /// rewriting, like "/api/v1/myresource" vs "/myresource. Via the host field, /// you can see the different points of view, which often help in debugging. /// -#if !SILVERLIGHT +#if SERIALIZATION [Serializable] #endif internal sealed class BinaryAnnotation : TBase @@ -111,7 +111,7 @@ public Endpoint Host internal Isset __isset; -#if !SILVERLIGHT +#if SERIALIZATION [Serializable] #endif internal struct Isset diff --git a/src/Zipkin.Core/Thrift/Endpoint.cs b/src/Zipkin.Core/Thrift/Endpoint.cs index 8717b77..206287c 100644 --- a/src/Zipkin.Core/Thrift/Endpoint.cs +++ b/src/Zipkin.Core/Thrift/Endpoint.cs @@ -19,7 +19,7 @@ namespace Zipkin.Thrift /// allows zipkin to display network context of uninstrumented services, or /// clients such as web browsers. /// -#if !SILVERLIGHT +#if SERIALIZATION [Serializable] #endif internal sealed class Endpoint : TBase @@ -95,7 +95,7 @@ public string ServiceName internal Isset __isset; -#if !SILVERLIGHT +#if SERIALIZATION [Serializable] #endif internal struct Isset diff --git a/src/Zipkin.Core/Thrift/Span.cs b/src/Zipkin.Core/Thrift/Span.cs index 169200a..8c2fed3 100644 --- a/src/Zipkin.Core/Thrift/Span.cs +++ b/src/Zipkin.Core/Thrift/Span.cs @@ -25,7 +25,7 @@ namespace Zipkin.Thrift /// Span identifiers are packed into i64s, but should be treated opaquely. /// String encoding is fixed-width lower-hex, to avoid signed interpretation. /// -#if !SILVERLIGHT +#if SERIALIZATION [Serializable] #endif internal sealed class Span : TBase @@ -222,9 +222,8 @@ public long Duration } } - internal Isset __isset; -#if !SILVERLIGHT +#if SERIALIZATION [Serializable] #endif internal struct Isset diff --git a/src/Zipkin.Core/Zipkin.Core.csproj b/src/Zipkin.Core/Zipkin.Core.csproj index 86b0ac7..a7a43bd 100644 --- a/src/Zipkin.Core/Zipkin.Core.csproj +++ b/src/Zipkin.Core/Zipkin.Core.csproj @@ -1,81 +1,29 @@ - - - + + - Debug - AnyCPU - {4BB262E2-3927-4E75-952A-F0CF8DDB36B9} - Library - Properties - Zipkin.Core - Zipkin.Core - v4.5 - 512 + Zipkin.Core + A minimalistic .NET client library for Twitter Zipkin tracing. + Copyright 2017 Openzipkin + 0.2.0 + beta + OpenZipkin Developers + net45;netstandard1.5 + zipkin;tracing;distributed;performance + https://github.com/openzipkin/zipkin-csharp + https://github.com/openzipkin/zipkin-csharp/blob/master/LICENSE + 1.6.1 - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - ..\..\packages\ApacheThrift.0.9.3\lib\Thrift.dll - True - - + - - Properties\CommonAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - + - - - - - - - + + + $(DefineConstants);SERIALIZATION + + + + $(DefineConstants);RELEASE + + \ No newline at end of file diff --git a/src/Zipkin.Core/Zipkin.Core.nuspec b/src/Zipkin.Core/Zipkin.Core.nuspec deleted file mode 100644 index f766183..0000000 --- a/src/Zipkin.Core/Zipkin.Core.nuspec +++ /dev/null @@ -1,21 +0,0 @@ - - - - Zipkin.Core - $title$ - $version$ - $author$ - $author$ - false - https://github.com/openzipkin/zipkin-csharp/blob/master/LICENSE - https://github.com/openzipkin/zipkin-csharp - $description$ - $description$ - Nuget package - Openzipkin 2017 - zipkin tracing distributed performance - - - - - \ No newline at end of file diff --git a/src/Zipkin.Core/ZipkinCollectorException.cs b/src/Zipkin.Core/ZipkinCollectorException.cs index 978b663..a903e76 100644 --- a/src/Zipkin.Core/ZipkinCollectorException.cs +++ b/src/Zipkin.Core/ZipkinCollectorException.cs @@ -9,7 +9,9 @@ namespace Zipkin { +#if SERIALIZATION [Serializable] +#endif public class ZipkinCollectorException : Exception { public ZipkinCollectorException() @@ -24,10 +26,12 @@ public ZipkinCollectorException(string message, Exception inner) : base(message, { } +#if SERIALIZATION protected ZipkinCollectorException( SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif } } \ No newline at end of file diff --git a/src/Zipkin.Core/packages.config b/src/Zipkin.Core/packages.config deleted file mode 100644 index 3f1dbac..0000000 --- a/src/Zipkin.Core/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/tests/Zipkin.Core.Tests/Properties/AssemblyInfo.cs b/tests/Zipkin.Core.Tests/Properties/AssemblyInfo.cs index ba57b66..5c83f9c 100644 --- a/tests/Zipkin.Core.Tests/Properties/AssemblyInfo.cs +++ b/tests/Zipkin.Core.Tests/Properties/AssemblyInfo.cs @@ -2,18 +2,6 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Zipkin.Tracer.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Zipkin.Tracer.Tests")] -[assembly: AssemblyCopyright("Copyright © 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. @@ -21,16 +9,3 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("baffcfd1-84ef-4896-a28c-eb97500f5224")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/tests/Zipkin.Core.Tests/Zipkin.Core.Tests.csproj b/tests/Zipkin.Core.Tests/Zipkin.Core.Tests.csproj index 55ce330..5da95c8 100644 --- a/tests/Zipkin.Core.Tests/Zipkin.Core.Tests.csproj +++ b/tests/Zipkin.Core.Tests/Zipkin.Core.Tests.csproj @@ -1,92 +1,20 @@ - - - - + - Debug - AnyCPU - {BAFFCFD1-84EF-4896-A28C-EB97500F5224} - Library - Properties - Zipkin.Core.Tests Zipkin.Core.Tests - v4.5 - 512 - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + net452;netcoreapp1.1 + - - - - - - - - - - ..\..\packages\ApacheThrift.0.9.3\lib\Thrift.dll - True - - - ..\..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll - True - - - ..\..\packages\xunit.assert.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.assert.dll - True - - - ..\..\packages\xunit.extensibility.core.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.dll - True - + + - - - + + + - - - {4bb262e2-3927-4e75-952a-f0cf8ddb36b9} - Zipkin.Core - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - + + + $(DefineConstants);RELEASE + \ No newline at end of file diff --git a/tests/Zipkin.Core.Tests/packages.config b/tests/Zipkin.Core.Tests/packages.config deleted file mode 100644 index d24c407..0000000 --- a/tests/Zipkin.Core.Tests/packages.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file