core-lightning/libwally-core/tools/swigjavapost.sh
Rusty Russell 1271ac8899 libwally-core: import version 3b025127cbf11912f8b95e7ff3c905d74e8433ce
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-02-21 15:15:28 +10:30

17 lines
435 B
Bash
Executable File

#!/bin/sh
sed_exe=$1
result="swig_java/src/com/blockstream/libwally/Wally.java"
mkdir -p `dirname $result`
# Merge the constants and JNI interface into Wally.java
grep -v '^}$' swig_java/wallycoreJNI.java | $sed_exe 's/wallycoreJNI/Wally/g' >$result
grep 'public final static' swig_java/wallycoreConstants.java >>$result
# Append our extra functionality
cat swig_java/jni_extra.java_in >>$result
# Clean up
rm -f swig_java/*.java