This repository has been archived on 2023-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
ScriptCraft/scripts/download-jni-headers.sh

33 lines
583 B
Bash
Raw Normal View History

2020-04-25 13:33:17 +00:00
#!/bin/sh
set -e
if [ -e jdk.tar.gz ]; then
rm -f jdk.tar.gz
fi
curl -o jdk.tar.gz https://hg.openjdk.java.net/jdk/jdk11/archive/tip.tar.gz
if [ -d ../src/main/c/jni ]; then
rm -rf ../src/main/c/jni
fi
mkdir ../src/main/c/jni
if [ -d jdk ]; then
rm -rf jdk
fi
mkdir jdk
tar -zxf jdk.tar.gz --strip-components=1 -C jdk
rm -f jdk.tar.gz
cp -r jdk/src/java.base/share/native/include/. ../src/main/c/jni
copy_jni() {
mkdir "../src/main/c/jni/$1"
cp -r "jdk/src/java.base/$1/native/include/." "../src/main/c/jni/$1"
}
copy_jni unix
copy_jni windows
rm -rf jdk