|
| 1 | +# Repository Guidelines |
| 2 | + |
| 3 | +## Project Structure & Module Organization |
| 4 | +- Multi-module Gradle build. Core modules live at the repo root: `objectbox-java-api`, `objectbox-java`, `objectbox-kotlin`, `objectbox-rxjava`, `objectbox-rxjava3`. |
| 5 | +- Test modules live under `tests/`, notably `tests/objectbox-java-test` and `tests/test-proguard`. |
| 6 | +- Source follows standard Gradle layout per module (e.g., `src/main/java`, `src/main/kotlin`, `src/test/java`). |
| 7 | +- CI and helper scripts live in `ci/` and `scripts/`; build outputs go to `build/`. |
| 8 | + |
| 9 | +## Build, Test, and Development Commands |
| 10 | +- `./gradlew clean build` — full build across modules. |
| 11 | +- `./gradlew :objectbox-java:build` — build a single module. |
| 12 | +- `./gradlew :tests:objectbox-java-test:test` — run the main test suite. |
| 13 | +- `./gradlew -version` — verify Gradle/JDK setup. |
| 14 | +- `./scripts/test-with-asan.sh --stacktrace clean build` — CI-style run with ASAN (requires native deps; see `Jenkinsfile`). |
| 15 | + |
| 16 | +## Coding Style & Naming Conventions |
| 17 | +- No repo-wide formatter config is present; follow existing Java/Kotlin style in the touched files and keep changes minimal. |
| 18 | +- Use 4-space indentation and standard Java/Kotlin naming conventions; prefer package naming under `io.objectbox`. |
| 19 | +- New tests in `tests/objectbox-java-test` should name methods as `{attribute}_{queryCondition}_{expectation}` (see `tests/README.md`). |
| 20 | + |
| 21 | +## Testing Guidelines |
| 22 | +- Tests are JUnit-based (see `tests/objectbox-java-test/build.gradle.kts`). |
| 23 | +- Place new tests under `tests/objectbox-java-test/src/test/java` (or Kotlin equivalents). |
| 24 | +- Legacy tests may still use the `test*` prefix; new tests should follow the naming convention above. |
| 25 | + |
| 26 | +## Key Classes & Hotspots |
| 27 | +- Core API: `io.objectbox.BoxStore`, `io.objectbox.Box`, and `io.objectbox.Transaction` (see `tests/objectbox-java-test/src/test/java/io/objectbox/BoxStoreTest.java` and `tests/objectbox-java-test/src/test/java/io/objectbox/BoxTest.java`). |
| 28 | +- Queries: `io.objectbox.query.Query`, `QueryBuilder`, and `QueryCondition` (see `tests/objectbox-java-test/src/test/java/io/objectbox/query/QueryTest.java` and `tests/objectbox-java-test/src/test/java/io/objectbox/query/QueryTest2.java`). |
| 29 | +- Relations: `io.objectbox.relation.ToOne` and `ToMany` (see `tests/objectbox-java-test/src/test/java/io/objectbox/relation/RelationTest.java`). |
| 30 | +- Sync: `io.objectbox.sync.SyncClient`, `SyncServer`, and `SyncCredentials` (see `tests/objectbox-java-test/src/test/java/io/objectbox/sync/SyncTest.java`). |
| 31 | + |
| 32 | +## Commit & Pull Request Guidelines |
| 33 | +- Recent history uses a short area prefix, e.g., `QueryTest: use new API...` or `TargetIdProperty: improve...`. Follow this pattern for new commits. |
| 34 | +- PRs should include a concise summary, rationale, and the exact test commands run. |
| 35 | +- If changes affect native or CI behavior, call that out explicitly (CI runs JDK 8 and 16 and uses ASAN). |
0 commit comments