Skip to content

Commit ac44b7e

Browse files
authored
Merge pull request #1960 from tpolecat/fix_always_recompile
Make freeGen2 run manually (but verified by CI)
2 parents c8e9226 + d0a0af3 commit ac44b7e

File tree

5 files changed

+54
-30
lines changed

5 files changed

+54
-30
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
run: sbt githubWorkflowCheck
6262

6363
- name: Test
64-
run: sbt '++ ${{ matrix.scala }}' test
64+
run: sbt '++ ${{ matrix.scala }}' freeGen2 test
6565

6666
- name: Check binary compatibility
6767
if: matrix.java == 'temurin@11' && matrix.os == 'ubuntu-latest'

CONTRIBUTING.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Developing Doobie
2+
3+
Doobie is a multi-module SBT project.
4+
There is some code generation (project/FreeGen2.scala) which generates the free algebra (e.g. kleisliinterpreter.scala)
5+
from JDBC driver classes definitions.
6+
7+
Running the tests or building the documentation site requires connection to the example Postgres docker contains,
8+
which you can spin up using docker-compose:
9+
10+
```
11+
docker-compose up -d --force-update
12+
```
13+
14+
After that, in SBT you can run `test` to run tests, and `makeSite` to build the doc site
15+
16+
If you're editing code generation related code, you should reload the SBT project and then run the `freeGen2` SBT task
17+
before compiling or running tests.
18+
19+
# Publishing
20+
21+
### Snapshots
22+
23+
doobie uses [sbt-ci-release](https://github.com/olafurpg/sbt-ci-release) which means all merges to `master` are pushed to Sonatype as snapshots and there's nothing to do.
24+
25+
### Releases
26+
27+
To make a release, make sure you're on the right commit, then tag it using the format here. This will trigger a release build.
28+
29+
```bash
30+
git tag -a v1.2.3 -m v1.2.3
31+
git push --tags
32+
```
33+
34+
To update the doc site, check out the tag first.
35+
36+
```
37+
git checkout v1.2.3
38+
sbt docs/publishMicrosite
39+
```
40+
41+
42+

PUBLISHING.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

build.sbt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ ThisBuild / githubWorkflowBuildPreamble ++= Seq(
4747
name = Some("Check Headers"),
4848
),
4949
)
50+
ThisBuild / githubWorkflowBuild := {
51+
val current = (ThisBuild / githubWorkflowBuild).value
52+
current.updated(0, WorkflowStep.Sbt(List("freeGen2", "test"), name = Some("Test")))
53+
}
5054
ThisBuild / githubWorkflowBuildPostamble ++= Seq(
5155
WorkflowStep.Sbt(
5256
commands = List("checkGitNoUncommittedChanges"),

project/FreeGen2.scala

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
import sbt._, Keys._
2-
import java.lang.reflect._
1+
import sbt.*
2+
import Keys.*
3+
4+
import java.lang.reflect.*
35
import scala.reflect.ClassTag
4-
import Predef._
6+
import Predef.*
7+
import org.typelevel.sbt.gha.GenerativeKeys.githubWorkflowBuild
8+
import org.typelevel.sbt.gha.GenerativePlugin.autoImport.WorkflowStep
59

610
object FreeGen2 {
711

@@ -26,7 +30,6 @@ object FreeGen2 {
2630
freeGen2KleisliInterpreterImportExcludes.value,
2731
state.value.log
2832
).gen(freeGen2Dir.value),
29-
Compile / compile := (Compile / compile).dependsOn(freeGen2).value
3033
)
3134

3235
}

0 commit comments

Comments
 (0)