From 5cff6d677dae6eda27140c3c94c9edcc8648cd4e Mon Sep 17 00:00:00 2001 From: ZhangLe2016 <156590889+ZhangLe2016@users.noreply.github.com> Date: Tue, 10 Dec 2024 23:43:58 +0800 Subject: [PATCH] [build] check any raw SWIG wrapper files generated by SWIG (#309) To avoid generating raw wrapper files, we perform checks during the build process to prevent this. --- android/build-commissioner-libs.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/android/build-commissioner-libs.sh b/android/build-commissioner-libs.sh index 651a0946..4ab5947b 100755 --- a/android/build-commissioner-libs.sh +++ b/android/build-commissioner-libs.sh @@ -67,6 +67,14 @@ cd ../ rm -rf "$BUILD_DIR"/libs && mkdir -p "$BUILD_DIR"/libs +## Check JNI contains any raw swig wrapper files + +if find "$BUILD_DIR"/src/java/io/openthread/commissioner -name "SWIGTYPE_*" -print -quit | grep -q .; then + echo "*********** please check SWIG file \"commissioner.i\" ***********" + echo "Failed to create JAR library due to raw swig wrapper files under $BUILD_DIR/src/java/io/openthread/commissioner" + exit -1 +fi + ## Create JAR library javac -source 8 -target 8 "$BUILD_DIR"/src/java/io/openthread/commissioner/*.java