Skip to content

Commit 2ad078a

Browse files
committed
Set up projects
1 parent f615c90 commit 2ad078a

File tree

18 files changed

+6601
-0
lines changed

18 files changed

+6601
-0
lines changed

.config/dotnet-tools.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"fake-cli": {
6+
"version": "5.20.3",
7+
"commands": [
8+
"fake"
9+
]
10+
}
11+
}
12+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,3 +348,4 @@ MigrationBackup/
348348

349349
# Ionide (cross platform F# VS Code tools) working folder
350350
.ionide/
351+
/pkg

BioFSharp.BioDB.sln

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26124.0
5+
MinimumVisualStudioVersion = 15.0.26124.0
6+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "BioFSharp.BioDB", "src\BioFSharp.BioDB\BioFSharp.BioDB.fsproj", "{A0777BBF-1D50-4FE5-9078-B3CE9E32CA83}"
7+
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{8C613110-2BB7-4C7B-ABC8-53A0B36FD9C8}"
9+
EndProject
10+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "BioFSharp.BioDB.Tests", "tests\BioFSharp.BioDB.Tests\BioFSharp.BioDB.Tests.fsproj", "{3F561EA9-354C-4BBC-9648-CB13046E2B2B}"
11+
EndProject
12+
Global
13+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
14+
Debug|Any CPU = Debug|Any CPU
15+
Debug|x64 = Debug|x64
16+
Debug|x86 = Debug|x86
17+
Release|Any CPU = Release|Any CPU
18+
Release|x64 = Release|x64
19+
Release|x86 = Release|x86
20+
EndGlobalSection
21+
GlobalSection(SolutionProperties) = preSolution
22+
HideSolutionNode = FALSE
23+
EndGlobalSection
24+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
25+
{A0777BBF-1D50-4FE5-9078-B3CE9E32CA83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
26+
{A0777BBF-1D50-4FE5-9078-B3CE9E32CA83}.Debug|Any CPU.Build.0 = Debug|Any CPU
27+
{A0777BBF-1D50-4FE5-9078-B3CE9E32CA83}.Debug|x64.ActiveCfg = Debug|Any CPU
28+
{A0777BBF-1D50-4FE5-9078-B3CE9E32CA83}.Debug|x64.Build.0 = Debug|Any CPU
29+
{A0777BBF-1D50-4FE5-9078-B3CE9E32CA83}.Debug|x86.ActiveCfg = Debug|Any CPU
30+
{A0777BBF-1D50-4FE5-9078-B3CE9E32CA83}.Debug|x86.Build.0 = Debug|Any CPU
31+
{A0777BBF-1D50-4FE5-9078-B3CE9E32CA83}.Release|Any CPU.ActiveCfg = Release|Any CPU
32+
{A0777BBF-1D50-4FE5-9078-B3CE9E32CA83}.Release|Any CPU.Build.0 = Release|Any CPU
33+
{A0777BBF-1D50-4FE5-9078-B3CE9E32CA83}.Release|x64.ActiveCfg = Release|Any CPU
34+
{A0777BBF-1D50-4FE5-9078-B3CE9E32CA83}.Release|x64.Build.0 = Release|Any CPU
35+
{A0777BBF-1D50-4FE5-9078-B3CE9E32CA83}.Release|x86.ActiveCfg = Release|Any CPU
36+
{A0777BBF-1D50-4FE5-9078-B3CE9E32CA83}.Release|x86.Build.0 = Release|Any CPU
37+
{3F561EA9-354C-4BBC-9648-CB13046E2B2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
38+
{3F561EA9-354C-4BBC-9648-CB13046E2B2B}.Debug|Any CPU.Build.0 = Debug|Any CPU
39+
{3F561EA9-354C-4BBC-9648-CB13046E2B2B}.Debug|x64.ActiveCfg = Debug|Any CPU
40+
{3F561EA9-354C-4BBC-9648-CB13046E2B2B}.Debug|x64.Build.0 = Debug|Any CPU
41+
{3F561EA9-354C-4BBC-9648-CB13046E2B2B}.Debug|x86.ActiveCfg = Debug|Any CPU
42+
{3F561EA9-354C-4BBC-9648-CB13046E2B2B}.Debug|x86.Build.0 = Debug|Any CPU
43+
{3F561EA9-354C-4BBC-9648-CB13046E2B2B}.Release|Any CPU.ActiveCfg = Release|Any CPU
44+
{3F561EA9-354C-4BBC-9648-CB13046E2B2B}.Release|Any CPU.Build.0 = Release|Any CPU
45+
{3F561EA9-354C-4BBC-9648-CB13046E2B2B}.Release|x64.ActiveCfg = Release|Any CPU
46+
{3F561EA9-354C-4BBC-9648-CB13046E2B2B}.Release|x64.Build.0 = Release|Any CPU
47+
{3F561EA9-354C-4BBC-9648-CB13046E2B2B}.Release|x86.ActiveCfg = Release|Any CPU
48+
{3F561EA9-354C-4BBC-9648-CB13046E2B2B}.Release|x86.Build.0 = Release|Any CPU
49+
EndGlobalSection
50+
GlobalSection(NestedProjects) = preSolution
51+
{3F561EA9-354C-4BBC-9648-CB13046E2B2B} = {8C613110-2BB7-4C7B-ABC8-53A0B36FD9C8}
52+
EndGlobalSection
53+
EndGlobal

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
### 0.0.1 - 2/23/2021

build.cmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dotnet tool restore
2+
dotnet fake build %*

build.fsx

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
#r "paket:
2+
nuget BlackFox.Fake.BuildTask
3+
nuget Fake.Core.Target
4+
nuget Fake.Core.Process
5+
nuget Fake.Core.ReleaseNotes
6+
nuget Fake.IO.FileSystem
7+
nuget Fake.DotNet.Cli
8+
nuget Fake.DotNet.MSBuild
9+
nuget Fake.DotNet.AssemblyInfoFile
10+
nuget Fake.DotNet.Paket
11+
nuget Fake.DotNet.FSFormatting
12+
nuget Fake.DotNet.Fsi
13+
nuget Fake.DotNet.NuGet
14+
nuget Fake.Api.Github
15+
nuget Fake.DotNet.Testing.Expecto
16+
nuget Fake.Tools.Git //"
17+
18+
#if !FAKE
19+
#load "./.fake/build.fsx/intellisense.fsx"
20+
#r "netstandard" // Temp fix for https://github.com/dotnet/fsharp/issues/5216
21+
#endif
22+
23+
open BlackFox.Fake
24+
open System.IO
25+
open Fake.Core
26+
open Fake.DotNet
27+
open Fake.IO
28+
open Fake.IO.FileSystemOperators
29+
open Fake.IO.Globbing.Operators
30+
open Fake.Tools
31+
32+
[<AutoOpen>]
33+
/// user interaction prompts for critical build tasks where you may want to interrupt when you see wrong inputs.
34+
module MessagePrompts =
35+
36+
let prompt (msg:string) =
37+
System.Console.Write(msg)
38+
System.Console.ReadLine().Trim()
39+
|> function | "" -> None | s -> Some s
40+
|> Option.map (fun s -> s.Replace ("\"","\\\""))
41+
42+
let rec promptYesNo msg =
43+
match prompt (sprintf "%s [Yn]: " msg) with
44+
| Some "Y" | Some "y" -> true
45+
| Some "N" | Some "n" -> false
46+
| _ -> System.Console.WriteLine("Sorry, invalid answer"); promptYesNo msg
47+
48+
let releaseMsg = """This will stage all uncommitted changes, push them to the origin and bump the release version to the latest number in the RELEASE_NOTES.md file.
49+
Do you want to continue?"""
50+
51+
let releaseDocsMsg = """This will push the docs to gh-pages. Remember building the docs prior to this. Do you want to continue?"""
52+
53+
/// Executes a dotnet command in the given working directory
54+
let runDotNet cmd workingDir =
55+
let result =
56+
DotNet.exec (DotNet.Options.withWorkingDirectory workingDir) cmd ""
57+
if result.ExitCode <> 0 then failwithf "'dotnet %s' failed in %s" cmd workingDir
58+
59+
/// Metadata about the project
60+
module ProjectInfo =
61+
62+
let project = "BioFSharp.BioDB"
63+
64+
let summary = "Programmatic access to Biological Databases from F#"
65+
66+
let configuration = "Release"
67+
68+
// Git configuration (used for publishing documentation in gh-pages branch)
69+
// The profile where the project is posted
70+
let gitOwner = "CSBiology"
71+
let gitName = "BioFSharp.BioDB"
72+
73+
let gitHome = sprintf "%s/%s" "https://github.com" gitOwner
74+
75+
let projectRepo = sprintf "%s/%s/%s" "https://github.com" gitOwner gitName
76+
77+
let website = "/BioFSharp.BioDB"
78+
79+
let testProject = "tests/BioFSharp.BioDB.Tests/BioFSharp.BioDB.Tests.fsproj"
80+
81+
let pkgDir = "pkg"
82+
83+
let release = ReleaseNotes.load "RELEASE_NOTES.md"
84+
85+
let stableVersion = SemVer.parse release.NugetVersion
86+
87+
let stableVersionTag = (sprintf "%i.%i.%i" stableVersion.Major stableVersion.Minor stableVersion.Patch )
88+
89+
let mutable prereleaseSuffix = ""
90+
91+
let mutable prereleaseTag = ""
92+
93+
let mutable isPrerelease = false
94+
95+
/// Barebones, minimal build tasks
96+
module BasicTasks =
97+
98+
open ProjectInfo
99+
100+
let setPrereleaseTag = BuildTask.create "SetPrereleaseTag" [] {
101+
printfn "Please enter pre-release package suffix"
102+
let suffix = System.Console.ReadLine()
103+
prereleaseSuffix <- suffix
104+
prereleaseTag <- (sprintf "%s-%s" release.NugetVersion suffix)
105+
isPrerelease <- true
106+
}
107+
108+
let clean = BuildTask.create "Clean" [] {
109+
!! "src/**/bin"
110+
++ "src/**/obj"
111+
++ "pkg"
112+
++ "bin"
113+
|> Shell.cleanDirs
114+
}
115+
116+
let build = BuildTask.create "Build" [clean] {
117+
!! "src/**/*.*proj"
118+
|> Seq.iter (DotNet.build id)
119+
}
120+
121+
let copyBinaries = BuildTask.create "CopyBinaries" [clean; build] {
122+
let targets =
123+
!! "src/**/*.??proj"
124+
-- "src/**/*.shproj"
125+
|> Seq.map (fun f -> ((Path.getDirectory f) </> "bin" </> configuration, "bin" </> (Path.GetFileNameWithoutExtension f)))
126+
for i in targets do printfn "%A" i
127+
targets
128+
|> Seq.iter (fun (fromDir, toDir) -> Shell.copyDir toDir fromDir (fun _ -> true))
129+
}
130+
131+
/// Test executing build tasks
132+
module TestTasks =
133+
134+
open ProjectInfo
135+
open BasicTasks
136+
137+
let runTests = BuildTask.create "RunTests" [clean; build; copyBinaries] {
138+
let standardParams = Fake.DotNet.MSBuild.CliArguments.Create ()
139+
Fake.DotNet.DotNet.test(fun testParams ->
140+
{
141+
testParams with
142+
Logger = Some "console;verbosity=detailed"
143+
}
144+
) testProject
145+
}
146+
147+
open BasicTasks
148+
BuildTask.runOrDefault copyBinaries

0 commit comments

Comments
 (0)