@@ -32,7 +32,7 @@ For maven, the natives will
3232<dependency >
3333 <groupId >com.aayushatharva.brotli4j</groupId >
3434 <artifactId >brotli4j</artifactId >
35- <version >1.14 .0</version >
35+ <version >1.15 .0</version >
3636</dependency >
3737```
3838
@@ -48,7 +48,7 @@ import org.gradle.nativeplatform.platform.internal.Architectures
4848import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
4949import org.gradle.nativeplatform.operatingsystem.OperatingSystem
5050
51- val brotliVersion = " 1.14 .0"
51+ val brotliVersion = " 1.15 .0"
5252val operatingSystem: OperatingSystem = DefaultNativePlatform .getCurrentOperatingSystem()
5353
5454repositories {
@@ -60,7 +60,11 @@ dependencies {
6060 runtimeOnly(
6161 " com.aayushatharva.brotli4j:native-" +
6262 if (operatingSystem.isWindows) {
63- " windows-x86_64"
63+ if (DefaultNativePlatform .getCurrentArchitecture().isArm()) {
64+ " windows-aarch64"
65+ } else {
66+ " windows-x86_64"
67+ }
6468 } else if (operatingSystem.isMacOsX) {
6569 if (DefaultNativePlatform .getCurrentArchitecture().isArm()) {
6670 " osx-aarch64"
@@ -78,6 +82,8 @@ dependencies {
7882 " linux-s390x"
7983 } else if (Architectures .RISCV_64 .isAlias(DefaultNativePlatform .getCurrentArchitecture().name)) {
8084 " linux-riscv64"
85+ } else if (Architectures .PPC64LE .isAlias(DefaultNativePlatform .getCurrentArchitecture().name)) {
86+ " linux-ppc64le"
8187 } else {
8288 throw IllegalStateException (" Unsupported architecture: ${DefaultNativePlatform .getCurrentArchitecture().name} " )
8389 }
@@ -94,8 +100,9 @@ dependencies {
94100import org.gradle.nativeplatform.platform.internal.Architectures
95101import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
96102
97- def brotliVersion = "1.14 .0"
103+ def brotliVersion = "1.15 .0"
98104def operatingSystem = DefaultNativePlatform.getCurrentOperatingSystem()
105+ def currentArchitecture = DefaultNativePlatform.getCurrentArchitecture()
99106
100107repositories {
101108 mavenCentral()
@@ -104,18 +111,23 @@ repositories {
104111dependencies {
105112 implementation "com.aayushatharva.brotli4j:brotli4j:$brotliVersion"
106113 runtimeOnly("""com.aayushatharva.brotli4j:native-${
107- if (operatingSystem.isWindows()) "windows-x86_64"
114+ if (operatingSystem.isWindows())
115+ if (currentArchitecture.isX86_64()) "windows-x86_64"
116+ else if (currentArchitecture.isArm()) "windows-aarch64"
117+ else
118+ throw new IllegalStateException("Unsupported architecture: ${currentArchitecture.getName()}");
108119 else if (operatingSystem.isMacOsX())
109- if (DefaultNativePlatform.getCurrentArchitecture() .isArm()) "osx-aarch64"
120+ if (currentArchitecture .isArm()) "osx-aarch64"
110121 else "osx-x86_64"
111122 else if (operatingSystem.isLinux())
112- if (Architectures.ARM_V7.isAlias(DefaultNativePlatform.getCurrentArchitecture().getName())) "linux-armv7"
113- else if (Architectures.AARCH64.isAlias(DefaultNativePlatform.getCurrentArchitecture().getName())) "linux-aarch64"
114- else if (Architectures.X86_64.isAlias(DefaultNativePlatform.getCurrentArchitecture().getName())) "linux-x86_64"
115- else if (Architectures.S390X.isAlias(DefaultNativePlatform.getCurrentArchitecture().getName())) "linux-s390x"
116- else if (Architectures.RISCV_64.isAlias(DefaultNativePlatform.getCurrentArchitecture().getName())) "linux-riscv64"
123+ if (currentArchitecture.isAARCH64()) "linux-aarch64"
124+ else if (currentArchitecture.isX86_64()) "linux-x86_64"
125+ else if (currentArchitecture.isARM_V7()) "linux-armv7"
126+ else if (currentArchitecture.isPPC64LE()) "linux-ppc64le"
127+ else if (currentArchitecture.isS390X()) "linux-s390x"
128+ else if (currentArchitecture.isRISCV64()) "linux-riscv64"
117129 else
118- throw new IllegalStateException("Unsupported architecture: ${DefaultNativePlatform.getCurrentArchitecture() .getName()}");
130+ throw new IllegalStateException("Unsupported architecture: ${currentArchitecture .getName()}");
119131 else
120132 throw new IllegalStateException("Unsupported operating system: $operatingSystem");
121133 }:$brotliVersion""")
0 commit comments