chore(agents): document local.properties resolution for worktrees

This commit is contained in:
Achmad Setyabudi Susilo
2026-06-28 17:53:17 +07:00
parent 36deb46a28
commit 567f6a7cee
+19
View File
@@ -53,9 +53,28 @@ When the user provides an issue number to work on, the agent works in a dedicate
```
4. `cd` into the worktree and continue all subsequent work there. Run `./gradlew`, tests, and the IDE from inside the worktree — never edit files in the main checkout.
5. **Resolve `local.properties` before any Gradle command.** It's gitignored, so a fresh worktree has no `sdk.dir` and `./gradlew` will fail to locate the Android SDK. Create `local.properties` at the worktree root with one line:
```properties
sdk.dir=/absolute/path/to/Android/sdk
```
See [Finding the Android SDK path](#finding-the-android-sdk-path) below. If `local.properties` already exists in the worktree, leave it alone. Do not commit this file.
If the worktree for that issue already exists (resuming work, or another agent on the same issue), `cd` into it and `git pull` — do not create a duplicate.
**Finding the Android SDK path**
If you accepted Android Studio's default install location, the SDK lives at one of these:
- **macOS:** `/Users/<you>/Library/Android/sdk`
- **Linux:** `/home/<you>/Android/Sdk`
- **Windows:** `C:\Users\<you>\AppData\Local\Android\Sdk`
To confirm the exact path on any machine, open Android Studio → Settings → Languages & Frameworks → Android SDK — the "Android SDK Location" field shows the absolute path. Alternatively, if `ANDROID_HOME` or `ANDROID_SDK_ROOT` is set in your shell environment, Gradle picks that up automatically and `local.properties` is not required.
Notes on the file format:
- Use forward slashes and no quoting (even on Windows if you're on a Unix shell, or on macOS/Linux which is the project's platform).
- The path is per-machine, not per-project. Every worktree needs its own `local.properties` pointing at the local SDK.
**Conventions:**
- Worktree path: `../ledgerr-<branch-with-slashes-as-dashes>` (sibling of the main checkout, not nested inside it)