Skip to content

chore: add Cloud Agent development environment setup - #160

Draft
msomu wants to merge 1 commit into
mainfrom
cursor/setup-dev-environment-2888
Draft

msomu wants to merge 1 commit into
mainfrom
cursor/setup-dev-environment-2888

Conversation

@msomu

@msomu msomu commented Sep 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

Sets up the Cloud Agent development environment for this Android/Kotlin project so ./gradlew build, test, and detekt work out of the box.

The base VM ships JDK 21 and Gradle (via the wrapper) but has no Android SDK, which the build requires. This PR adds:

  • .cursor/environment.json — declares the environment and runs the install script (repo-committed, so it is the highest-precedence environment source).
  • .cursor/install.sh — an idempotent bootstrap that:
    1. installs the Android command-line tools into /opt/android-sdk (only if missing),
    2. accepts SDK licenses and ensures platform-tools, platforms;android-37.0 (matches compileSdk = 37), and build-tools;37.0.0,
    3. writes local.properties with sdk.dir (git-ignored, machine-specific),
    4. warms the Gradle dependency cache.

No application code is changed. JDK 21 is used as-is (AGP 9.3.1 + Gradle 9.7 support it), matching the base image.

Validation

Check Result
./gradlew assembleDebug BUILD SUCCESSFUL — app-debug.apk (~20 MB)
./gradlew build (compile + lint + release) BUILD SUCCESSFUL — debug + release APKs
./gradlew test BUILD SUCCESSFUL — unit tests pass
./gradlew detekt BUILD SUCCESSFUL — no violations
./gradlew build test detekt (full pre-commit gate) BUILD SUCCESSFUL — 111 tasks
Install idempotence PASS (re-run ~7s)
Clean install (SDK absent) + build PASS (~13s provision, then BUILD SUCCESSFUL)
Prebuilt env build + fresh Cloud Agent PASS — fresh agent booted the build and ran assembleDebug test detekt → BUILD SUCCESSFUL
App data layer vs live API Fetched 200 todos + a todo detail from jsonplaceholder.typicode.com through the app's real Retrofit/OkHttp/serialization + RepositoryImpl

Note on running the GUI app

The Android app's UI requires an emulator. The x86_64 emulator needs hardware acceleration, but this VM's nested KVM raises a host-kernel kvm_spurious_fault on vCPU creation (the guest never executes), and TCG software emulation is refused for x86_64 images. This is a host virtualization limitation, not fixable from inside the VM. To demonstrate the app actually runs, its core network/data flow was exercised against the live API on the JVM (see validation table).

Open in Web Open in Cursor 

Adds .cursor/environment.json and an idempotent install script that provisions the Android SDK (cmdline-tools, platform android-37.0, build-tools 37.0.0), writes local.properties, and warms Gradle dependencies so ./gradlew build/test/detekt work out of the box.

Co-authored-by: Somasundaram M <hi@msomu.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants