-
Notifications
You must be signed in to change notification settings - Fork 0
chore(Agents): Add AGENTS.md #736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
c7ae7a8
chore(Agents): Add AGENTS.md
FabianDevel 68e491c
chore(Agents): Fix maven build
FabianDevel 62ad46f
docs: Fix AGENTS.md paths, clarify Core: prefix, remove version pin
Copilot dc9fe4a
docs: Add CreateHttpClient.kt reference in Network section
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,130 @@ | ||
| # Core - Infomaniak Android Library | ||
|
|
||
| ## Package Identity | ||
|
|
||
| Modular Android library consumed via Gradle composite builds. Provides shared authentication, networking, UI components, and | ||
| utilities across Infomaniak apps. Designed for JDK 17+, minSdk 27, compiled SDK 35. | ||
|
|
||
| ## Setup & Development | ||
|
|
||
| > **Note**: When this library is included as a Gradle composite build inside another project under the `:Core` path, all | ||
| > task paths below should be prefixed with `Core:` (e.g., `./gradlew Core:assemble`). When working in this repository | ||
| > standalone, omit the prefix. | ||
|
|
||
| ```bash | ||
| # Build all modules | ||
| ./gradlew assemble | ||
|
|
||
| # Run all tests | ||
| ./gradlew test | ||
|
|
||
| # Lint with ktlint | ||
| ./gradlew ktlintCheck | ||
|
|
||
| # Build a specific module | ||
| ./gradlew :Auth:build | ||
| ./gradlew :Network:build | ||
| ``` | ||
|
|
||
| ## Module Categories | ||
|
|
||
| ### Authentication & Security | ||
|
|
||
| - **Auth**: OAuth2 flow, account management, token storage | ||
| - Key: `Auth/src/main/kotlin/com/infomaniak/core/auth/` | ||
| - Examples: token/interceptor/authenticator classes (e.g., `TokenInterceptor.kt`, `TokenAuthenticator.kt`, `CredentialManager.kt`) | ||
| - **TwoFactorAuth**: 2FA verification UI (Front) and backend (Back) | ||
| - **AppIntegrity**: App attestation and integrity checks | ||
|
|
||
| ### Networking | ||
|
|
||
| - **Network**: Ktor HTTP client with interceptors | ||
| - Key: `Network/Ktor/src/main/` | ||
| - HTTP client factory: `Network/Ktor/src/main/kotlin/CreateHttpClient.kt` | ||
| - Models: `Network/Models/src/main/` | ||
| - **Ktor**: Low-level Ktor extensions | ||
|
|
||
| ### UI Components | ||
|
|
||
| - **Ui:Compose**: Modern Compose components | ||
| - Theme: `Ui/Compose/Theme/src/main/` | ||
| - Components: `Ui/Compose/BottomStickyButtonScaffolds/`, `Basics/` | ||
| - **Ui:View**: Legacy XML components (SharedViews, EdgeToEdge) | ||
| - **CrossAppLogin**: Cross-application authentication | ||
|
|
||
| ### Utilities & Features | ||
|
|
||
| - **Common**: Shared extensions, formatters, utilities | ||
| - Formatters: `FormatterFileSize.kt`, date formatters | ||
|
FabianDevel marked this conversation as resolved.
|
||
| - **Coil**: Image loading configuration | ||
| - **Matomo**: Analytics tracking | ||
| - **Sentry**: Error reporting | ||
| - **Notifications**: Push notification handling | ||
| - **Stores**: In-app review and update support | ||
|
|
||
| ### Legacy Support | ||
|
|
||
| - **Legacy**: Backward compatibility module | ||
| - Use: `implementation(project(":Core:Legacy"))` | ||
| - Init in Application: `InfomaniakCore.init(...)` | ||
|
|
||
| ## Patterns & Conventions | ||
|
|
||
| - **Module naming**: Descriptive, PascalCase (e.g., `AppVersionChecker`, `TwoFactorAuth`) | ||
| - **Composite build**: Consume via Maven coordinates `com.infomaniak.core:<artifact>`, where nested Gradle project paths map `:` to `.` in the artifact name (e.g., `:TwoFactorAuth:Front` → `com.infomaniak.core:TwoFactorAuth.Front`) | ||
| - **Ktlint**: Android mode enabled (version set in `build.gradle.kts`) | ||
| - **No main**: Libraries have no Application class | ||
|
|
||
| ## Key Files | ||
|
|
||
| - Build plugin: `build-logic/composite/src/main/kotlin/com/infomaniak/core/composite/CoreCompositePlugin.kt` | ||
| - Dependency catalog: `gradle/core.versions.toml` | ||
| - Shared values: `SharedValues/src/main/` | ||
|
|
||
| ## JIT Index | ||
|
|
||
| ### Find module implementations | ||
|
|
||
| ```bash | ||
| # Auth utilities | ||
| rg -n "AuthToken|AccountManager" Auth/ | ||
|
|
||
| # Network interceptors | ||
| rg -n "Interceptor|RequestBuilder" Network/ | ||
|
|
||
| # Compose components | ||
| rg -n "@Composable" Ui/Compose/ | ||
|
|
||
| # Common extensions | ||
| rg -n "fun|suspend" Common/src/main/kotlin/com/infomaniak/core/common/ | ||
| ``` | ||
|
FabianDevel marked this conversation as resolved.
|
||
|
|
||
| ### Test file locations | ||
|
|
||
| ```bash | ||
| # Unit tests per module | ||
| rg -n "@Test" */src/test/ | ||
|
|
||
| # Example: Auth tests | ||
| find Auth/src/test -name "*.kt" | ||
|
|
||
| # Example: Common utils tests | ||
| find Common/src/test -name "*.kt" | ||
| ``` | ||
|
|
||
| ## Common Gotchas | ||
|
|
||
| - **Composite build**: Changes in Core are immediately available in consuming projects | ||
| - **Dependency mapping**: Modules use Maven coordinates but resolve locally | ||
| - **Legacy init**: Must call `InfomaniakCore.init()` in consuming app's Application class | ||
| - **Ktor client**: Use the canonical `createHttpClient(...)` factory under `Network/Ktor/src/main/kotlin/CreateHttpClient.kt` for consistent setup | ||
|
|
||
| ## Pre-PR Checks | ||
|
|
||
| ```bash | ||
| # Standalone (in this repository) | ||
| ./gradlew test && ./gradlew ktlintCheck | ||
|
|
||
| # As composite build (prefix with Core: when consumed from another project) | ||
| ./gradlew Core:test && ./gradlew Core:ktlintCheck | ||
| ``` | ||
|
FabianDevel marked this conversation as resolved.
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.