android: build BarcodeScannerView from src
Adds a script `make_barcode_scanner.sh` which builds the `BarcodeScannerView` library and its dependencies, `zxing-cpp` and `CameraView` from source. Builds `zxing-cpp` architecture dependent reducing the final apk size.
This commit is contained in:
@@ -27,10 +27,6 @@ info "preparing electrum-locale."
|
||||
rm -r "$PROJECT_ROOT/electrum/locale/locale"/*/electrum.po
|
||||
)
|
||||
|
||||
# fetch barcode scanner aars
|
||||
info "fetching barcode scanner aars."
|
||||
"$CONTRIB_ANDROID"/fetch_barcode_scanner.sh || fail "fetch_barcode_scanner.sh failed"
|
||||
|
||||
pushd "$CONTRIB_ANDROID"
|
||||
|
||||
info "apk building phase starts."
|
||||
@@ -90,16 +86,22 @@ if [[ "$2" == "all" ]] ; then
|
||||
# FIXME failures are not propagated out: we should fail the script if any arch build fails
|
||||
export APP_ANDROID_ARCHS=armeabi-v7a
|
||||
export APP_ANDROID_NUMERIC_VERSION=$("$CONTRIB_ANDROID"/get_apk_versioncode.py "$APP_ANDROID_ARCHS")
|
||||
"$CONTRIB_ANDROID"/make_barcode_scanner.sh "$APP_ANDROID_ARCHS" || fail "make_barcode_scanner.sh failed"
|
||||
make $TARGET
|
||||
|
||||
export APP_ANDROID_ARCHS=arm64-v8a
|
||||
export APP_ANDROID_NUMERIC_VERSION=$("$CONTRIB_ANDROID"/get_apk_versioncode.py "$APP_ANDROID_ARCHS")
|
||||
"$CONTRIB_ANDROID"/make_barcode_scanner.sh "$APP_ANDROID_ARCHS" || fail "make_barcode_scanner.sh failed"
|
||||
make $TARGET
|
||||
|
||||
export APP_ANDROID_ARCHS=x86_64
|
||||
export APP_ANDROID_NUMERIC_VERSION=$("$CONTRIB_ANDROID"/get_apk_versioncode.py "$APP_ANDROID_ARCHS")
|
||||
"$CONTRIB_ANDROID"/make_barcode_scanner.sh "$APP_ANDROID_ARCHS" || fail "make_barcode_scanner.sh failed"
|
||||
make $TARGET
|
||||
else
|
||||
export APP_ANDROID_ARCHS=$2
|
||||
export APP_ANDROID_NUMERIC_VERSION=$("$CONTRIB_ANDROID"/get_apk_versioncode.py "$APP_ANDROID_ARCHS")
|
||||
"$CONTRIB_ANDROID"/make_barcode_scanner.sh "$APP_ANDROID_ARCHS" || fail "make_barcode_scanner.sh failed"
|
||||
make $TARGET
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user