Skip to content

Commit

Permalink
feat(arch): support x86 on jdk17
Browse files Browse the repository at this point in the history
  • Loading branch information
halibobo1205 committed Dec 3, 2024
1 parent b6a283e commit bc91010
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/x86_64-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ on:

jobs:
build:

name: ${{ matrix.os }} - ${{ matrix.os-version }}
name: ${{ matrix.os }} - ${{ matrix.os-version }} - JDK ${{ matrix.java-version }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 60

strategy:
fail-fast: false
Expand All @@ -28,29 +28,34 @@ jobs:
arch: x86_64
runner: macos-12
os-version: "12"
java-version: '8'
- os: macOS
arch: x86_64
runner: macos-13
os-version: "13"
java-version: '17'
# Linux x86_64 runners
- os: Linux
arch: x86_64
runner: ubuntu-20.04
os-version: "20.04"
java-version: '8'
- os: Linux
arch: x86_64
runner: ubuntu-22.04
os-version: "22.04"
java-version: '17'

permissions:
contents: read

steps:
- uses: actions/checkout@v4
- name: Set up JDK 8

- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: '8'
java-version: ${{ matrix.java-version }}
distribution: 'zulu'

# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ if (isArm64() && !JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)
" Detected version ${JavaVersion.current()}")
}

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

Expand Down
8 changes: 6 additions & 2 deletions platform/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ static def isX86() {
return Architectures.X86_64.isAlias(arch) || Architectures.X86.isAlias(arch)
}

if (isX86()) {
static def isJava8() {
return JavaVersion.current().isJava8()
}

if (isX86() && isJava8()) {
ext {
leveldbGroup = "org.fusesource.leveldbjni"
leveldbName = "leveldbjni-all"
Expand Down Expand Up @@ -43,5 +47,5 @@ dependencies {
}

tasks.withType(JavaCompile).configureEach {
source = isX86() ? sourceSets.x86.java : sourceSets.arm.java
source = isX86() && isJava8() ? sourceSets.x86.java : sourceSets.arm.java
}

0 comments on commit bc91010

Please sign in to comment.