ci(release): fix tesseract build — use root gradlew with :tesseract4android task

This commit is contained in:
vjrj 2026-07-19 06:36:25 +02:00
parent a575f01207
commit f968f64de8

View file

@ -77,7 +77,8 @@ jobs:
# Install the exact NDK the project pins, if the image lacks it. # Install the exact NDK the project pins, if the image lacks it.
ndkv=$(grep -RhoE 'ndkVersion[^0-9]*[0-9][0-9.]+' "$t4a" | grep -oE '[0-9]+\.[0-9.]+' | head -1 || true) ndkv=$(grep -RhoE 'ndkVersion[^0-9]*[0-9][0-9.]+' "$t4a" | grep -oE '[0-9]+\.[0-9.]+' | head -1 || true)
[ -n "${ndkv:-}" ] && (yes | sdkmanager "ndk;$ndkv" >/dev/null 2>&1 || true) [ -n "${ndkv:-}" ] && (yes | sdkmanager "ndk;$ndkv" >/dev/null 2>&1 || true)
( cd "$t4a/tesseract4android" && ./gradlew --no-daemon assembleStandardRelease ) # gradlew lives at the repo root, task belongs to the :tesseract4android module.
( cd "$t4a" && ./gradlew --no-daemon :tesseract4android:assembleStandardRelease )
aar_dst=$(find ${PUB_CACHE:+$PUB_CACHE} "$HOME/.pub-cache" /root/.pub-cache /sdks 2>/dev/null \ aar_dst=$(find ${PUB_CACHE:+$PUB_CACHE} "$HOME/.pub-cache" /root/.pub-cache /sdks 2>/dev/null \
-path '*flutter_tesseract_ocr-0.4.31/android/libs/tesseract4android-release.aar' | head -1) -path '*flutter_tesseract_ocr-0.4.31/android/libs/tesseract4android-release.aar' | head -1)
cp "$t4a/tesseract4android/build/outputs/aar/tesseract4android-standard-release.aar" "$aar_dst" cp "$t4a/tesseract4android/build/outputs/aar/tesseract4android-standard-release.aar" "$aar_dst"