Skip to content

Commit

Permalink
Fixed JNI headers generation task
Browse files Browse the repository at this point in the history
  • Loading branch information
Vovchyk committed Aug 30, 2021
1 parent 396ec5f commit c00d30b
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 c00d30b

Please sign in to comment.