Skip to content

Commit

Permalink
Add Gradle task fixes to README
Browse files Browse the repository at this point in the history
  • Loading branch information
Thijsiez committed Oct 29, 2024
1 parent f9d184f commit 8808b3e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Test
name: test

on: [push, workflow_dispatch]

jobs:
build:
name: Test
name: test
runs-on: ubuntu-latest
permissions: read-all
steps:
Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,31 @@ ksp {
arg("addGeneratedAnnotation", "true")
}
```
Important: fix Gradle task dependency issues when combining Quarkus and KSP
```kotlin
//Fixes issue with task execution order
tasks.compileKotlin {
dependsOn(tasks.compileQuarkusGeneratedSourcesJava)
}
tasks.configureEach {
if (name == "kspKotlin") {
dependsOn(tasks.compileQuarkusGeneratedSourcesJava)
}
}

//Fixes issue with circular task dependency,
//see https://github.com/quarkusio/quarkus/issues/29698#issuecomment-1671861607
project.afterEvaluate {
getTasksByName("quarkusGenerateCode", true).forEach { task ->
task.setDependsOn(task.dependsOn.filterIsInstance<Provider<Task>>()
.filterNot { it.get().name == "processResources" })
}
getTasksByName("quarkusGenerateCodeDev", true).forEach { task ->
task.setDependsOn(task.dependsOn.filterIsInstance<Provider<Task>>()
.filterNot { it.get().name == "processResources" })
}
}
```

## Requirements
- Quarkus version `3.9.2` or newer
Expand Down

0 comments on commit 8808b3e

Please sign in to comment.