Skip to content

Commit

Permalink
Remove FAKE
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoVIII committed May 17, 2021
1 parent 865d617 commit f742f41
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 501 deletions.
6 changes: 0 additions & 6 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
"version": 1,
"isRoot": true,
"tools": {
"fake-cli": {
"version": "5.20.4-alpha.1642",
"commands": [
"fake"
]
},
"paket": {
"version": "6.0.0-beta4",
"commands": [
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
- name: Restore dependencies
run: dotnet restore
- name: Run build
run: dotnet fake build -t Test
run: dotnet run --project tests/TypedPersistence.UnitTests/TypedPersistence.UnitTests.fsproj
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Restore dependencies
run: dotnet restore
- name: Run Fornax
run: dotnet fake build -t Docs
run: dotnet fsi ./docs.fsx
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Run Test
run: dotnet fake build
- name: Run build
run: dotnet fake build -t Pack
run: dotnet fsi ./pack.fsx
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2.0.0
Expand Down
209 changes: 0 additions & 209 deletions build.fsx

This file was deleted.

36 changes: 36 additions & 0 deletions docs.fsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/dotnet fsi

#r "nuget: Fake.Core.Process"
#r "nuget: Fake.DotNet.Cli"

open Fake.Core
open Fake.DotNet

let buildDir = "./build/"

let isNullOrWhiteSpace = System.String.IsNullOrWhiteSpace

let exec cmd args dir =
let proc =
CreateProcess.fromRawCommandLine cmd args
|> CreateProcess.ensureExitCodeWithMessage (sprintf "Error while running '%s' with args: %s" cmd args)

(if isNullOrWhiteSpace dir then
proc
else
proc |> CreateProcess.withWorkingDirectory dir)
|> Proc.run
|> ignore

let build () =
DotNet.build
(fun p ->
{ p with
Configuration = DotNet.BuildConfiguration.Release
OutputPath = Some buildDir })
"TypedPersistence.sln"

let docs () = exec "dotnet" @"fornax build" "docs"

build ()
docs ()
65 changes: 65 additions & 0 deletions pack.fsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/dotnet fsi
#r "nuget: Fake.DotNet.Cli"
#r "nuget: Fake.Core.ReleaseNotes"

open Fake.Core
open Fake.DotNet
open System.IO

let project = "TypedPersistence"

let summary =
"Simple library which should simplify saving and loading files"

let authors = "NicoVIII"
let tags = "Persistence,Typesafety,F#"
let copyright = ""

let gitOwner = "NicoVIII"
let gitName = project
let gitHome = "https://github.com/" + gitOwner
let gitUrl = gitHome + "/" + gitName

let nugetDir = "./out/"

let changelogFilename = "CHANGELOG.md"
let changelog = Changelog.load changelogFilename
let latestEntry = changelog.LatestEntry

let nugetVersion = latestEntry.NuGetVersion

let packageReleaseNotes =
sprintf "%s/blob/v%s/CHANGELOG.md" gitUrl latestEntry.NuGetVersion

let pack () =
let properties =
[ ("Version", nugetVersion)
("Authors", authors)
("PackageProjectUrl", gitUrl)
("PackageTags", tags)
("RepositoryType", "git")
("RepositoryUrl", gitUrl)
("PackageLicenseUrl", gitUrl + "/LICENSE")
("Copyright", copyright)
("PackageReleaseNotes", packageReleaseNotes)
("PackageDescription", summary)
("EnableSourceLink", "true") ]

DotNet.pack
(fun p ->
{ p with
Configuration = DotNet.BuildConfiguration.Release
OutputPath = Some nugetDir
MSBuildParams =
{ p.MSBuildParams with
Properties = properties } })
"TypedPersistence.sln"

let removeTests () =
Directory.GetFiles nugetDir
|> List.ofArray
|> List.filter (fun name -> name.Contains "UnitTests")
|> List.iter File.Delete

pack ()
removeTests ()
21 changes: 0 additions & 21 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,3 @@ group Docs
nuget FSharp.Compiler.Service ~> 35.0
nuget FSharp.Formatting ~> 4.1
nuget Newtonsoft.Json

// [ FAKE GROUP ]
group Build
source https://api.nuget.org/v3/index.json

framework: netstandard2.1, netstandard2.0
storage: none

nuget FSharp.Core ~> 4.7
nuget Fake.Core.Target
nuget Fake.Core.Process
nuget Fake.DotNet.Cli
nuget Fake.Core.ReleaseNotes
nuget Fake.DotNet.AssemblyInfoFile
nuget Fake.DotNet.Paket
nuget Fake.Tools.Git
nuget Fake.Core.Environment
nuget Fake.Core.UserInput
nuget Fake.IO.FileSystem
nuget Fake.DotNet.MsBuild
nuget Fake.Api.GitHub

0 comments on commit f742f41

Please sign in to comment.