|
1 | 1 | # Guidelines for AI Agents |
2 | 2 |
|
| 3 | +## Overview |
| 4 | + |
| 5 | +This project is a compose multiplatform library to provide advanced grid layout features. |
| 6 | +See `README.md` file and `docs/` directory for more details. |
| 7 | + |
3 | 8 | ## Core Rules |
4 | 9 |
|
5 | 10 | - Update documentation when the feature is added, removed or changed. |
6 | 11 | - Verify changes by running tests after making changes. |
7 | | -- Run `./gradlew apiDump` when the public API is changed. |
| 12 | +- Run `./gradlew :grid:apiDump` when the public API is changed. |
8 | 13 | - Annotate new public APIs with `@ExperimentalGridApi`. |
9 | 14 |
|
10 | 15 | ## Project Structure |
11 | 16 |
|
12 | 17 | - `grid/`: The main library module. |
| 18 | + - `api/`: Public API binary compatibility declaration files. Used by the binary compatibility validator to detect breaking API changes. |
13 | 19 | - `src/commonMain/`: Main source code for the library. |
14 | 20 | - `src/androidMain/`: Android specific source code. |
15 | 21 | - `src/test/`: Unit tests and snapshot tests. |
|
20 | 26 | - `ios/`: Xcode project for iOS sample application. |
21 | 27 | - `docs/`: Documentation. |
22 | 28 |
|
23 | | -## Commands |
| 29 | +## Common Commands |
| 30 | + |
| 31 | +- `./gradlew :grid:build`: Build project. |
| 32 | +- `./gradlew :grid:test`: Run all test cases. |
| 33 | +- `./gradlew :grid:testDebugUnitTest --tests "TestClassName"`: Run specific tests. |
| 34 | +- `./gradlew :grid:verifyPaparazziDebug`: Run only snapshot tests. |
| 35 | +- `./gradlew :grid:recordPaparazziDebug`: Update and create new snapshots. |
| 36 | +- `./gradlew :grid:apiDump`: Update public API binary compatibility. The result is generated in `grid/api/` directory. |
| 37 | + |
| 38 | +## Key Files |
| 39 | + |
| 40 | +**Library Development** |
| 41 | + |
| 42 | +- `grid/src/commonMain/kotlin/com/cheonjaeung/compose/grid/Grid.kt`: Public layout composables. |
| 43 | +- `grid/src/commonMain/kotlin/com/cheonjaeung/compose/grid/SequentialGridMeasurePolicy.kt`: Core measurement and placing logic of sequential grid (`HorizontalGrid` and `VerticalGrid`). |
| 44 | +- `grid/src/commonMain/kotlin/com/cheonjaeung/compose/grid/GridScopeModifiers.kt`: Custom modifiers of sequential grid (`HorizontalGrid` and `VerticalGrid`). |
| 45 | +- `grid/src/commonMain/kotlin/com/cheonjaeung/compose/grid/BoxGridMeasurePolicy.kt`: Core measurement and placing logic of `BoxGrid`. |
| 46 | +- `grid/src/commonMain/kotlin/com/cheonjaeung/compose/grid/BoxGridScopeModifiers.kt`: Custom modifiers of `BoxGrid`. |
| 47 | +- `grid/src/commonMain/kotlin/com/cheonjaeung/compose/grid/ExtendedGridCells.kt`: Declarations of extended grid cell managements. |
| 48 | +- `grid/src/commonMain/kotlin/com/cheonjaeung/compose/grid/ExperimentalGridApi.kt`: Marker annotation for new experimental APIs. |
| 49 | + |
| 50 | +**Testing** |
| 51 | + |
| 52 | +- `grid/src/test/snapshots/images/`: Recorded snapshots generated by `./gradlew :grid:recordPaparazziDebug`. |
| 53 | +- `grid/build/paparazzi/failures/`: Failed snapshot test result output directory. |
| 54 | + |
| 55 | +**Build Configurations** |
24 | 56 |
|
25 | | -- `./gradlew build`: Build project. |
26 | | -- `./gradlew test`: Run all test cases. |
27 | | -- `./gradlew testDebugUnitTest --tests "TestClassName"`: Run specific tests. |
28 | | -- `./gradlew verifyPaparazziDebug`: Run only snapshot tests. |
29 | | -- `./gradlew recordPaparazziDebug`: Update and create new snapshots. |
30 | | -- `./gradlew apiDump`: Update public API binary compatibility. |
| 57 | +- `build.gradle.kts`: The project root build script, contains shared build logics. |
| 58 | +- `grid/build.gradle.kts`: Library specific build script, contains dependencies and build logics. |
| 59 | +- `gradle/libs.versions.toml`: Core file for dependency management. |
0 commit comments