From be68621d73e0c02ac2d830faf84e3cc5077d7f81 Mon Sep 17 00:00:00 2001 From: Nischal Sharma Date: Wed, 14 Aug 2024 14:10:20 +0530 Subject: [PATCH] fix for mac lib not getting copied Signed-off-by: Nischal Sharma --- constantine/build.gradle | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/constantine/build.gradle b/constantine/build.gradle index 92285205..1405a571 100644 --- a/constantine/build.gradle +++ b/constantine/build.gradle @@ -39,17 +39,36 @@ if (osName.contains('mac') && osArch.contains('aarch64')) { libDir = 'linux-gnu-x86_64' } -task libCopy(type: Copy) { - from "build/${libDir}/lib/" - into "build/resources/main/lib/${libDir}" +task macArmLibCopy(type: Copy) { + from "build/darwin-aarch64/lib/libconstantine.dylib" + from "build/darwin-aarch64/lib/libconstantineeip196.jnilib" + into 'build/resources/main/lib/darwin-aarch64' } -processResources.dependsOn libCopy +task macLibCopy(type: Copy) { + from "build/darwin-x86-64/lib/libconstantine.dylib" + from "build/darwin-x86-64/lib/libconstantineeip196.jnilib" + into 'build/resources/main/lib/darwin-x86-64' +} + +task linuxLibCopy(type: Copy) { + from "build/linux-gnu-x86_64/lib/libconstantine.so" + from "build/linux-gnu-x86_64/lib/libconstantineeip196.so" + into 'build/resources/main/lib/linux-gnu-x86_64' +} + +task linuxArm64LibCopy(type: Copy) { + from "build/linux-gnu-aarch64/lib/libconstantine.so" + from "build/linux-gnu-aarch64/lib/libconstantineeip196.so" + into 'build/resources/main/lib/linux-gnu-aarch64' +} + +processResources.dependsOn macArmLibCopy, macLibCopy, linuxLibCopy, linuxArm64LibCopy task compileJavaSource(type: Exec) { description = 'Compiles the Java source files' commandLine 'javac', '-d', 'build', 'src/main/java/org/hyperledger/besu/nativelib/constantine/LibConstantineEIP196.java' - dependsOn libCopy + dependsOn macArmLibCopy, macLibCopy, linuxLibCopy, linuxArm64LibCopy } tasks.named('test', Test) {