Skip to content

Commit 950e5bb

Browse files
authored
UseArtifactsOutput (#2987)
* Update to dotnet 8 SDK. * Update docs to match new binary path * --tl baby! * Update to latest BenchmarkDotNet * Use prerelease of Benchmark dotnet. * Update bdn-nightly mapping
1 parent f293412 commit 950e5bb

File tree

17 files changed

+59
-55
lines changed

17 files changed

+59
-55
lines changed

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Some common use cases include:
3535
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
3636
<RestoreLockedMode>true</RestoreLockedMode>
3737
<NoWarn>NU1603</NoWarn>
38+
<UseArtifactsOutput>true</UseArtifactsOutput>
3839
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
3940
<!-- https://www.gresearch.co.uk/blog/article/improve-nuget-restores-with-static-graph-evaluation/ -->
4041
<RestoreUseStaticGraphEvaluation>true</RestoreUseStaticGraphEvaluation>

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<PackageVersion Include="Ignore" Version="0.1.50" />
2828
<PackageVersion Include="System.IO.Abstractions" Version="20.0.4" />
2929
<PackageVersion Include="Spectre.Console" Version="0.48.0" />
30-
<PackageVersion Include="BenchmarkDotNet" Version="0.13.11" />
30+
<PackageVersion Include="BenchmarkDotNet" Version="0.13.13-nightly.20240213.132" />
3131

3232
<PackageVersion Include="CliWrap" Version="3.6.4" />
3333
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0"/>

NuGet.config

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,16 @@
33
<packageSources>
44
<clear />
55
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
6+
<add key="bdn-nightly" value="https://www.myget.org/F/benchmarkdotnet/api/v3/index.json" />
67
</packageSources>
8+
<packageSourceMapping>
9+
<!-- key value for <packageSource> should match key values from <packageSources> element -->
10+
<packageSource key="bdn-nightly">
11+
<package pattern="BenchmarkDotNet" />
12+
<package pattern="BenchmarkDotNet.*" />
13+
</packageSource>
14+
<packageSource key="nuget.org">
15+
<package pattern="*" />
16+
</packageSource>
17+
</packageSourceMapping>
718
</configuration>

build.fsx

Lines changed: 15 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,14 @@ let cleanFolders (input: string seq) =
2828
}
2929

3030
let benchmarkAssembly =
31-
"src"
32-
</> "Fantomas.Benchmarks"
33-
</> "bin"
34-
</> "Release"
35-
</> "net7.0"
36-
</> "Fantomas.Benchmarks.dll"
31+
"artifacts/bin/Fantomas.Benchmarks/release/Fantomas.Benchmarks.dll"
3732

3833
let semanticVersioning =
3934
__SOURCE_DIRECTORY__
40-
</> "src"
41-
</> "Fantomas"
35+
</> "artifacts"
4236
</> "bin"
43-
</> "Release"
44-
</> "net6.0"
37+
</> "Fantomas"
38+
</> "release"
4539
</> "SemanticVersioning.dll"
4640

