Skip to content

Commit

Permalink
Upgrade deps
Browse files Browse the repository at this point in the history
  • Loading branch information
haf committed May 10, 2020
1 parent cca2d28 commit 74214de
Show file tree
Hide file tree
Showing 67 changed files with 856 additions and 1,449 deletions.
18 changes: 18 additions & 0 deletions .config/dotnet-tools.json
@@ -0,0 +1,18 @@
{
"version": 1,
"isRoot": true,
"tools": {
"paket": {
"version": "5.242.2",
"commands": [
"paket"
]
},
"fake-cli": {
"version": "5.19.1",
"commands": [
"fake"
]
}
}
}
4 changes: 2 additions & 2 deletions Dockerfile
Expand Up @@ -28,7 +28,7 @@ RUN find 'src/targets' -type f \
-or -name 'Logary.Targets.*.pdb' \
-or -name 'Logary.Targets.*.xml' \) \
-not -path '*/obj/*' \
-exec cp {} src/services/Logary.Services.Rutta/bin/Release/netcoreapp2.2/linux-x64/publish/ \;
-exec cp {} src/services/Logary.Services.Rutta/bin/Release/netcoreapp3.1/linux-x64/publish/ \;

#-alpine
FROM microsoft/dotnet:2.2-runtime
Expand All @@ -43,7 +43,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
ldconfig

WORKDIR /logary/
COPY --from=build /build/src/services/Logary.Services.Rutta/bin/Release/netcoreapp2.2/linux-x64/publish/* /logary/
COPY --from=build /build/src/services/Logary.Services.Rutta/bin/Release/netcoreapp3.1/linux-x64/publish/* /logary/

ENTRYPOINT ["dotnet", "/logary/rutta.dll"]
CMD []
21 changes: 21 additions & 0 deletions NuGet.props
@@ -0,0 +1,21 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<Authors>Henrik Feldt and contributors</Authors>
<Owners>Henrik Feldt</Owners>
<Copyright>Copyright 2020 Authors &amp; contributors</Copyright>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/logary/logary</PackageProjectUrl>
<PackageIcon>expecto-logo-small.png</PackageIcon>
<PackageTags>test;testing;fsharp;assert;expect;stress;performance;unit;random;property</PackageTags>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)/AssemblyInfo.fs" />
<None Include="$(MSBuildThisFileDirectory)/docs/expecto-logo-small.png" Pack="true" PackagePath="" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion appveyor.yml
Expand Up @@ -4,4 +4,4 @@ image:
build_script:
- cmd: fake.cmd build

test: off
test: off
97 changes: 37 additions & 60 deletions build.fsx
Expand Up @@ -11,15 +11,15 @@

open System
open System.IO
open Fake.Api
open Fake.BuildServer
open Fake.Core
open Fake.Core.TargetOperators
open Fake.DotNet
open Fake.IO
open Fake.Tools
open Fake.IO.Globbing.Operators
open Fake.Core.TargetOperators
open Fake.Api
open Fake.BuildServer
open Fake.SystemHelper
open Fake.Tools

Environment.CurrentDirectory <- __SOURCE_DIRECTORY__

Expand All @@ -28,17 +28,19 @@ let configuration =
|> DotNet.BuildConfiguration.fromString

let release = ReleaseNotes.load "RELEASE_NOTES.md"
let description = "Logary is a high performance, multi-target logging, metric and health-check library for mono and .Net."
let tags = "structured logging f# logs logging performance metrics semantic"
let authors = "Henrik Feldt"
let owners = "Henrik Feldt"
let projectUrl = "https://github.com/logary/logary"
let iconUrl = "https://raw.githubusercontent.com/logary/logary-assets/master/graphics/LogaryLogoSquare.png"
let licenceUrl = "https://raw.githubusercontent.com/logary/logary/master/LICENSE.md"
let copyright = sprintf "Copyright \169 %i Henrik Feldt" DateTime.Now.Year
let testFramework = "netcoreapp3.1"
let dotnetExePath = "dotnet"

let githubToken = lazy(Environment.environVarOrFail "GITHUB_TOKEN")
let nugetToken = lazy(Environment.environVarOrFail "NUGET_TOKEN")

let pkgPath = Path.GetFullPath "./pkg"

BuildServer.install [
Travis.Installer
AppVeyor.Installer
]

let testProjects =
!! "src/tests/**/*.fsproj"
++ "src/services/*.Tests/*.fsproj"
Expand All @@ -54,12 +56,11 @@ let libProjects =
++ "src/Logary.Prometheus/Logary.Prometheus.fsproj"
++ "src/Logary.CSharp/Logary.CSharp.csproj"

