Skip to content

Commit

Permalink
Cleaned up some code
Browse files Browse the repository at this point in the history
  • Loading branch information
Pururun committed Dec 16, 2024
1 parent 0ae8648 commit bb34520
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/android-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ jobs:
env:
RUSTFLAGS: --deny warnings
run: |
mkdir -p android/app/build/extraAssets/
mkdir -p android/app/build/extraAssets
cargo run --bin relay_list > android/app/build/extraAssets/relays.json
- name: Upload
Expand Down Expand Up @@ -284,7 +284,7 @@ jobs:
- name: Checkout wireguard-go-rs recursively
run: |
git config --global --add safe.directory '*'
git submodule update --init --recursive --depth=1 wireguard-go-rs
git submodule update --init --recursive --depth=1 wireguard-go-rs
- uses: actions/download-artifact@v4
with:
Expand Down
3 changes: 3 additions & 0 deletions android/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ ENV AR_x86_64_linux_android=${NDK_TOOLCHAIN_DIR}/llvm-ar \
CC_x86_64_linux_android=${NDK_TOOLCHAIN_DIR}/x86_64-linux-android${MIN_SDK_VERSION}-clang \
CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER=${NDK_TOOLCHAIN_DIR}/x86_64-linux-android${MIN_SDK_VERSION}-clang

# Set up python3 path for rust gradle plugin
ENV RUST_ANDROID_GRADLE_PYTHON_COMMAND=/usr/bin/python3

# === Install/set up the image ===

RUN apt-get update -y && apt-get install -y \
Expand Down
2 changes: 1 addition & 1 deletion building/android-container-image.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mullvadvpn-app-build:latest
ghcr.io/mullvad/mullvadvpn-app-build-android:7b6bc0f44
13 changes: 7 additions & 6 deletions building/container-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ CARGO_TARGET_VOLUME_NAME=${CARGO_TARGET_VOLUME_NAME:-"cargo-target"}
CARGO_REGISTRY_VOLUME_NAME=${CARGO_REGISTRY_VOLUME_NAME:-"cargo-registry"}
GRADLE_CACHE_VOLUME_NAME=${GRADLE_CACHE_VOLUME_NAME:-"gradle-cache"}
ANDROID_CREDENTIALS_DIR=${ANDROID_CREDENTIALS_DIR:-""}
CONTAINER_RUNNER=${CONTAINER_RUNNER:-"docker"}
CONTAINER_RUNNER=${CONTAINER_RUNNER:-"podman"}
# Temporarily do not use mold for linking by default due to it causing build errors.
# There's a separate issue (DES-1177) to address this problem.
# Build servers also opt out of this and instead use GNU ld.
Expand All @@ -34,10 +34,10 @@ case ${1-:""} in
;;
android)
container_image_name=$(cat "$SCRIPT_DIR/android-container-image.txt")
optional_gradle_cache_volume=(-v "$GRADLE_CACHE_VOLUME_NAME:/root/.gradle")
optional_gradle_cache_volume=(-v "$GRADLE_CACHE_VOLUME_NAME:/root/.gradle:Z")

if [ -n "$ANDROID_CREDENTIALS_DIR" ]; then
optional_android_credentials_volume=(-v "$ANDROID_CREDENTIALS_DIR:$REPO_MOUNT_TARGET/android/credentials")
optional_android_credentials_volume=(-v "$ANDROID_CREDENTIALS_DIR:$REPO_MOUNT_TARGET/android/credentials:Z")
fi

shift 1
Expand All @@ -54,8 +54,9 @@ fi

set -x
exec "$CONTAINER_RUNNER" run --rm -it \
-v "$REPO_DIR:$REPO_MOUNT_TARGET" \
-v "$CARGO_TARGET_VOLUME_NAME:/cargo-target" \
-v "$CARGO_REGISTRY_VOLUME_NAME:/root/.cargo/registry" \
-v "$REPO_DIR:$REPO_MOUNT_TARGET:Z" \
-v "$CARGO_TARGET_VOLUME_NAME:/cargo-target:Z" \
-v "$CARGO_REGISTRY_VOLUME_NAME:/root/.cargo/registry:Z" \
"${optional_gradle_cache_volume[@]}" \
"${optional_android_credentials_volume[@]}" \
"$container_image_name" bash -c "$optional_mold $*"

0 comments on commit bb34520

Please sign in to comment.