Skip android aar builds if no API header is available.

This commit is contained in:
Péter Szilágyi 2016-04-18 17:18:10 +03:00
parent 60aa71bb38
commit 8c6a1b73ab
1 changed files with 28 additions and 23 deletions

View File

@ -260,7 +260,11 @@ for TARGET in $TARGETS; do
# Generate the JNI wrappers automatically with SWIG
jni=`mktemp -d`
cp `find /build-android-aar | grep '\.h$' | head -n 1` $jni/$NAME.h
header=`find /build-android-aar | grep '\.h$' | head -n 1`
if [ "$header" == "" ]; then
echo "No API C header specified, skipping android-$PLATFORM/aar..."
else
cp $header $jni/$NAME.h
sed -i -e 's|__complex|complex|g' $jni/$NAME.h
sed -i -e 's|_Complex|complex|g' $jni/$NAME.h
echo -e "%module $title\n%{\n#include \"$NAME.h\"\n%}\n%pragma(java) jniclasscode=%{\nstatic {\nSystem.loadLibrary(\"$NAME\");\n}\n%}\n%include \"$NAME.h\"" > $jni/$NAME.i
@ -289,6 +293,7 @@ for TARGET in $TARGETS; do
(cd $archive && zip -r $bundle *)
rm -rf $jni $archive
fi
fi
# Clean up the android builds, toolchains and runtimes
rm -rf /build-android-aar
rm -rf /usr/local/go/pkg/android_*