gradle_build
Build an Android project with Gradle (default assembleDebug) and get a compact status, error summary, log path, and fresh APK list. Run long builds in the background and poll with build_status.
Instructions
Build the app with Gradle (default task assembleDebug) in project_dir. project_dir must contain the Gradle wrapper (gradlew). Runs on the host, not a device. Returns a compact summary (status, duration, error count, first errors) and the path of the full log, with credential-shaped values redacted. It also lists the APKs under build/outputs, newest first; that can include APKs left by earlier builds. For builds that take minutes pass background=true: it returns a job id and log path at once, and build_status reports the result.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Extra arguments passed to Gradle (e.g. --stacktrace, -Pflavor=free). | |
| task | No | Gradle task to run. Defaults to assembleDebug. | |
| background | No | Start the build detached and return at once with a job id and log path; poll with build_status. Use for builds that take minutes. | |
| project_dir | No | Path to the Android project root containing the Gradle wrapper (gradlew). Optional if session_set_defaults has pinned a project_dir for this session. |