Skip to content

Commit

Permalink
Merge pull request #23 from rsksmart/gen-jni-headers-fix
Browse files Browse the repository at this point in the history
Fixed JNI headers generation task
  • Loading branch information
aeidelman authored Sep 1, 2021
2 parents 396ec5f + c00d30b commit d8b920a
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ task buildAltbn128(group: 'altbn128', description: 'builds altbn128 library with

task buildSecp256k1CurrentOS(group: 'secp256k1', description: 'builds secp256k1 library for current OS (helpful for development)') {
dependsOn 'cleanSecp256k1'
dependsOn 'replaceJniHeaders'
doLast {
exec {
workingDir 'secp256k1'
Expand Down Expand Up @@ -193,6 +194,7 @@ task buildSecp256k1CurrentOS(group: 'secp256k1', description: 'builds secp256k1

task buildSecp256k1Cross(group: 'secp256k1', description: 'builds secp256k1 for Linux, Mac and Windows (only linux library supports reproducibility)') {
dependsOn 'cleanSecp256k1'
dependsOn 'replaceJniHeaders'
doLast {
exec {
workingDir 'secp256k1'
Expand Down Expand Up @@ -255,13 +257,16 @@ task generateJniHeaders(group: 'JNI', type: JavaCompile, description: 'generates
}

task replaceJniHeaders(group: 'JNI', description: 'Replaces JNI old headers with generated headers (for each library)') {
copy {
from 'build/generated/jni/org_bitcoin_NativeSecp256k1.h'
into 'secp256k1/jni/'
}
copy {
from 'build/generated/jni/org_bitcoin_Secp256k1Context.h'
into 'secp256k1/jni/'
dependsOn 'generateJniHeaders'
doLast {
copy {
from "${buildDir}/generated/jni/org_bitcoin_NativeSecp256k1.h"
into "${rootDir}/secp256k1/jni/"
}
copy {
from "${buildDir}/generated/jni/org_bitcoin_Secp256k1Context.h"
into "${rootDir}/secp256k1/jni/"
}
}
}

Expand Down

0 comments on commit d8b920a

Please sign in to comment.