Skip to content

Commit

Permalink
Fix thirdPartyAudit task when running on Java 24 (elastic#121712)
Browse files Browse the repository at this point in the history
We need to explicitly add the incubating vector API module to the third
party audit task on Java 24.
  • Loading branch information
mark-vieira committed Feb 4, 2025
1 parent 9163086 commit f9b92ac
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import static org.gradle.api.JavaVersion.VERSION_21;
import static org.gradle.api.JavaVersion.VERSION_22;
import static org.gradle.api.JavaVersion.VERSION_23;
import static org.gradle.api.JavaVersion.VERSION_24;

@CacheableTask
public abstract class ThirdPartyAuditTask extends DefaultTask {
Expand Down Expand Up @@ -341,8 +342,12 @@ private String runForbiddenAPIsCli() throws IOException {
spec.setExecutable(javaHome.get() + "/bin/java");
}
spec.classpath(getForbiddenAPIsClasspath(), getThirdPartyClasspath());
// Enable explicitly for each release as appropriate. Just JDK 20/21/22/23 for now, and just the vector module.
if (isJavaVersion(VERSION_20) || isJavaVersion(VERSION_21) || isJavaVersion(VERSION_22) || isJavaVersion(VERSION_23)) {
// Enable explicitly for each release as appropriate. Just JDK 20/21/22/23/24 for now, and just the vector module.
if (isJavaVersion(VERSION_20)
|| isJavaVersion(VERSION_21)
|| isJavaVersion(VERSION_22)
|| isJavaVersion(VERSION_23)
|| isJavaVersion(VERSION_24)) {
spec.jvmArgs("--add-modules", "jdk.incubator.vector");
}
spec.jvmArgs("-Xmx1g");
Expand Down

0 comments on commit f9b92ac

Please sign in to comment.