Skip to content

Commit

Permalink
treat linux and darwin target lib dirs differently (why?)
Browse files Browse the repository at this point in the history
Signed-off-by: garyschulte <garyschulte@gmail.com>
  • Loading branch information
garyschulte committed Aug 21, 2024
1 parent 96396c9 commit 552268a
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions constantine/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ repositories {

dependencies {
implementation 'net.java.dev.jna:jna:5.12.1'
testImplementation 'net.java.dev.jna:jna:5.12.1'
testImplementation 'com.google.guava:guava:31.1-jre'
testImplementation 'io.tmio:tuweni-bytes:2.4.2'
testImplementation 'junit:junit:4.13.2'
Expand Down Expand Up @@ -37,23 +38,16 @@ task macLibCopy(type: Copy) {

task linuxLibCopy(type: Copy) {
from "build/linux-gnu-x86_64/lib/libconstantineeip196.so"
into 'build/resources/main/linux-gnu-x86_64'
into 'build/resources/main/linux-gnu-x86_64/lib'
}

task linuxArm64LibCopy(type: Copy) {
from "build/linux-gnu-aarch64/lib/libconstantineeip196.so"
into 'build/resources/main/linux-gnu-aarch64'
into 'build/resources/main/linux-gnu-aarch64/lib'
}

processResources.dependsOn macArmLibCopy, macLibCopy, linuxLibCopy, linuxArm64LibCopy

tasks.named('test', Test) {
description = 'Runs the Java tests'
def libDir = file('build/resources/main').listFiles().find { it.isDirectory() }?.name
environment 'LD_LIBRARY_PATH', "${System.env.LD_LIBRARY_PATH}:build/resources/main/${libDir}"
dependsOn macArmLibCopy, macLibCopy, linuxLibCopy, linuxArm64LibCopy
}

jar {
archiveBaseName = 'besu-native-constantine'
includeEmptyDirs = false
Expand Down

0 comments on commit 552268a

Please sign in to comment.