Skip to content

Commit 2d87c0d

Browse files
committed
Update CHANGELOG and plugin documentation to reflect improvements in the restore process: clarify backup handling, ensure correct file path resolution, and enhance task ordering for resource management.
1 parent 756605c commit 2d87c0d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
- **Docs**: [Refactor plan checklist](docs/refactor-plan-checklist.md) — seguimiento hecho/pendiente del roadmap del plugin.
88

9+
### Fixed
10+
11+
- **Restore**: Backups under `temp/<module>/src/...` now copy back to `<module>/src/...` (no duplicated module segment). Restore uses binary `copyTo` for assets; restore-resource task no longer clears temp before restore-assets; `stringcareBeforeMergeAssets` runs after `stringcareBeforeMergeResources`. Restore tasks stay non–UP-TO-DATE so Gradle cannot skip them while sources remain obfuscated.
12+
913
### Changed
1014

1115
- **Architecture**: Domain models under `domain.models` (with `models` typealiases for compatibility); `infrastructure` packages for parsers, Gradle wiring, crypto, filesystem; thin `ObfuscateStringsUseCase` + `ResourceRepository`.

docs/plugin-tasks.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,10 @@ The plugin also registers **per-variant** tasks that hook into the Android build
2424
- **`stringcareAfterMergeAssets<Variant>`** — Runs after asset merge; restores the original assets.
2525

2626
`<Variant>` is the variant name with the first letter capitalized (e.g. `Debug`, `Release`, or `ProdDebug` if you use product flavors). The plugin connects these so that the merge tasks see the obfuscated resources/assets, and the originals are restored afterward so the source tree stays unchanged. Dependencies are set so that the “before” task runs before the corresponding merge task, and the “after” task runs after it.
27+
28+
### Ordering and temp backups
29+
30+
- **`stringcareBeforeMergeResources<Variant>`** is ordered to run **before** **`stringcareBeforeMergeAssets<Variant>`** (`mustRunAfter`), so string obfuscation and backups are written first; both phases share the same temp root under `StringCareBuildService`.
31+
- **`stringcareAfterMergeResources<Variant>`** restores from backup using paths relative to the module directory (the Gradle project folder): backups live at `temp/<module>/src/...` and are copied back to `<module>/src/...`, not `<module>/<module>/src/...`.
32+
- **`stringcareAfterMergeResources<Variant>`** does **not** delete the temp tree; **`stringcareAfterMergeAssets<Variant>`** runs last and restores assets (re-copy from the same backups is harmless), then clears the temp directory so backups are not left behind.
33+
- Restore tasks use **`outputs.upToDateWhen { false }`** so Gradle does not skip them while sources are still obfuscated from a previous run.

0 commit comments

Comments
 (0)