|
| 1 | +# AGENTS.md |
| 2 | + |
| 3 | +## Cursor Cloud specific instructions |
| 4 | + |
| 5 | +### Project overview |
| 6 | +This is the **OneSignal Android SDK** — a multi-module Gradle project (Kotlin/Java) that provides push notifications, in-app messaging, SMS, and email integration for Android apps. There are no backend services or databases; this is a pure client-side library tested entirely via JVM unit tests (Robolectric). |
| 7 | + |
| 8 | +### Prerequisites |
| 9 | +- **JDK 17+** (JDK 21 works fine; Gradle 8.10.2 requires JDK 17+) |
| 10 | +- **Android SDK** with platform 34 and build-tools installed |
| 11 | +- Environment variables: `JAVA_HOME`, `ANDROID_HOME`/`ANDROID_SDK_ROOT`, and `$ANDROID_HOME/cmdline-tools/latest/bin` on `PATH` |
| 12 | + |
| 13 | +### Key paths |
| 14 | +- SDK modules: `OneSignalSDK/onesignal/{core,notifications,in-app-messages,location,otel,testhelpers}/` |
| 15 | +- Demo app: `examples/demo/app/` |
| 16 | +- Gradle wrapper: `OneSignalSDK/gradlew` (run all commands from `OneSignalSDK/`) |
| 17 | + |
| 18 | +### Build, lint, and test commands |
| 19 | +All commands run from `OneSignalSDK/`: |
| 20 | +- **Build all modules + demo app:** `./gradlew assembleRelease` |
| 21 | +- **Build demo app debug (GMS):** `./gradlew :app:assembleGmsDebug` |
| 22 | +- **Lint (formatting):** `./gradlew spotlessCheck` |
| 23 | +- **Lint (static analysis):** `./gradlew detekt` |
| 24 | +- **Unit tests:** `./gradlew testDebugUnitTest` |
| 25 | +- **Apply formatting fixes:** `./gradlew spotlessApply` |
| 26 | + |
| 27 | +### Gotchas |
| 28 | +- The `settings.gradle` includes the demo app as `:app` and performs dependency substitution so local SDK source is used. The `SDK_VERSION` property must be set (it is in `gradle.properties`). |
| 29 | +- First Gradle run auto-downloads additional build-tools (e.g., build-tools 35) and Android SDK components as needed. |
| 30 | +- There are a small number of **pre-existing test failures** (4 out of ~982) in `SDKInitTests` and `RecoverFromDroppedLoginBugTests` on `main`. These are not environment issues. |
| 31 | +- Tests use Robolectric and run on the JVM — no emulator or physical device is needed. |
| 32 | +- The `--no-daemon` flag is recommended for CI-like runs; for interactive development `--daemon` (the default) is faster. |
| 33 | +- Detekt reports some pre-existing findings (warnings), but the task succeeds (does not fail the build). |
0 commit comments