Skip to content

Commit

Permalink
Add JMH annotation processing for JDK-20+ sources
Browse files Browse the repository at this point in the history
Signed-off-by: Andriy Redko <[email protected]>
  • Loading branch information
reta committed Dec 11, 2023
1 parent 2969070 commit 3f57c39
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions benchmarks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,12 @@ if (BuildParams.runtimeJavaVersion >= JavaVersion.VERSION_20) {
dependencies {
java20Implementation sourceSets.main.output
java20Implementation project(':libs:opensearch-common').sourceSets.java20.output
java20AnnotationProcessor "org.openjdk.jmh:jmh-generator-annprocess:$versions.jmh"
}

compileJava20Java {
targetCompatibility = JavaVersion.VERSION_20
options.compilerArgs.addAll(["-processor", "org.openjdk.jmh.generators.BenchmarkProcessor"])
}

jar {
Expand All @@ -118,4 +120,7 @@ if (BuildParams.runtimeJavaVersion >= JavaVersion.VERSION_20) {
}
manifest.attributes('Multi-Release': 'true')
}

// classes generated by JMH can use all sorts of forbidden APIs but we have no influence at all and cannot exclude these classes
disableTasks('forbiddenApisJava20')
}

0 comments on commit 3f57c39

Please sign in to comment.