let envRequired k =
let v = Environment.GetEnvironmentVariable k
if isNull v then failwithf "Missing environment key '%s'." k
v

Target.create "Clean" <| fun _ ->
!! "./**/bin/"
++ "./**/obj/"
++ pkgPath
|> Shell.cleanDirs
// This line actually ensures we get the correct version checked in
// instead of the one previously bundled with 'fake`
Git.CommandHelper.gitCommand "" "checkout .paket/Paket.Restore.targets"
Expand All @@ -78,8 +79,6 @@ Target.create "AssemblyInfo" (fun _ ->
|> Seq.iter (fun (proj, subPath) ->
[ AssemblyInfo.Title proj
AssemblyInfo.Product proj
AssemblyInfo.Copyright copyright
AssemblyInfo.Description description
AssemblyInfo.Version release.AssemblyVersion
AssemblyInfo.FileVersion release.AssemblyVersion
]
Expand Down Expand Up @@ -122,56 +121,38 @@ Target.create "PaketFiles" (fun _ ->
"paket-files/haf/DVar/src/DVar/DVar.fs"
)

Target.create "TCReportVersion" (fun _ ->
[ yield "version", release.SemVer.ToString()
yield "major", string release.SemVer.Major
yield "minor", string release.SemVer.Minor
yield "build", string release.SemVer.Build
yield "special", release.SemVer.PreRelease |> Option.map (sprintf "%O") |> function None -> "" | Some x -> x
]
|> Seq.filter (snd >> String.IsNullOrWhiteSpace >> not)
|> Seq.iter (fun (name, value) -> TeamCity.setParameter (sprintf "ver.%s" name) value)
)

/// This also restores.
Target.create "Build" <| fun _ ->
let msbuildParams =
{ MSBuild.CliArguments.Create() with
Verbosity = Some Quiet
NoLogo = true
Properties = [ "Optimize", "true"; "DebugSymbols", "true"; "Version", release.AssemblyVersion ] }

let setParams (o: DotNet.BuildOptions) =
{ o with
Configuration = configuration
MSBuildParams = msbuildParams }

DotNet.build setParams "src/Logary.sln"

Target.create "Tests" (fun _ ->
let commandLine (file: string) =
let projectName = file.Substring(0, file.Length - ".fsproj".Length) |> Path.GetFileName
let path = Path.GetDirectoryName file
sprintf "%s/bin/%O/netcoreapp2.2/%s.dll --summary" path configuration projectName
sprintf "%s/bin/%O/%s/%s.dll --summary" path configuration testFramework projectName
testProjects
|> Seq.iter (commandLine >> DotNet.exec id "" >> ignore))
|> Seq.iter (commandLine >> DotNet.exec id "" >> ignore))

Target.create "Pack" <| fun _ ->
let args =
{ MSBuild.CliArguments.Create() with
NoLogo = true
DoRestore = false
Properties =
[ "PackageVersion", release.NugetVersion
"Authors", authors
"Owners", owners
"PackageRequireLicenseAcceptance", "true"
"Description", description.Replace(",","")
"PackageReleaseNotes", (release.Notes |> String.toLines).Replace(",","").Replace(";", "")
"Copyright", copyright
"PackageTags", tags
"PackageProjectUrl", projectUrl
"PackageIconUrl", iconUrl
"PackageLicenseUrl", licenceUrl
]
Properties = [
"Version", release.NugetVersion
"PackageReleaseNotes", String.toLines release.Notes
]
}
let pkgSln = SlnTools.createTempSolutionFile libProjects
let setParams (p: DotNet.PackOptions) =
Expand All @@ -184,22 +165,19 @@ Target.create "Pack" <| fun _ ->
Target.create "Push" <| fun _ ->
let setParams (p: Paket.PaketPushParams) =
{ p with
ToolPath = Path.GetFullPath "./.paket/paket"
WorkingDir = pkgPath
ApiKey = envRequired "NUGET_TOKEN" }
// for f in *.nupkg; do ../.paket/paket push --api-key $NUGET_TOKEN $f; done
ApiKey = nugetToken.Value }
// for f in *.nupkg; do dotnet paket push --api-key $NUGET_TOKEN $f; done
Paket.push setParams