4741
let pushPackage nupkg =
@@ -62,25 +56,11 @@ let analysisReportsDir = "analysisreports"
6256
pipeline "Build" {
6357
workingDir __SOURCE_DIRECTORY__
6458
stage "RestoreTools" { run "dotnet tool restore" }
65-
stage "Clean" {
66-
run (
67-
cleanFolders
68-
[| analysisReportsDir
69-
"bin"
70-
"src/Fantomas.FCS/bin/Release"
71-
"src/Fantomas.FCS/obj/Release"
72-
"src/Fantomas.Core/bin/Release"
73-
"src/Fantomas.Core/obj/Release"
74-
"src/Fantomas/bin/Release"
75-
"src/Fantomas/obj/Release"
76-
"src/Fantomas.Client/bin/Release"
77-
"src/Fantomas.Client/obj/Release" |]
78-
)
79-
}
59+
stage "Clean" { run (cleanFolders [| analysisReportsDir; "artifacts" |]) }
8060
stage "CheckFormat" { run "dotnet fantomas src docs build.fsx --check" }
81-
stage "Build" { run "dotnet build -c Release" }
82-
stage "UnitTests" { run "dotnet test -c Release" }
83-
stage "Pack" { run "dotnet pack --no-restore -c Release -o ./bin" }
61+
stage "Build" { run "dotnet build -c Release --tl" }
62+
stage "UnitTests" { run "dotnet test -c Release --tl" }
63+
stage "Pack" { run "dotnet pack --no-restore -c Release --tl" }
8464
stage "Docs" {
8565
whenNot { platformOSX }
8666
envVars
@@ -94,7 +74,7 @@ pipeline "Build" {
9474

9575
pipeline "Benchmark" {
9676
workingDir __SOURCE_DIRECTORY__
97-
stage "Prepare" { run "dotnet build -c Release src/Fantomas.Benchmarks" }
77+
stage "Prepare" { run "dotnet build -c Release src/Fantomas.Benchmarks --tl" }
9878
stage "Benchmark" { run $"dotnet {benchmarkAssembly}" }
9979
runIfOnlySpecified true
10080
}
@@ -154,7 +134,11 @@ pipeline "PushClient" {
154134
run (fun _ ->
155135
async {
156136
return!
157-
Directory.EnumerateFiles("bin", "Fantomas.Client.*.nupkg", SearchOption.TopDirectoryOnly)
137+
Directory.EnumerateFiles(
138+
"artifacts/package/release",
139+
"Fantomas.Client.*.nupkg",
140+
SearchOption.TopDirectoryOnly
141+
)
158142
|> Seq.tryExactlyOne
159143
|> Option.map pushPackage
160144
|> Option.defaultValue (
@@ -449,7 +433,7 @@ pipeline "Release" {
449433
else
450434
// Push packages to NuGet
451435
let nugetPackages =
452-
Directory.EnumerateFiles("bin", "*.nupkg", SearchOption.TopDirectoryOnly)
436+
Directory.EnumerateFiles("artifacts/package/release", "*.nupkg", SearchOption.TopDirectoryOnly)
453437
|> Seq.filter (fun nupkg -> not (nupkg.Contains("Fantomas.Client")))
454438
|> Seq.toArray
455439

docs/docs/end-users/Configuration.fsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ UI might be available depending on the IDE.
2020
*)
2121

2222
(*** hide ***)
23-
#r "../../../src/Fantomas/bin/Release/net6.0/Fantomas.FCS.dll"
24-
#r "../../../src/Fantomas/bin/Release/net6.0/Fantomas.Core.dll"
23+
#r "../../../artifacts/bin/Fantomas.FCS/release/Fantomas.FCS.dll"
24+
#r "../../../artifacts/bin/Fantomas.Core/release/Fantomas.Core.dll"
2525

2626
printf $"version: {Fantomas.Core.CodeFormatter.GetVersion()}"
2727
(*** include-output ***)

docs/docs/end-users/GeneratingCode.fsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ In simple scenarios this can work out, but in the long run it doesn't scale well
3232
To illustrate the API, lets generate a simple value binding: `let a = 0`.
3333
*)
3434

35-
#r "../../../src/Fantomas/bin/Release/net6.0/Fantomas.FCS.dll"
36-
#r "../../../src/Fantomas/bin/Release/net6.0/Fantomas.Core.dll" // In production use #r "nuget: Fantomas.Core, 6.*"
35+
#r "../../../artifacts/bin/Fantomas.FCS/release/Fantomas.FCS.dll"
36+
#r "../../../artifacts/bin/Fantomas.Core/release/Fantomas.Core.dll" // In production use #r "nuget: Fantomas.Core, 6.*"
3737

3838
open Fantomas.FCS.Text
3939
open Fantomas.Core.SyntaxOak

docs/docs/end-users/GettingStarted.fsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ For the overview how to use the tool, you can type the command
3434
open System.Diagnostics
3535

3636
let fantomasDll =
37-
System.IO.Path.Combine(__SOURCE_DIRECTORY__, "../../../src/Fantomas/bin/Release/net6.0/fantomas.dll")
37+
System.IO.Path.Combine(__SOURCE_DIRECTORY__, "../../../artifacts/bin/fantomas/release/fantomas.dll")
3838

3939
let output =
4040
let psi = ProcessStartInfo("dotnet", $"{fantomasDll} --help")

src/Fantomas.Benchmarks/Fantomas.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>net7.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
88
<ItemGroup>

src/Fantomas.Benchmarks/packages.lock.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"version": 2,
33
"dependencies": {
4-
"net7.0": {
4+
"net8.0": {
55
"BenchmarkDotNet": {
66
"type": "Direct",
7-
"requested": "[0.13.11, )",
8-
"resolved": "0.13.11",
9-
"contentHash": "BSsrfesUFgrjy/MtlupiUrZKgcBCCKmFXmNaVQLrBCs0/2iE/qH1puN7lskTE9zM0+MdiCr09zKk6MXKmwmwxw==",
7+
"requested": "[0.13.13-nightly.20240213.132, )",
8+
"resolved": "0.13.13-nightly.20240213.132",
9+
"contentHash": "2dGQPEr47nGnsgipskl3rWS+dVWm+xkVzS/1jAF49VdDdGh6JLQkaVv5k59UewMF6ofGV1EvF5HeO55wwTRaww==",
1010
"dependencies": {
11-
"BenchmarkDotNet.Annotations": "0.13.11",
11+
"BenchmarkDotNet.Annotations": "0.13.13-nightly.20240213.132",
1212
"CommandLineParser": "2.9.1",
1313
"Gee.External.Capstone": "2.3.0",
1414
"Iced": "1.17.0",
@@ -46,8 +46,8 @@
4646
},
4747
"BenchmarkDotNet.Annotations": {
4848
"type": "Transitive",
49-
"resolved": "0.13.11",
50-
"contentHash": "JOX+Bhp+PNnAtu/er9iGiN8QRIrYzilxUcJbwrF8VYyTNE8r4jlewa17/FbW1G7Jp2JUZwVS1A8a0bGILKhikw=="
49+
"resolved": "0.13.13-nightly.20240213.132",
50+
"contentHash": "G40jV79QmtgQbqaIPUmQ2CCswnfO7j/tdL0ENbAevVsuBW5rGoxj2V3NlMiSUQO9MogRk3rWMnXytFYcRFmP4w=="
5151
},
5252
"CommandLineParser": {
5353
"type": "Transitive",

src/Fantomas.Client.Tests/Fantomas.Client.Tests.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<NoWarn>FS0988</NoWarn>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<IsPackable>false</IsPackable>
77
<GenerateProgramFile>false</GenerateProgramFile>
88
<RollForward>Major</RollForward>

0 commit comments

Comments
 (0)