Convert FAKE to project (#54)

This commit is contained in:
Daniel J. Summers 2024-12-26 15:10:39 -05:00
parent ae8cf9ad80
commit 7fb1eca2a3
5 changed files with 69 additions and 270 deletions

View File

@ -1,44 +1,50 @@
#r "paket:
nuget Fake.DotNet.Cli
nuget Fake.DotNet.Testing.Expecto
nuget Fake.IO.FileSystem
nuget Fake.Core.Target //"
#load ".fake/build.fsx/intellisense.fsx"
open Fake.Core
open Fake.DotNet
open Fake.DotNet.Testing
open Fake.IO
open Fake.IO.Globbing.Operators
open Fake.Core.TargetOperators
Target.initEnvironment ()
/// The root path to the projects within this solution
let projPath = "src/PrayerTracker"
Target.create "Clean" (fun _ ->
!! "src/**/bin"
++ "src/**/obj"
|> Shell.cleanDirs
)
Target.create "Test" (fun _ ->
let testPath = $"{projPath}.Tests"
DotNet.build (fun opts -> { opts with NoLogo = true }) $"{testPath}/PrayerTracker.Tests.fsproj"
Expecto.run
(fun opts -> { opts with WorkingDirectory = $"{testPath}/bin/Release/net7.0" })
[ "PrayerTracker.Tests.dll" ])
Target.create "Publish" (fun _ ->
DotNet.publish
(fun opts -> { opts with Runtime = Some "linux-x64"; SelfContained = Some false; NoLogo = true })
$"{projPath}/PrayerTracker.fsproj")
Target.create "All" ignore
"Clean"
==> "Test"
==> "Publish"
==> "All"
Target.runOrDefault "All"
open Fake.Core
open Fake.DotNet
open Fake.IO
open Fake.IO.Globbing.Operators
let execContext = Context.FakeExecutionContext.Create false "build.fsx" []
Context.setExecutionContext (Context.RuntimeContext.Fake execContext)
/// The root path to the projects within this solution
let projPath = "src/PrayerTracker"
Target.create "Clean" (fun _ ->
!! "src/**/bin"
++ "src/**/obj"
|> Shell.cleanDirs
)
Target.create "Test" (fun _ ->
let testPath = $"{projPath}.Tests"
DotNet.build (fun opts -> { opts with NoLogo = true }) $"{testPath}/PrayerTracker.Tests.fsproj"
Testing.Expecto.run
(fun opts -> { opts with WorkingDirectory = $"{testPath}/bin/Release/net9.0" })
[ "PrayerTracker.Tests.dll" ])
Target.create "Publish" (fun _ ->
DotNet.publish
(fun opts -> { opts with Runtime = Some "linux-x64"; SelfContained = Some false; NoLogo = true })
$"{projPath}/PrayerTracker.fsproj")
Target.create "All" ignore
open Fake.Core.TargetOperators
let dependencies = [
"Clean"
==> "Test"
==> "Publish"
==> "All"
]
[<EntryPoint>]
let main args =
try
match args with
| [| target |] -> Target.runOrDefault target
| _ -> Target.runOrDefault "All"
0
with e ->
printfn "%A" e
1

19
build.fsproj Normal file
View File

@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="build.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Fake.Core.Target" Version="6.1.3" />
<PackageReference Include="Fake.DotNet.Cli" Version="6.1.3" />
<PackageReference Include="Fake.Dotnet.Testing.Expecto" Version="6.1.3" />
<PackageReference Include="MSBuild.StructuredLogger" Version="2.2.386" />
</ItemGroup>
</Project>

View File

@ -1,217 +0,0 @@
STORAGE: NONE
RESTRICTION: || (== net6.0) (== netstandard2.0)
NUGET
remote: https://api.nuget.org/v3/index.json
BlackFox.VsWhere (1.1)
FSharp.Core (>= 4.2.3)
Microsoft.Win32.Registry (>= 4.7)
Fake.Core.CommandLineParsing (6.1.3)
FParsec (>= 1.1.1)
FSharp.Core (>= 8.0.301)
Fake.Core.Context (6.1.3)
FSharp.Core (>= 8.0.301)
Fake.Core.Environment (6.1.3)
FSharp.Core (>= 8.0.301)
Fake.Core.FakeVar (6.1.3)
Fake.Core.Context (>= 6.1.3)
FSharp.Core (>= 8.0.301)
Fake.Core.Process (6.1.3)
Fake.Core.Environment (>= 6.1.3)
Fake.Core.FakeVar (>= 6.1.3)
Fake.Core.String (>= 6.1.3)
Fake.Core.Trace (>= 6.1.3)
Fake.IO.FileSystem (>= 6.1.3)
FSharp.Core (>= 8.0.301)
System.Collections.Immutable (>= 8.0)
Fake.Core.SemVer (6.1.3)
FSharp.Core (>= 8.0.301)
Fake.Core.String (6.1.3)
FSharp.Core (>= 8.0.301)
Fake.Core.Target (6.1.3)
Fake.Core.CommandLineParsing (>= 6.1.3)
Fake.Core.Context (>= 6.1.3)
Fake.Core.Environment (>= 6.1.3)
Fake.Core.FakeVar (>= 6.1.3)
Fake.Core.Process (>= 6.1.3)
Fake.Core.String (>= 6.1.3)
Fake.Core.Trace (>= 6.1.3)
FSharp.Control.Reactive (>= 5.0.2)
FSharp.Core (>= 8.0.301)
Fake.Core.Tasks (6.1.3)
Fake.Core.Trace (>= 6.1.3)
FSharp.Core (>= 8.0.301)
Fake.Core.Trace (6.1.3)
Fake.Core.Environment (>= 6.1.3)
Fake.Core.FakeVar (>= 6.1.3)
FSharp.Core (>= 8.0.301)
Fake.Core.Xml (6.1.3)
Fake.Core.String (>= 6.1.3)
FSharp.Core (>= 8.0.301)
Fake.DotNet.Cli (6.1.3)
Fake.Core.Environment (>= 6.1.3)
Fake.Core.Process (>= 6.1.3)
Fake.Core.String (>= 6.1.3)
Fake.Core.Trace (>= 6.1.3)
Fake.DotNet.MSBuild (>= 6.1.3)
Fake.DotNet.NuGet (>= 6.1.3)
Fake.IO.FileSystem (>= 6.1.3)
FSharp.Core (>= 8.0.301)
Mono.Posix.NETStandard (>= 1.0)
Newtonsoft.Json (>= 13.0.3)
Fake.DotNet.MSBuild (6.1.3)
BlackFox.VsWhere (>= 1.1)
Fake.Core.Environment (>= 6.1.3)
Fake.Core.Process (>= 6.1.3)
Fake.Core.String (>= 6.1.3)
Fake.Core.Trace (>= 6.1.3)
Fake.IO.FileSystem (>= 6.1.3)
FSharp.Core (>= 8.0.301)
MSBuild.StructuredLogger (>= 2.1.815)
Fake.DotNet.NuGet (6.1.3)
Fake.Core.Environment (>= 6.1.3)
Fake.Core.Process (>= 6.1.3)
Fake.Core.SemVer (>= 6.1.3)
Fake.Core.String (>= 6.1.3)
Fake.Core.Tasks (>= 6.1.3)
Fake.Core.Trace (>= 6.1.3)
Fake.Core.Xml (>= 6.1.3)
Fake.IO.FileSystem (>= 6.1.3)
Fake.Net.Http (>= 6.1.3)
FSharp.Core (>= 8.0.301)
Newtonsoft.Json (>= 13.0.3)
NuGet.Protocol (>= 6.10.1)
Fake.DotNet.Testing.Expecto (6.1.3)
Fake.Core.Process (>= 6.1.3)
Fake.Core.String (>= 6.1.3)
Fake.Core.Trace (>= 6.1.3)
Fake.Testing.Common (>= 6.1.3)
FSharp.Core (>= 8.0.301)
Fake.IO.FileSystem (6.1.3)
Fake.Core.String (>= 6.1.3)
Fake.Core.Trace (>= 6.1.3)
FSharp.Core (>= 8.0.301)
Fake.Net.Http (6.1.3)
Fake.Core.Trace (>= 6.1.3)
FSharp.Core (>= 8.0.301)
Fake.Testing.Common (6.1.3)
Fake.Core.Trace (>= 6.1.3)
FSharp.Core (>= 8.0.301)
FParsec (1.1.1)
FSharp.Core (>= 4.3.4)
FSharp.Control.Reactive (5.0.5)
FSharp.Core (>= 4.7.2)
System.Reactive (>= 5.0 < 6.0)
FSharp.Core (9.0.100)
Microsoft.Bcl.AsyncInterfaces (9.0) - restriction: || (&& (== net6.0) (>= net462)) (&& (== net6.0) (>= net472)) (&& (== net6.0) (< net5.0)) (== netstandard2.0)
System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net462)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0)
Microsoft.Bcl.Cryptography (9.0)
System.Formats.Asn1 (>= 9.0)
System.Memory (>= 4.5.5)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
Microsoft.Build.Framework (17.12.6)
Microsoft.Win32.Registry (>= 5.0)
System.Memory (>= 4.5.5)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
System.Security.Principal.Windows (>= 5.0)
Microsoft.Build.Utilities.Core (17.12.6)
Microsoft.Build.Framework (>= 17.12.6)
Microsoft.NET.StringTools (>= 17.12.6)
Microsoft.Win32.Registry (>= 5.0)
System.Collections.Immutable (>= 8.0)
System.Configuration.ConfigurationManager (>= 8.0)
System.Memory (>= 4.5.5)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
System.Security.Principal.Windows (>= 5.0)
System.Text.Encoding.CodePages (>= 7.0)
Microsoft.NET.StringTools (17.12.6)
System.Memory (>= 4.5.5)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
Microsoft.NETCore.Platforms (7.0.4) - restriction: || (&& (== net6.0) (< netcoreapp3.1)) (&& (== net6.0) (< netstandard1.2)) (&& (== net6.0) (< netstandard1.3)) (&& (== net6.0) (< netstandard1.5)) (== netstandard2.0)
Microsoft.NETCore.Targets (5.0) - restriction: || (&& (== net6.0) (< netcoreapp3.1)) (&& (== net6.0) (< netstandard1.2)) (&& (== net6.0) (< netstandard1.3)) (&& (== net6.0) (< netstandard1.5)) (== netstandard2.0)
Microsoft.Win32.Registry (5.0)
System.Buffers (>= 4.5.1) - restriction: || (&& (== net6.0) (>= monoandroid) (< netstandard1.3)) (&& (== net6.0) (>= monotouch)) (&& (== net6.0) (< netcoreapp2.0)) (&& (== net6.0) (>= xamarinios)) (&& (== net6.0) (>= xamarinmac)) (&& (== net6.0) (>= xamarintvos)) (&& (== net6.0) (>= xamarinwatchos)) (== netstandard2.0)
System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (< netcoreapp2.0)) (&& (== net6.0) (< netcoreapp2.1)) (&& (== net6.0) (>= uap10.1)) (== netstandard2.0)
System.Security.AccessControl (>= 5.0)
System.Security.Principal.Windows (>= 5.0)
Mono.Posix.NETStandard (1.0)
MSBuild.StructuredLogger (2.2.386)
Microsoft.Build.Framework (>= 17.5)
Microsoft.Build.Utilities.Core (>= 17.5)
System.Collections.Immutable (>= 8.0)
System.Memory (>= 4.5.5)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
Newtonsoft.Json (13.0.3)
NuGet.Common (6.12.1)
NuGet.Frameworks (>= 6.12.1)
NuGet.Configuration (6.12.1)
NuGet.Common (>= 6.12.1)
System.Security.Cryptography.ProtectedData (>= 4.4)
NuGet.Frameworks (6.12.1)
NuGet.Packaging (6.12.1)
Newtonsoft.Json (>= 13.0.3)
NuGet.Configuration (>= 6.12.1)
NuGet.Versioning (>= 6.12.1)
System.Formats.Asn1 (>= 8.0.1)
System.Security.Cryptography.Pkcs (>= 6.0.4)
NuGet.Protocol (6.12.1)
NuGet.Packaging (>= 6.12.1)
System.Text.Json (>= 8.0.4) - restriction: || (&& (== net6.0) (>= net472)) (&& (== net6.0) (< net5.0)) (== netstandard2.0)
NuGet.Versioning (6.12.1)
System.Buffers (4.6)
System.Collections.Immutable (9.0)
System.Memory (>= 4.5.5)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
System.Configuration.ConfigurationManager (9.0)
System.Security.Cryptography.ProtectedData (>= 9.0)
System.Formats.Asn1 (9.0)
System.Buffers (>= 4.5.1)
System.Memory (>= 4.5.5)
System.IO.Pipelines (9.0) - restriction: || (&& (== net6.0) (>= net462)) (&& (== net6.0) (>= net472)) (&& (== net6.0) (< net5.0)) (== netstandard2.0)
System.Buffers (>= 4.5.1)
System.Memory (>= 4.5.5)
System.Threading.Tasks.Extensions (>= 4.5.4)
System.Memory (4.6)
System.Buffers (>= 4.6) - restriction: || (&& (== net6.0) (>= net462)) (&& (== net6.0) (< netcoreapp2.1)) (== netstandard2.0)
System.Numerics.Vectors (>= 4.6) - restriction: || (&& (== net6.0) (>= net462)) (&& (== net6.0) (< netcoreapp2.1)) (== netstandard2.0)
System.Runtime.CompilerServices.Unsafe (>= 6.1) - restriction: || (&& (== net6.0) (>= net462)) (&& (== net6.0) (< netcoreapp2.1)) (== netstandard2.0)
System.Numerics.Vectors (4.6) - restriction: || (&& (== net6.0) (>= net462)) (&& (== net6.0) (< netcoreapp2.1)) (== netstandard2.0)
System.Reactive (5.0)
System.Runtime.InteropServices.WindowsRuntime (>= 4.3) - restriction: || (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0)
System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net472)) (&& (== net6.0) (< netcoreapp3.1)) (&& (== net6.0) (>= uap10.1)) (== netstandard2.0)
System.Runtime (4.3.1) - restriction: || (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0)
Microsoft.NETCore.Platforms (>= 1.1.1)
Microsoft.NETCore.Targets (>= 1.1.3)
System.Runtime.CompilerServices.Unsafe (6.1)
System.Runtime.InteropServices.WindowsRuntime (4.3) - restriction: || (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0)
System.Runtime (>= 4.3)
System.Security.AccessControl (6.0.1)
System.Security.Principal.Windows (>= 5.0) - restriction: || (&& (== net6.0) (>= net461)) (== netstandard2.0)
System.Security.Cryptography.Cng (5.0)
System.Formats.Asn1 (>= 5.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.0))
System.Security.Cryptography.Pkcs (9.0)
Microsoft.Bcl.Cryptography (>= 9.0)
System.Buffers (>= 4.5.1) - restriction: || (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0)
System.Formats.Asn1 (>= 9.0)
System.Memory (>= 4.5.5) - restriction: || (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
System.Security.Cryptography.Cng (>= 5.0)
System.Security.Cryptography.ProtectedData (9.0)
System.Memory (>= 4.5.5)
System.Security.Principal.Windows (5.0)
System.Text.Encoding.CodePages (9.0)
System.Memory (>= 4.5.5)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
System.Text.Encodings.Web (9.0) - restriction: || (&& (== net6.0) (>= net462)) (&& (== net6.0) (>= net472)) (&& (== net6.0) (< net5.0)) (== netstandard2.0)
System.Buffers (>= 4.5.1)
System.Memory (>= 4.5.5)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
System.Text.Json (9.0) - restriction: || (&& (== net6.0) (>= net472)) (&& (== net6.0) (< net5.0)) (== netstandard2.0)
Microsoft.Bcl.AsyncInterfaces (>= 9.0)
System.Buffers (>= 4.5.1)
System.IO.Pipelines (>= 9.0)
System.Memory (>= 4.5.5)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
System.Text.Encodings.Web (>= 9.0)
System.Threading.Tasks.Extensions (>= 4.5.4)
System.Threading.Tasks.Extensions (4.6) - restriction: || (&& (== net6.0) (>= net472)) (&& (== net6.0) (< netcoreapp3.1)) (&& (== net6.0) (>= uap10.1)) (== netstandard2.0)
System.Runtime.CompilerServices.Unsafe (>= 6.1) - restriction: || (&& (== net6.0) (>= net462)) (&& (== net6.0) (< netcoreapp2.1)) (== netstandard2.0)

View File

@ -1,2 +0,0 @@
dotnet tool restore
dotnet fake %*

View File

@ -1,7 +0,0 @@
#!/usr/bin/env bash
set -eu
set -o pipefail
dotnet tool restore
dotnet fake "$@"