Target.create "CheckEnv" <| fun _ ->
ignore (envRequired "GITHUB_TOKEN")
ignore (envRequired "NUGET_TOKEN")
ignore (githubToken.Value)
ignore (nugetToken.Value)

Target.create "Release" (fun _ ->
let gitOwner, gitName = "logary", "logary"
let gitOwnerName = gitOwner + "/" + gitName
Target.create "Release" <| fun _ ->
let remote =
Git.CommandHelper.getGitResult "" "remote -v"
|> Seq.tryFind (fun s -> s.EndsWith "(push)" && s.Contains gitOwnerName)
|> Seq.tryFind (fun s -> s.EndsWith "(push)" && s.Contains "logary/logary")
|> function None -> "git@github.com:logary/logary.git"
| Some s -> s.Split().[0]

Expand All @@ -210,24 +188,23 @@ Target.create "Release" (fun _ ->
Git.Branches.tag "" release.NugetVersion
Git.Branches.pushTag "" remote release.NugetVersion

GitHub.createClientWithToken (envRequired "GITHUB_TOKEN")
|> GitHub.draftNewRelease gitOwner gitName release.NugetVersion
(Option.isSome release.SemVer.PreRelease) release.Notes
githubToken.Value
|> GitHub.createClientWithToken
|> GitHub.draftNewRelease "logary" "logary" release.NugetVersion
release.SemVer.PreRelease.IsSome release.Notes
|> GitHub.publishDraft
|> Async.RunSynchronously
)

"CheckEnv"
==> "Release"

"Clean"
==> "AssemblyInfo"
==> "PaketFiles"
=?> ("TCReportVersion", TeamCity.Environment.Version |> Option.isSome)
==> "Build"
==> "Tests"
==> "Pack"
==> "Push"
==> "Release"

Target.runOrDefault "Pack"
Target.runOrDefault "Pack"
14 changes: 0 additions & 14 deletions docker-compose

This file was deleted.

41 changes: 0 additions & 41 deletions docker-compose.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion examples/Logary.CSharpExample/Logary.CSharpExample.csproj
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyName>Logary.CSharpExample</AssemblyName>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/Logary.ConsoleApp/Logary.ConsoleApp.fsproj
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyName>Logary.ConsoleApp</AssemblyName>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp2.2</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<NoWarn>MSB3277</NoWarn>

<DebugSymbols>true</DebugSymbols>
Expand Down
2 changes: 1 addition & 1 deletion examples/Logary.Suave/Logary.Suave.fsproj
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyName>Logary.Suave</AssemblyName>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp2.2</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<DebugSymbols>true</DebugSymbols>
<Tailcalls>true</Tailcalls>
<GenerateTailCalls>true</GenerateTailCalls>
Expand Down
2 changes: 1 addition & 1 deletion examples/Servizz/Servizz.fsproj
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyName>Servizz</AssemblyName>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp2.2</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<DebugSymbols>true</DebugSymbols>
<Tailcalls>true</Tailcalls>
<GenerateTailCalls>true</GenerateTailCalls>
Expand Down
14 changes: 4 additions & 10 deletions fake.cmd
@@ -1,10 +1,4 @@
SET TOOL_PATH=.fake


IF NOT EXIST "%TOOL_PATH%\fake.exe" (
dotnet tool install fake-cli --tool-path ./%TOOL_PATH%
)

dotnet tool install paket --tool-path .paket --version 5.242.1

"%TOOL_PATH%/fake.exe" %*
@echo off

dotnet tool restore
dotnet tool run fake %*
4 changes: 2 additions & 2 deletions fake.sh
Expand Up @@ -3,5 +3,5 @@
set -eu
set -o pipefail

./tools/install-tools
.fake/fake "$@"
dotnet tool restore
dotnet tool run fake $@
7 changes: 7 additions & 0 deletions global.json
@@ -0,0 +1,7 @@

{
"sdk": {
"version": "3.1.200",
"rollForward": "latestFeature"
}
}

1 comment on commit 74214de

@vercel
Copy link

@vercel vercel bot commented on 74214de May 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.