Skip to content

Commit

Permalink
feat(arm): limit jdk for x86 and arm
Browse files Browse the repository at this point in the history
  • Loading branch information
halibobo1205 committed Nov 5, 2024
1 parent cfb07a0 commit 9565da7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions arch/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ static def isX86() {
return Architectures.X86_64.isAlias(arch) || Architectures.X86.isAlias(arch)
}

static def isArm64() {
def arch = System.getProperty("os.arch").toLowerCase()
return new Architectures.KnownArchitecture("arm64", "aarch64").isAlias(arch)
}

if (isArm64() && !JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) {
throw new GradleException("Java 17 or later is required to build Java-Tron for arm64.\n" +
" Detected version ${JavaVersion.current()}")
}

if (isX86() && !JavaVersion.current().isJava8()) {
throw new GradleException("Java 8 is required to build Java-Tron for x86.\n" +
" Detected version ${JavaVersion.current()}")
}

if (isX86()) {
ext {
leveldbGroup = "org.fusesource.leveldbjni"
Expand Down

0 comments on commit 9565da7

Please sign in to comment.