ADFA-1639 Rename .androidide/ to .cg/ in multiple locations#1161
ADFA-1639 Rename .androidide/ to .cg/ in multiple locations#1161hal-eisen-adfa merged 6 commits intostagefrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 Walkthrough
WalkthroughThe PR renames the app's internal IDE data directory from Changes
Sequence DiagramsequenceDiagram
participant App as Application
participant Env as Environment
participant Legacy as LegacyIdeDataDirMigration
participant FS as FileSystem
App->>Env: init(context)
Env->>Env: build candidate path (HOME/.cg)
Env->>Env: build legacy path (HOME/.androidide)
Env->>Legacy: migrateLegacyIdeDataDirIfNeeded(legacy, current)
Legacy->>FS: check existence (current, legacy)
alt current exists
Legacy-->>Env: return current
else legacy exists and current missing
Legacy->>FS: rename legacy -> current
alt rename success
Legacy-->>Env: return current
else rename failed
Legacy-->>Env: return legacy
end
else neither exists
Legacy-->>Env: return current
end
Env->>FS: mkdirIfNotExists(resolved current)
Env-->>App: set ANDROIDIDE_HOME to resolved directory
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@common/src/main/java/com/itsaky/androidide/utils/Environment.java`:
- Around line 130-133: The build fails because the Kotlin function
LegacyIdeDataDirKt.migrateLegacyIdeDataDirIfNeeded(File, File) is referenced but
missing; add a Kotlin file in the same package that declares a top-level
function migrateLegacyIdeDataDirIfNeeded(legacy: File, current: File) (matching
the Java call LegacyIdeDataDirKt.migrateLegacyIdeDataDirIfNeeded) and implement
the migration behavior (or a safe no-op/stub that logs and returns) so the
symbol resolves; ensure the Kotlin file's package matches the Java callers and
the function signature and visibility are public so the Java code in
Environment.java can call it.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c76300d0-95e4-4e48-929d-517e53bc63a5
📒 Files selected for processing (20)
.gitignorecommon/src/main/java/com/itsaky/androidide/utils/Environment.javacomposite-builds/build-deps-common/constants/src/main/java/org/adfa/constants/constants.ktgradle-plugin/src/test/java/com/itsaky/androidide/gradle/utils.ktlayouteditor/.gitignoreresources/src/main/res/values-ar-rSA/strings.xmlresources/src/main/res/values-bn-rIN/strings.xmlresources/src/main/res/values-de-rDE/strings.xmlresources/src/main/res/values-es-rES/strings.xmlresources/src/main/res/values-fr-rFR/strings.xmlresources/src/main/res/values-hi-rIN/strings.xmlresources/src/main/res/values-in-rID/strings.xmlresources/src/main/res/values-pt-rBR/strings.xmlresources/src/main/res/values-ro-rRO/strings.xmlresources/src/main/res/values-ru-rRU/strings.xmlresources/src/main/res/values-tr-rTR/strings.xmlresources/src/main/res/values-zh-rCN/strings.xmlresources/src/main/res/values/strings.xmlshared/src/main/java/com/itsaky/androidide/utils/SharedEnvironment.ktsubprojects/tooling-api-model/build.gradle.kts
common/src/main/java/com/itsaky/androidide/utils/Environment.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@common/src/main/java/com/itsaky/androidide/utils/LegacyIdeDataDirMigration.java`:
- Around line 48-50: Change the migration method in LegacyIdeDataDirMigration so
it returns the actual directory to use (File) instead of void: detect if
legacy.exists() and attempt legacy.renameTo(current); if renameTo succeeds
return current, otherwise return legacy (and log the failure). Update callers
getProjectCacheDir() and init() to accept/use the returned File from that
migration method rather than unconditionally using the hardcoded current path so
they will fall back to legacy when migration fails (adjust calls to
mkdirIfNotExists to operate on the returned File).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 17912b39-2502-477d-b63f-167704f8d2ff
📒 Files selected for processing (2)
common/src/main/java/com/itsaky/androidide/utils/Environment.javacommon/src/main/java/com/itsaky/androidide/utils/LegacyIdeDataDirMigration.java
✅ Files skipped from review due to trivial changes (1)
- common/src/main/java/com/itsaky/androidide/utils/Environment.java
Runtime and shared constants
SharedEnvironment.kt: PROJECT_CACHE_DIR_NAME = ".cg", LEGACY_PROJECT_CACHE_DIR_NAME = ".androidide". All derived paths (e.g. PROJECT_SYNC_CACHE_DIR) now use .cg.
LegacyIdeDataDir.kt: migrateLegacyIdeDataDirIfNeeded(legacy, current) — renames legacy → current when only legacy exists; if both exist, logs a warning and keeps the new dir.
Environment.java: Runs migration on files/home/ before creating ANDROIDIDE_HOME, uses SharedEnvironment.PROJECT_CACHE_DIR_NAME (no hardcoded .androidide). getProjectCacheDir runs the same migration per project.
Build constants
constants.kt: IDE_DATA_DIR_NAME = ".cg" and ANDROIDIDE_HOME built from it so plugin paths stay aligned with the app.
Host tooling / ignores
subprojects/tooling-api-model/build.gradle.kts: copy target tests/test-home/.cg/init.
gradle-plugin/.../utils.kt: init script path uses SharedEnvironment.PROJECT_CACHE_DIR_NAME.
.gitignore: tests/**/.cg/init/model.jar.
layouteditor/.gitignore: .cg/.
Strings
All values / values-* strings.xml: /home/.androidide → /home/.cg, $HOME/.androidide → $HOME/.cg.
Hindi: fixed package typo com.itsaky.android → com.itsaky.androidide.
Arabic: fixed font path prefix to /data/data/com.itsaky.androidide/....