Skip to content

Commit

Permalink
fixed mac libs not getting copied
Browse files Browse the repository at this point in the history
Signed-off-by: Nischal Sharma <nischal@web3labs.com>
  • Loading branch information
NickSneo committed Aug 14, 2024
1 parent bc48568 commit 06f1c4a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,10 @@ jobs:
with:
name: jars
path: gnark/build/libs
- uses: actions/upload-artifact@v3.1.0
with:
name: jars
path: constantine/build/libs
- name: gradle publish
uses: gradle/gradle-build-action@v2
if: contains('refs/heads/release-', github.ref) || github.ref == 'refs/heads/main'
Expand Down
29 changes: 24 additions & 5 deletions constantine/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 06f1c4a

Please sign in to comment.