Skip to content

Commit

Permalink
De-hardcode natives build process Part 8
Browse files Browse the repository at this point in the history
  • Loading branch information
thecatcore committed May 28, 2024
1 parent 91115d2 commit b103aa6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/build_or_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
msvc_arch: amd64_arm64
extra_java: 17
vendor: zulu
args: -DtargetJavaHomeVar=JAVA_HOME_17_ARM64 -DtargetArch=arm64
args: -DtargetArch=arm64 -DtargetJavaHomeVar=JAVA_HOME_17_ARM64
- os: macos-13
arch: x64
args: -Dtarget.java.home="$JAVA_HOME_8_X64"
Expand Down Expand Up @@ -75,7 +75,6 @@ jobs:
run: ./gradlew compile_native ${{ matrix.args }} --stacktrace
env:
ARCHITECTURE: ${{ matrix.arch }}
TARGET_JAVA: /usr/lib/jvm/java-11-openjdk-${{ matrix.arch }}
- uses: actions/upload-artifact@v4
with:
name: natives-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.extra_java }}-${{ matrix.java_arch }}
Expand All @@ -98,18 +97,21 @@ jobs:
packages: gcc-aarch64-linux-gnu libc6-dev-arm64-cross g++-aarch64-linux-gnu
extra_java: 11
vendor: zulu
args: -Dtarget.java.home="$JAVA_HOME_11_AARCH64" -Dtarget.arch=aarch64
- os: ubuntu:20.04
arch: ppc64le
java_arch: x64
linux_arch: ppc64el
packages: gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross g++-powerpc64le-linux-gnu
extra_java: 11
vendor: temurin
args: -Dtarget.java.home="$JAVA_HOME_11_PPC64LE" -Dtarget.arch=ppc64le
- os: ubuntu:20.04
arch: riscv64
java_arch: x64
linux_arch: riscv64
packages: gcc-riscv64-linux-gnu libc6-dev-riscv64-cross g++-riscv64-linux-gnu
args: -Dtarget.java.home="/usr/lib/jvm/java-11-openjdk-riscv64" -Dtarget.arch=riscv64
continue-on-error: true
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -154,9 +156,11 @@ jobs:
- arch: armhf
image: oldstable-backports
packages: gcc-arm-linux-gnueabihf libc6-dev-armhf-cross g++-arm-linux-gnueabihf
args: -Dtarget.java.home="/usr/lib/jvm/java-11-openjdk-armhf" -Dtarget.arch=armhf
- arch: armel
image: oldstable-backports
packages: gcc-arm-linux-gnueabi libc6-dev-armel-cross g++-arm-linux-gnueabi
args: -Dtarget.java.home="/usr/lib/jvm/java-11-openjdk-armel" -Dtarget.arch=armel
# - arch: powerpc
# image: sid
# packages: gcc-powerpc-linux-gnu libc6-dev-powerpc-cross g++-powerpc-linux-gnu
Expand Down Expand Up @@ -186,7 +190,7 @@ jobs:
distribution: zulu
architecture: x64
- name: Build natives
run: ./gradlew compile_native --stacktrace
run: ./gradlew compile_native ${{ matrix.args }} --stacktrace
env:
ARCHITECTURE: ${{ matrix.arch }}
TARGET_JAVA: /usr/lib/jvm/java-11-openjdk-${{ matrix.arch }}
Expand Down
13 changes: 0 additions & 13 deletions gradle/linux.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,6 @@ def java_version = System.getProperty("target.java.version", System.getProperty(

def extra_suffix = ""

if (ENV.ARCHITECTURE) {
if (target_arch != os_arch) {
if (target_arch == "armhf" || target_arch == "riscv64" || target_arch == "armel"
|| target_arch == "powerpc" || target_arch == "ppc64") {
java_home = ENV.TARGET_JAVA
} else if (target_arch == "aarch64") {
java_home = ENV.JAVA_HOME_11_AARCH64
} else if (target_arch == "ppc64el") {
java_home = ENV.JAVA_HOME_11_PPC64LE
}
}
}

if (extra_suffix.isEmpty() && target_arch == os_arch && target_arch == "amd64" && java_version.startsWith("1.")) {
extra_suffix = "-8"
}
Expand Down

0 comments on commit b103aa6

Please sign in to comment.