Skip to content

Commit

Permalink
Merge branch 'fix/build-apk'
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusPettersson98 committed Feb 2, 2024
2 parents 6328b94 + a02fb8a commit b6c9aba
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions build-apk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ BUILD_TYPE="release"
GRADLE_BUILD_TYPE="release"
GRADLE_TASKS=(createOssProdReleaseDistApk createPlayProdReleaseDistApk)
BUNDLE_TASKS=(createPlayProdReleaseDistBundle)
CARGO_ARGS="--release"
CARGO_ARGS=( "--release" )
EXTRA_WGGO_ARGS=""
BUILD_BUNDLE="no"
CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-"target"}
Expand All @@ -25,7 +25,7 @@ while [ -n "${1:-""}" ]; do
if [[ "${1:-""}" == "--dev-build" ]]; then
BUILD_TYPE="debug"
GRADLE_BUILD_TYPE="debug"
CARGO_ARGS=""
CARGO_ARGS=()
GRADLE_TASKS=(createOssProdDebugDistApk)
BUNDLE_TASKS=(createOssProdDebugDistBundle)
elif [[ "${1:-""}" == "--fdroid" ]]; then
Expand Down Expand Up @@ -55,9 +55,9 @@ fi
if [[ "$BUILD_TYPE" == "release" && "$PRODUCT_VERSION" != *"-dev-"* ]]; then
echo "Removing old Rust build artifacts"
cargo clean
CARGO_ARGS+=" --locked"
CARGO_ARGS+=( "--locked" )
else
CARGO_ARGS+=" --features api-override"
CARGO_ARGS+=( "--features" "api-override" )
GRADLE_TASKS+=(createPlayDevmoleReleaseDistApk createPlayStagemoleReleaseDistApk)
BUNDLE_TASKS+=(createPlayDevmoleReleaseDistBundle createPlayStagemoleReleaseDistBundle)
fi
Expand Down Expand Up @@ -103,7 +103,7 @@ for ARCHITECTURE in ${ARCHITECTURES:-aarch64 armv7 x86_64 i686}; do
esac

echo "Building mullvad-daemon for $TARGET"
cargo build "$CARGO_ARGS" --target "$TARGET" --package mullvad-jni
cargo build "${CARGO_ARGS[@]}" --target "$TARGET" --package mullvad-jni

STRIP_TOOL="${NDK_TOOLCHAIN_DIR}/llvm-strip"
TARGET_LIB_PATH="$SCRIPT_DIR/android/app/build/extraJni/$ABI/libmullvad_jni.so"
Expand All @@ -117,7 +117,7 @@ for ARCHITECTURE in ${ARCHITECTURES:-aarch64 armv7 x86_64 i686}; do
done

echo "Updating relays.json..."
cargo run --bin relay_list "$CARGO_ARGS" > build/relays.json
cargo run --bin relay_list "${CARGO_ARGS[@]}" > build/relays.json

cd "$SCRIPT_DIR/android"
$GRADLE_CMD --console plain "${GRADLE_TASKS[@]}"
Expand Down

0 comments on commit b6c9aba

Please sign in to comment.