Skip to content

Commit

Permalink
build: Set jandex as a dependency to compileTestJava
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmiray committed Mar 30, 2023
1 parent 12b419c commit 8b9f879
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import org.gradle.api.tasks.Copy
import org.gradle.api.tasks.SourceSetContainer
import org.gradle.api.tasks.TaskProvider
import org.gradle.api.tasks.bundling.Jar
import org.gradle.api.tasks.compile.JavaCompile
import org.kordamp.gradle.plugin.jandex.internal.JandexExtensionImpl
import org.kordamp.gradle.plugin.jandex.tasks.JandexTask

Expand Down Expand Up @@ -82,6 +83,16 @@ class JandexPlugin implements Plugin<Project> {
}
})

project.tasks.named('compileTestJava', JavaCompile).configure(new Action<JavaCompile>() {
@Override
@CompileDynamic
void execute(JavaCompile t) {
if (jandex.get().resolvedIncludeInJar.get()) {
t.dependsOn(jandex)
}
}
})

project.tasks.named('jar', Jar).configure(new Action<Jar>() {
@Override
@CompileDynamic
Expand Down

0 comments on commit 8b9f879

Please sign in to comment.