#!/usr/bin/env bash
# gradle_assemble_debug — Build APK debug de un modulo Android via gradlew assembleDebug.
set -euo pipefail

source "$(dirname "${BASH_SOURCE[0]}")/gradle_run.sh"

gradle_assemble_debug() {
    local project_dir="$1"
    local module="${2:-app}"

    gradle_run "$project_dir" ":$module:assembleDebug"

    local apk
    apk=$(find "$project_dir/$module/build/outputs/apk/debug" -name "*.apk" | head -1)

    echo "APK: $apk"
}

gradle_assemble_debug "$@"
