Skip to content

Commit bb0a5eb

Browse files
committed
Merge branch 'master' into feature/trim-workaround
2 parents 01abe09 + 999fbbc commit bb0a5eb

11 files changed

Lines changed: 165 additions & 52 deletions

File tree

.config/dotnet-tools.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"paket": {
6-
"version": "5.247.4",
6+
"version": "5.257.0",
77
"commands": [
88
"paket"
99
]
@@ -15,7 +15,7 @@
1515
]
1616
},
1717
"nbgv": {
18-
"version": "3.1.91",
18+
"version": "3.3.37",
1919
"commands": [
2020
"nbgv"
2121
]

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup dotnet
1717
uses: actions/setup-dotnet@v1
1818
with:
19-
dotnet-version: '3.1.301'
19+
dotnet-version: '5.0.100'
2020

2121
- name: NuGet cache
2222
uses: actions/cache@v1
@@ -31,7 +31,7 @@ jobs:
3131
if echo "${{github.ref}}" | grep -q "^refs/heads/"; then
3232
git checkout "$(echo ${{github.ref}} | sed -E 's|^refs/heads/||')";
3333
fi
34-
./build.sh
34+
DOTNET_RUNTIME_IDENTIFIER=linux-x64 ./build.sh
3535
3636
- name: Upload nupkg
3737
uses: actions/upload-artifact@v1
@@ -50,7 +50,7 @@ jobs:
5050
- name: Setup dotnet
5151
uses: actions/setup-dotnet@v1
5252
with:
53-
dotnet-version: '3.1.402'
53+
dotnet-version: '5.0.100'
5454

5555
- name: Prepare
5656
run: |

FSharp.SystemTextJson.sln

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmarks", "benchmarks",
2929
EndProject
3030
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.SystemTextJson.Benchmarks", "benchmarks\FSharp.SystemTextJson.Benchmarks\FSharp.SystemTextJson.Benchmarks.fsproj", "{507E640D-9E7B-4386-994B-913E4CDD64D0}"
3131
EndProject
32+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.SystemTextJson.TrimTest", "tests\FSharp.SystemTextJson.TrimTest\FSharp.SystemTextJson.TrimTest.fsproj", "{66F4BDA9-D9E9-4B6E-8CCE-0606D20FADBE}"
33+
EndProject
3234
Global
3335
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3436
Debug|Any CPU = Debug|Any CPU
@@ -75,6 +77,18 @@ Global
7577
{507E640D-9E7B-4386-994B-913E4CDD64D0}.Release|x64.Build.0 = Release|Any CPU
7678
{507E640D-9E7B-4386-994B-913E4CDD64D0}.Release|x86.ActiveCfg = Release|Any CPU
7779
{507E640D-9E7B-4386-994B-913E4CDD64D0}.Release|x86.Build.0 = Release|Any CPU
80+
{66F4BDA9-D9E9-4B6E-8CCE-0606D20FADBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
81+
{66F4BDA9-D9E9-4B6E-8CCE-0606D20FADBE}.Debug|Any CPU.Build.0 = Debug|Any CPU
82+
{66F4BDA9-D9E9-4B6E-8CCE-0606D20FADBE}.Debug|x64.ActiveCfg = Debug|Any CPU
83+
{66F4BDA9-D9E9-4B6E-8CCE-0606D20FADBE}.Debug|x64.Build.0 = Debug|Any CPU
84+
{66F4BDA9-D9E9-4B6E-8CCE-0606D20FADBE}.Debug|x86.ActiveCfg = Debug|Any CPU
85+
{66F4BDA9-D9E9-4B6E-8CCE-0606D20FADBE}.Debug|x86.Build.0 = Debug|Any CPU
86+
{66F4BDA9-D9E9-4B6E-8CCE-0606D20FADBE}.Release|Any CPU.ActiveCfg = Release|Any CPU
87+
{66F4BDA9-D9E9-4B6E-8CCE-0606D20FADBE}.Release|Any CPU.Build.0 = Release|Any CPU
88+
{66F4BDA9-D9E9-4B6E-8CCE-0606D20FADBE}.Release|x64.ActiveCfg = Release|Any CPU
89+
{66F4BDA9-D9E9-4B6E-8CCE-0606D20FADBE}.Release|x64.Build.0 = Release|Any CPU
90+
{66F4BDA9-D9E9-4B6E-8CCE-0606D20FADBE}.Release|x86.ActiveCfg = Release|Any CPU
91+
{66F4BDA9-D9E9-4B6E-8CCE-0606D20FADBE}.Release|x86.Build.0 = Release|Any CPU
7892
EndGlobalSection
7993
GlobalSection(SolutionProperties) = preSolution
8094
HideSolutionNode = FALSE
@@ -83,6 +97,7 @@ Global
8397
{5DD5F99C-D4B4-4DF6-A638-EEE6B0CCCAFB} = {79B2E5F7-01BA-459B-9269-71D41C73D228}
8498
{FD908F6A-5B23-4FAA-B52B-65379E6D5539} = {CC287195-657A-4E49-A957-4D4B5919ACFB}
8599
{507E640D-9E7B-4386-994B-913E4CDD64D0} = {E7CE56A4-261F-495E-B1AE-F0333FF932CA}
100+
{66F4BDA9-D9E9-4B6E-8CCE-0606D20FADBE} = {CC287195-657A-4E49-A957-4D4B5919ACFB}
86101
EndGlobalSection
87102
GlobalSection(ExtensibilityGlobals) = postSolution
88103
SolutionGuid = {78789C56-BAE0-436E-BDDF-789B98CEC9A5}

benchmarks/FSharp.SystemTextJson.Benchmarks/FSharp.SystemTextJson.Benchmarks.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.0</TargetFramework>
5+
<TargetFramework>net5.0</TargetFramework>
66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
88
<PropertyGroup Condition="'$(Configuration)'=='Release'">

build.fsx

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ module Paths =
3232
let sln = root </> "FSharp.SystemTextJson.sln"
3333
let out = root </> "bin"
3434
let nugetOut = out </> "nuget"
35+
let test = root </> "tests" </> "FSharp.SystemTextJson.Tests"
3536
let benchmarks = root </> "benchmarks" </> "FSharp.SystemTextJson.Benchmarks"
37+
let trimTest = root </> "tests" </> "FSharp.SystemTextJson.TrimTest"
38+
let trimTestOut rti = trimTest </> "bin" </> "Release" </> "net5.0" </> rti </> "publish" </> "FSharp.SystemTextJson.TrimTest.dll"
3639

3740
Target.create "Clean" (fun _ ->
3841
!! "**/bin"
@@ -60,24 +63,45 @@ Target.create "Test" (fun _ ->
6063
Logger = Some "trx"
6164
ResultsDirectory = Some Paths.out
6265
}
63-
) Paths.sln
66+
) Paths.test
6467
)
6568

