Skip to content

Commit

Permalink
[mxnet] Fixes build error on JDK 22 (#3485)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankfliu authored Sep 27, 2024
1 parent e6409ad commit 2071a1c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions api/src/test/java/ai/djl/util/SecurityManagerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
package ai.djl.util;

import org.testng.Assert;
import org.testng.SkipException;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
Expand All @@ -25,6 +26,9 @@ public class SecurityManagerTest {

@BeforeTest
public void setUp() {
if (Runtime.version().version().get(0) > 17) {
throw new SkipException("Skip SecurityManagerTest for JDK 19+");
}
originalSM = System.getSecurityManager();
}

Expand Down
11 changes: 9 additions & 2 deletions engines/mxnet/jnarator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ tasks {
checkstyleMain { exclude("ai/djl/mxnet/jnarator/parser/*") }
pmdMain { exclude("ai/djl/mxnet/jnarator/parser/*") }

compileJava {
options.apply {
release = 8
encoding = "UTF-8"
compilerArgs = listOf("-proc:none", "-Xlint:all,-options,-static")
}
}

jar {
dependsOn(generateGrammarSource)
manifest {
Expand All @@ -39,5 +47,4 @@ tasks {
generateTestGrammarSource {
dependsOn(verifyJava)
}

}
}

0 comments on commit 2071a1c

Please sign in to comment.