Instruction file imported from GuavaPay/myguava-business-payment-sdk-android (
.cursor/rules/toml-files.mdc). Copyright stays with the author.
globs: *.toml
TOML Files (.toml) Rules
File Structure
TOML files in project are primarily for dependency and version management, structured in three main blocks:
Block Organization
[versions]- Version declarations[libraries]- Library dependency definitions[plugins]- Plugin declarations
Naming Conventions
- Use semantic naming with hyphens (
-) as separators - Group related dependencies by functional area
- Example:
android-application,androidx-core-ktx,compose-ui
Naming Impact on Usage
Naming directly affects Gradle accessor syntax:
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
Results in: alias(libs.plugins.android.application)
Version References
- All related dependencies should reference version declarations
- Use
version.ref = "version-key"for consistency - Group versions logically (e.g., all Compose versions together)
Best Practices
- Group related versions and libraries together
- Use consistent naming patterns within functional groups
- Reference versions from
[versions]block rather than hardcoding - Keep version declarations at the top for easy maintenance
- Use descriptive but concise naming that reflects the library's purpose