Skip to content

Commit ccd3c85

Browse files
committed
Set up template repo
1 parent 2ddce8c commit ccd3c85

26 files changed

+740
-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+
"fsdocs-tool": {
6+
"version": "20.0.1",
7+
"commands": [
8+
"fsdocs"
9+
]
10+
}
11+
}
12+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Build and test
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
10+
jobs:
11+
build-and-test-linux:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Setup .NET
18+
uses: actions/setup-dotnet@v4
19+
with:
20+
dotnet-version: 8.x.x
21+
- name: make script executable
22+
run: chmod u+x build.sh
23+
- name: Build and test
24+
working-directory: ./
25+
run: ./build.sh runTests
26+
27+
build-and-test-windows:
28+
29+
runs-on: windows-latest
30+
31+
steps:
32+
- uses: actions/checkout@v4
33+
- name: Setup .NET
34+
uses: actions/setup-dotnet@v4
35+
with:
36+
dotnet-version: 8.x.x
37+
- name: Build and test
38+
working-directory: ./
39+
run: ./build.cmd runTests

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,3 +398,5 @@ FodyWeavers.xsd
398398

399399
# JetBrains Rider
400400
*.sln.iml
401+
/tmp/watch
402+
/.fsdocs

BioFSharp.XYZ.sln

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31903.59
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{7501C4DF-A844-40A0-8742-3343E48E55F1}"
7+
EndProject
8+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "BioFSharp.XYZ", "src\BioFSharp.XYZ\BioFSharp.XYZ.fsproj", "{BAC97B5C-B9A6-40D6-B533-0A07E12939ED}"
9+
EndProject
10+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{D152DA0B-8F60-4611-B613-642379E2B17C}"
11+
EndProject
12+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "BioFSharp.XYZ.Tests", "tests\BioFSharp.XYZ.Tests\BioFSharp.XYZ.Tests.fsproj", "{CB9E38BC-EE86-44EB-AFF5-91D1AF713ADC}"
13+
EndProject
14+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "project", "project", "{77A50576-9359-44E5-B2F9-95318AB3DAEA}"
15+
ProjectSection(SolutionItems) = preProject
16+
.gitignore = .gitignore
17+
LICENSE = LICENSE
18+
README.md = README.md
19+
EndProjectSection
20+
EndProject
21+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{78399A41-F06A-4B35-AA24-E2E20209D8DE}"
22+
ProjectSection(SolutionItems) = preProject
23+
build.cmd = build.cmd
24+
build.sh = build.sh
25+
.config\dotnet-tools.json = .config\dotnet-tools.json
26+
global.json = global.json
27+
EndProjectSection
28+
EndProject
29+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "build", "build\build.fsproj", "{8DCCA688-871C-49DD-BC06-4877F714497C}"
30+
EndProject
31+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{88932F99-4093-455A-901B-E0203694A436}"
32+
ProjectSection(SolutionItems) = preProject
33+
docs\index.fsx = docs\index.fsx
34+
EndProjectSection
35+
EndProject
36+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".ci", ".ci", "{812698C9-F1C7-4708-8B28-B22FAAC0ADA4}"
37+
ProjectSection(SolutionItems) = preProject
38+
.github\workflows\build-and-test.yml = .github\workflows\build-and-test.yml
39+
EndProjectSection
40+
EndProject
41+
Global
42+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
43+
Debug|Any CPU = Debug|Any CPU
44+
Release|Any CPU = Release|Any CPU
45+
EndGlobalSection
46+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
47+
{BAC97B5C-B9A6-40D6-B533-0A07E12939ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
48+
{BAC97B5C-B9A6-40D6-B533-0A07E12939ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
49+
{BAC97B5C-B9A6-40D6-B533-0A07E12939ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
50+
{BAC97B5C-B9A6-40D6-B533-0A07E12939ED}.Release|Any CPU.Build.0 = Release|Any CPU
51+
{CB9E38BC-EE86-44EB-AFF5-91D1AF713ADC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
52+
{CB9E38BC-EE86-44EB-AFF5-91D1AF713ADC}.Debug|Any CPU.Build.0 = Debug|Any CPU
53+
{CB9E38BC-EE86-44EB-AFF5-91D1AF713ADC}.Release|Any CPU.ActiveCfg = Release|Any CPU
54+
{CB9E38BC-EE86-44EB-AFF5-91D1AF713ADC}.Release|Any CPU.Build.0 = Release|Any CPU
55+
{8DCCA688-871C-49DD-BC06-4877F714497C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
56+
{8DCCA688-871C-49DD-BC06-4877F714497C}.Debug|Any CPU.Build.0 = Debug|Any CPU
57+
{8DCCA688-871C-49DD-BC06-4877F714497C}.Release|Any CPU.ActiveCfg = Release|Any CPU
58+
{8DCCA688-871C-49DD-BC06-4877F714497C}.Release|Any CPU.Build.0 = Release|Any CPU
59+
EndGlobalSection
60+
GlobalSection(SolutionProperties) = preSolution
61+
HideSolutionNode = FALSE
62+
EndGlobalSection
63+
GlobalSection(NestedProjects) = preSolution
64+
{BAC97B5C-B9A6-40D6-B533-0A07E12939ED} = {7501C4DF-A844-40A0-8742-3343E48E55F1}
65+
{CB9E38BC-EE86-44EB-AFF5-91D1AF713ADC} = {D152DA0B-8F60-4611-B613-642379E2B17C}
66+
{8DCCA688-871C-49DD-BC06-4877F714497C} = {78399A41-F06A-4B35-AA24-E2E20209D8DE}
67+
EndGlobalSection
68+
EndGlobal

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,58 @@
11
# PackageTemplate
2+
23
A template repository for creating an extension package for BioFSharp.
4+
5+
## Content
6+
7+
- `src/BioFSharp.XYZ`: The main project folder. Contains a library with BioFSharp core dependency.
8+
- `tests/BioFSharp.XYZ.Tests`: The test project folder. Contains a XUnit test project
9+
-
10+
11+
## Setup
12+
13+
Here is a list of things you should/might want to do after setting up a repo with this template:
14+
15+
> [!IMPORTANT]
16+
> Whenever you change a project file name or folder, make sure to fix the solution registration afterwards.
17+
18+
- Rename some things: Replace `XYZ` with the name of your package
19+
- `PackageTemplate.sln`
20+
- `src/BioFSharp.XYZ`
21+
- `src/BioFSharp.XYZ/BioFSharp.XYZ.fsproj`
22+
- `tests/BioFSharp.XYZ`
23+
- `tests/BioFSharp.XYZ.Tests/BioFSharp.XYZ.Tests.fsproj`
24+
- Also make sure to fix the project reference to BioFSharp.XYZ when renamed
25+
- in `build/ProjectInfo.fs`:
26+
- Set project name:
27+
```fsharp
28+
let project = "BioFSharp.XYZ"` // replace with the name of your project
29+
```
30+
- Set git owner:
31+
```fsharp
32+
let gitOwner = "BioFSharp" // replace with github account name or organization where repo is hosted if necessary
33+
```
34+
- fix test project path:
35+
```fsharp
36+
let testProjects =
37+
[
38+
"tests/BioFSharp.XYZ.Tests/BioFSharp.XYZ.Tests.fsproj" // replace with the name of your test project
39+
]
40+
```
41+
- If needed, change the target framework of the project. it currently targets `.net8.0`, might want to target a newer version if you need a specific API, or `netstandard2.0` for increased backwards compatibility.
42+
43+
## Build
44+
45+
This repo contains a buildproject that can be called either via `build.cmd`, `build.sh`, or directly via `dotnet run`.
46+
47+
Find all build targets in `build/Build.fs`.
48+
49+
Examples:
50+
51+
- run the default build target (`Build`) via build.cmd:
52+
```bash
53+
./build.cmd
54+
```
55+
- run the `RunTests` target in build.sh:
56+
```bash
57+
./build.sh RunTests
58+
```

RELEASE_NOTES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
### 0.0.0 (Released 2025-4-7)
2+
* Additions:
3+
* Initial set up for RELEASE_Notes.md
4+

build.cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
3+
dotnet run --project ./build/build.fsproj %*

build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
set -eu
4+
set -o pipefail
5+
6+
dotnet run --project ./build/build.fsproj "$@"

build/BasicTasks.fs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
module BasicTasks
2+
3+
open BlackFox.Fake
4+
open Fake.IO
5+
open Fake.DotNet
6+
open Fake.IO.Globbing.Operators
7+
8+
open ProjectInfo
9+
10+
let clean = BuildTask.create "Clean" [] {
11+
!! "src/**/bin"
12+
++ "src/**/obj"
13+
++ "tests/**/bin"
14+
++ "tests/**/obj"
15+
++ "pkg"
16+
|> Shell.cleanDirs
17+
}
18+
19+
20+
let setPrereleaseTag = BuildTask.create "SetPrereleaseTag" [] {
21+
printfn "Please enter pre-release package suffix"
22+
let suffix = System.Console.ReadLine()
23+
prereleaseSuffix <- suffix
24+
prereleaseTag <- (sprintf "%s-%s" release.NugetVersion suffix)
25+
isPrerelease <- true
26+
}
27+
28+
/// builds the solution file (dotnet build solution.sln)
29+
let buildSolution =
30+
BuildTask.create "BuildSolution" [ clean ] {
31+
solutionFile
32+
|> DotNet.build (fun p ->
33+
{ p with MSBuildParams = { p.MSBuildParams with DisableInternalBinLog = true }}
34+
|> DotNet.Options.withCustomParams (Some "-tl")
35+
)
36+
}
37+

build/Build.fs

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
open BlackFox.Fake
2+
open System.IO
3+
open Fake.Core
4+
open Fake.DotNet
5+
open Fake.IO
6+
open Fake.IO.FileSystemOperators
7+
open Fake.IO.Globbing.Operators
8+
open Fake.Tools
9+
10+
open Helpers
11+
12+
initializeContext()
13+
14+
open BasicTasks
15+
open TestTasks
16+
open PackageTasks
17+
open DocumentationTasks
18+
open ReleaseTasks
19+
20+
/// Full release of nuget package, git tag, and documentation for the stable version.
21+
let _release =
22+
BuildTask.createEmpty
23+
"Release"
24+
[clean; buildSolution; runTests; pack; buildDocs; createTag; publishNuget; releaseDocs]
25+
26+
/// Full release of nuget package, git tag, and documentation for the prerelease version.
27+
let _preRelease =
28+
BuildTask.createEmpty
29+
"PreRelease"
30+
[setPrereleaseTag; clean; buildSolution; runTests; packPrerelease; buildDocsPrerelease; createPrereleaseTag; publishNugetPrerelease; prereleaseDocs]
31+
32+
/// Full release of nuget package for the prerelease version.
33+
let _releaseNoDocs =
34+
BuildTask.createEmpty
35+
"ReleaseNoDocs"
36+
[clean; buildSolution; runTests; pack; createTag; publishNuget;]
37+
38+
/// Full release of nuget package for the prerelease version.
39+
let _preReleaseNoDocs =
40+
BuildTask.createEmpty
41+
"PreReleaseNoDocs"
42+
[setPrereleaseTag; clean; buildSolution; runTests; packPrerelease; createPrereleaseTag; publishNugetPrerelease]
43+
44+
[<EntryPoint>]
45+
let main args =
46+
runOrDefault buildSolution args

0 commit comments

Comments
 (0)