Skip to content

ADFA-4186 Remove obsolete template assets from the APK#1467

Merged
hal-eisen-adfa merged 3 commits into
stagefrom
ADFA-4186-remove-obsolete-template-assets
Jul 2, 2026
Merged

ADFA-4186 Remove obsolete template assets from the APK#1467
hal-eisen-adfa merged 3 commits into
stagefrom
ADFA-4186-remove-obsolete-template-assets

Conversation

@hal-eisen-adfa

Copy link
Copy Markdown
Collaborator

Summary

The legacy code-driven template engine was replaced by the .cgt archive system (TemplateProviderImpl loads core.cgt at runtime). Its old base template resources under templates-api/src/main/assets/templates/base/ are dead weight shipped in every APK. This deletes the orphaned asset tree (20 files) and the now-unused baseAsset() helper.

No behavior change — new-project creation is driven by core.cgt, not these assets.

Per the ticket discussion (@joelmenchavez), the templates-api/src/main/assets files are removable; the layout-editor / XML-template assets are still in use and are left untouched.

Changes

  • git rm -r templates-api/src/main/assets/templates/base — 20 files; this empties the module's assets/ dir entirely.
  • Remove the unused baseAsset() function from templates-api/.../base/util/utils.kt (no callers; imports unchanged).

Evidence it's dead

  • baseAsset() had zero callers (only false positive: getDatabaseAsset(...)).
  • Only templates/base reference was inside baseAsset()'s own body.
  • No tests reference these paths.