69+
let checkOk (name: string) (r: ProcessResult) =
70+
if not r.OK then
71+
failwithf "%s failed with code %d:\n%A" name r.ExitCode r.Errors
72+
73+
Target.create "TestTrim" <| fun _ ->
74+
let rti = Environment.environVarOrDefault "DOTNET_RUNTIME_IDENTIFIER" "win-x64"
75+
DotNet.publish (fun o ->
76+
{ o with
77+
SelfContained = Some true
78+
Runtime = Some rti
79+
MSBuildParams =
80+
{ o.MSBuildParams with
81+
Properties = [
82+
"PublishTrimmed", "true"
83+
"TrimMode", "Link"
84+
]
85+
}
86+
}
87+
) Paths.trimTest
88+
let dll = Paths.trimTestOut rti
89+
DotNet.exec id dll dll
90+
|> checkOk "Trim test"
91+
6692
/// This target doesn't need a dependency chain, because the benchmarks actually wrap and build the referenced
6793
/// project(s) as part of the run.
6894
Target.create "Benchmark" (fun _ ->
6995
DotNet.exec (fun o -> { o with
7096
WorkingDirectory = Paths.benchmarks } ) "run" "-c release --filter \"*\""
71-
|> fun r ->
72-
if r.OK
73-
then ()
74-
else failwithf "Benchmarks failed with code %d:\n%A" r.ExitCode r.Errors
97+
|> checkOk "Benchmarks"
7598
)
7699

77100
Target.create "All" ignore
78101

79102
"Build"
80103
==> "Test"
104+
==> "TestTrim"
81105
==> "Pack"
82106
==> "All"
83107

paket.dependencies

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
frameworks netstandard2.0, netcoreapp3.0
1+
frameworks netstandard2.0, netcoreapp3.0, net5.0
22
storage none
33
source https://api.nuget.org/v3/index.json
44

@@ -9,6 +9,7 @@ nuget Microsoft.SourceLink.GitHub prerelease copy_local:true
99
nuget Nerdbank.GitVersioning copy_local:true
1010
nuget System.Text.Json >= 4.6.0 lowest_matching: true
1111
nuget xunit ~> 2.4.0
12+
nuget xunit.console ~> 2.4.0
1213
nuget xunit.runner.visualstudio ~> 2.4.0
1314
nuget BenchmarkDotNet
1415
nuget Newtonsoft.Json

0 commit comments

Comments
 (0)