diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e1ac06b..b9f1929 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -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: diff --git a/README.md b/README.md index 1098921..785182d 100644 --- a/README.md +++ b/README.md @@ -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>() + .filterNot { it.get().name == "processResources" }) + } + getTasksByName("quarkusGenerateCodeDev", true).forEach { task -> + task.setDependsOn(task.dependsOn.filterIsInstance>() + .filterNot { it.get().name == "processResources" }) + } +} +``` ## Requirements - Quarkus version `3.9.2` or newer