Verification

  • ./gradlew :app:assembleV8DebugBUILD SUCCESSFUL.
  • Built APK no longer contains assets/templates/base/*, while assets/templates/xml/{drawable,layout,menu}.xml and assets/widgetclasses.json remain present.

Not touched (still live)

  • app/src/main/assets/templates/xml/* (read via ProjectWriter.XML_TEMPLATE_PATH)
  • layouteditor/src/main/assets/widgetclasses.json (read via ConvertImportedXml.kt)

Closes ADFA-4186.

The legacy code-driven template engine was replaced by the .cgt archive
system (TemplateProviderImpl loads core.cgt at runtime), leaving the old
base template resources under templates-api/src/main/assets/templates/base
as dead weight shipped in every APK. Delete the orphaned asset tree (20
files) and the now-unused baseAsset() helper. No callers remain and no
behavior changes; new-project creation is driven by core.cgt.

Verified: :app:assembleV8Debug builds; the APK no longer contains
assets/templates/base/* while the live assets/templates/xml/* and
assets/widgetclasses.json remain.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0916ff3c-3160-4cb9-b4dc-d64693ac1cf5

📥 Commits

Reviewing files that changed from the base of the PR and between 75dfe19 and 78c13d0.

📒 Files selected for processing (21)
  • templates-api/src/main/assets/templates/base/module/android/proguard-rules.pro
  • templates-api/src/main/assets/templates/base/module/android/res/drawable-v24/ic_launcher_foreground.xml
  • templates-api/src/main/assets/templates/base/module/android/res/drawable/ic_launcher_background.xml
  • templates-api/src/main/assets/templates/base/module/android/res/drawable/ic_launcher_round.webp
  • templates-api/src/main/assets/templates/base/module/android/res/mipmap-anydpi-v26/ic_launcher.xml
  • templates-api/src/main/assets/templates/base/module/android/res/mipmap-anydpi-v26/ic_launcher_round.xml
  • templates-api/src/main/assets/templates/base/module/android/res/mipmap-hdpi/ic_launcher.webp
  • templates-api/src/main/assets/templates/base/module/android/res/mipmap-hdpi/ic_launcher_round.webp
  • templates-api/src/main/assets/templates/base/module/android/res/mipmap-mdpi/ic_launcher.webp
  • templates-api/src/main/assets/templates/base/module/android/res/mipmap-mdpi/ic_launcher_round.webp
  • templates-api/src/main/assets/templates/base/module/android/res/mipmap-xhdpi/ic_launcher.webp
  • templates-api/src/main/assets/templates/base/module/android/res/mipmap-xhdpi/ic_launcher_round.webp
  • templates-api/src/main/assets/templates/base/module/android/res/mipmap-xxhdpi/ic_launcher.webp
  • templates-api/src/main/assets/templates/base/module/android/res/mipmap-xxhdpi/ic_launcher_round.webp
  • templates-api/src/main/assets/templates/base/module/android/res/mipmap-xxxhdpi/ic_launcher.webp
  • templates-api/src/main/assets/templates/base/module/android/res/mipmap-xxxhdpi/ic_launcher_round.webp
  • templates-api/src/main/assets/templates/base/module/android/res/xml/backup_rules.xml
  • templates-api/src/main/assets/templates/base/module/android/res/xml/data_extraction_rules.xml
  • templates-api/src/main/assets/templates/base/root/gitignore
  • templates-api/src/main/assets/templates/base/root/gradle.properties
  • templates-api/src/main/java/com/itsaky/androidide/templates/base/util/utils.kt
💤 Files with no reviewable changes (10)
  • templates-api/src/main/assets/templates/base/module/android/res/mipmap-anydpi-v26/ic_launcher_round.xml
  • templates-api/src/main/assets/templates/base/module/android/res/drawable/ic_launcher_background.xml
  • templates-api/src/main/assets/templates/base/module/android/res/mipmap-anydpi-v26/ic_launcher.xml
  • templates-api/src/main/assets/templates/base/module/android/proguard-rules.pro
  • templates-api/src/main/assets/templates/base/module/android/res/xml/data_extraction_rules.xml
  • templates-api/src/main/assets/templates/base/root/gitignore
  • templates-api/src/main/assets/templates/base/module/android/res/xml/backup_rules.xml
  • templates-api/src/main/assets/templates/base/module/android/res/drawable-v24/ic_launcher_foreground.xml
  • templates-api/src/main/assets/templates/base/root/gradle.properties
  • templates-api/src/main/java/com/itsaky/androidide/templates/base/util/utils.kt

📝 Walkthrough
  • Removed obsolete legacy template assets from templates-api/src/main/assets/templates/base/, including Android launcher, backup/data extraction, ProGuard, Gradle, and root ignore/property templates.

  • Deleted the unused baseAsset() helper from templates-api/src/main/java/com/itsaky/androidide/templates/base/util/utils.kt.

  • No functional behavior change is expected; new-project creation continues to use core.cgt via TemplateProviderImpl, and the active assets under app/src/main/assets/templates/xml/* plus layouteditor/src/main/assets/widgetclasses.json are unchanged.

  • Verified with a successful ./gradlew :app:assembleV8Debug build and confirmation that assets/templates/base/* is no longer packaged in the APK.

  • Risk / best-practice note: this is a broad asset removal, so any hidden references to the deleted legacy template paths would now fail at runtime; current verification suggests none remain.

Walkthrough

This PR removes legacy Android base template asset files (ProGuard rules, drawable icons, adaptive icon XMLs, backup/data extraction rules, gitignore, gradle.properties) and deletes the unused baseAsset helper function from utils.kt, with no replacement content added.

Changes

Legacy Template Asset Removal

Layer / File(s) Summary
Base module asset deletions
templates-api/src/main/assets/templates/base/module/android/proguard-rules.pro, .../res/drawable-v24/ic_launcher_foreground.xml, .../res/drawable/ic_launcher_background.xml, .../res/mipmap-anydpi-v26/ic_launcher.xml, .../ic_launcher_round.xml, .../res/xml/backup_rules.xml, .../res/xml/data_extraction_rules.xml
Removed content from ProGuard rules, drawable icon vectors, adaptive icon XMLs, and backup/data extraction rules templates, leaving these files empty.
Root template asset deletions
templates-api/src/main/assets/templates/base/root/gitignore, .../root/gradle.properties
Removed gitignore rules and Gradle/Android/Kotlin build property settings from root template files.
Unused helper removal
templates-api/src/main/java/com/itsaky/androidide/templates/base/util/utils.kt
Deleted the internal baseAsset(type, path) function that constructed template asset paths.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • appdevforall/CodeOnTheGo#1270: Removes related legacy template-builder machinery including baseAsset-related code, aligning with this PR's helper removal.

Suggested reviewers: davidschachterADFA

Poem

A hop, a nibble, an old file gone,
Templates cleared before the dawn,
No more rules for proguard's keep,
No launcher icons left to leap,
The helper's path is swept away,
Clean burrow now for a brand new day! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: removing obsolete template assets from the APK.
Description check ✅ Passed The description matches the changeset and explains why the template assets and helper were removed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ADFA-4186-remove-obsolete-template-assets

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hal-eisen-adfa hal-eisen-adfa requested a review from a team July 2, 2026 01:14
@hal-eisen-adfa hal-eisen-adfa merged commit 35ddd0e into stage Jul 2, 2026
2 checks passed
@hal-eisen-adfa hal-eisen-adfa deleted the ADFA-4186-remove-obsolete-template-assets branch July 2, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants