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/scriptcraft/scripts/download-jni-headers.sh
TheBrokenRail 0e3b0cbc87
Some checks failed
ScriptCraft/pipeline/head There was a failure building this commit
Use Composite Builds
2020-05-31 13:25:16 -04:00

33 lines
583 B
Bash
Executable File

#!/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