From 386da5be0010657f9d9f82c4a5e24d48918297c7 Mon Sep 17 00:00:00 2001 From: lezhan Date: Fri, 6 Dec 2024 03:48:43 +0000 Subject: [PATCH 1/4] [swig] Check the JNI files generated by SWIG for any errors in the SWIG wrappers --- android/build-commissioner-libs.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/android/build-commissioner-libs.sh b/android/build-commissioner-libs.sh index 651a0946..809f9afe 100755 --- a/android/build-commissioner-libs.sh +++ b/android/build-commissioner-libs.sh @@ -67,6 +67,15 @@ cd ../ rm -rf "$BUILD_DIR"/libs && mkdir -p "$BUILD_DIR"/libs +## Check JNI contains any unexpected files + +if find "$BUILD_DIR"/src/java/io/openthread/commissioner -name "SWIGTYPE_p_std__*" -print -quit | grep -q .; then + echo "*********** please check SWIG file \"commissioner.i\" ***********" + echo "Failed to create JAR library due to unexpected JNI files under $BUILD_DIR/src/java/io/openthread/commissioner" + find "$BUILD_DIR"/src/java/io/openthread/commissioner -name "SWIGTYPE_p_*" + exit -1 +fi + ## Create JAR library javac -source 8 -target 8 "$BUILD_DIR"/src/java/io/openthread/commissioner/*.java From 48bcd43eff7f6d4df4b7b2e9dc3ee012e01ad157 Mon Sep 17 00:00:00 2001 From: lezhan Date: Fri, 6 Dec 2024 04:07:28 +0000 Subject: [PATCH 2/4] Updated the output log --- android/build-commissioner-libs.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/build-commissioner-libs.sh b/android/build-commissioner-libs.sh index 809f9afe..162a9436 100755 --- a/android/build-commissioner-libs.sh +++ b/android/build-commissioner-libs.sh @@ -67,11 +67,11 @@ cd ../ rm -rf "$BUILD_DIR"/libs && mkdir -p "$BUILD_DIR"/libs -## Check JNI contains any unexpected files +## Check JNI contains any raw swig wrapper files if find "$BUILD_DIR"/src/java/io/openthread/commissioner -name "SWIGTYPE_p_std__*" -print -quit | grep -q .; then echo "*********** please check SWIG file \"commissioner.i\" ***********" - echo "Failed to create JAR library due to unexpected JNI files under $BUILD_DIR/src/java/io/openthread/commissioner" + echo "Failed to create JAR library due to raw swig wrapper files under $BUILD_DIR/src/java/io/openthread/commissioner" find "$BUILD_DIR"/src/java/io/openthread/commissioner -name "SWIGTYPE_p_*" exit -1 fi From 4e7bdd5b390e2e57d79c6a7ce278eaccfa7d3068 Mon Sep 17 00:00:00 2001 From: ZhangLe2016 <156590889+ZhangLe2016@users.noreply.github.com> Date: Tue, 10 Dec 2024 05:51:10 +0000 Subject: [PATCH 3/4] Update android/build-commissioner-libs.sh Co-authored-by: Kangping --- android/build-commissioner-libs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/build-commissioner-libs.sh b/android/build-commissioner-libs.sh index 162a9436..b858a372 100755 --- a/android/build-commissioner-libs.sh +++ b/android/build-commissioner-libs.sh @@ -69,7 +69,7 @@ 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_p_std__*" -print -quit | grep -q .; then +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" find "$BUILD_DIR"/src/java/io/openthread/commissioner -name "SWIGTYPE_p_*" From 7d2d4f525616f6d58a9082a7040b32de949d9e4d Mon Sep 17 00:00:00 2001 From: ZhangLe2016 <156590889+ZhangLe2016@users.noreply.github.com> Date: Tue, 10 Dec 2024 05:51:10 +0000 Subject: [PATCH 4/4] Update android/build-commissioner-libs.sh Co-authored-by: Kangping --- android/build-commissioner-libs.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/android/build-commissioner-libs.sh b/android/build-commissioner-libs.sh index b858a372..4ab5947b 100755 --- a/android/build-commissioner-libs.sh +++ b/android/build-commissioner-libs.sh @@ -72,7 +72,6 @@ rm -rf "$BUILD_DIR"/libs && mkdir -p "$BUILD_DIR"/libs 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" - find "$BUILD_DIR"/src/java/io/openthread/commissioner -name "SWIGTYPE_p_*" exit -1 fi