Commit c87d136
Fix FileLogger dependency injection and remove Hilt from commons
This fixes the ClassCastException when running WooCommerce tests after
moving WooLog to the commons module.
Changes:
1. Remove Hilt/KSP plugins from commons module - commons doesn't need
to process Hilt annotations itself. The WooCommerce and Wear modules
that depend on commons will process any Hilt annotations found in
commons (like @Inject on WooFileLogger).
2. Replace EntryPoints.get() pattern with direct injection - Changed
WooLog.init() to accept WooFileLogger directly instead of using
Context and EntryPoints.get(). This is cleaner and removes the code
smell of using EntryPoints for something that can be injected.
3. Update WooCommerce's AppConfigModule to inject WooFileLogger into
provideWooLog() and pass it to WooLog.init().
This approach avoids forcing the Wear module to provide dependencies
(AppCoroutineScope, CoroutineDispatchers) that it doesn't actually use,
since Wear doesn't use WooLog at all.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 0fd2bc2 commit c87d136
File tree
2 files changed
+5
-15
lines changed- WooCommerce/src/main/kotlin/com/woocommerce/android/di
- libs/commons/src/main/java/com/woocommerce/android/util
2 files changed
+5
-15
lines changedLines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | | - | |
57 | | - | |
| 57 | + | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
Lines changed: 2 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | 6 | | |
12 | 7 | | |
13 | 8 | | |
| |||
64 | 59 | | |
65 | 60 | | |
66 | 61 | | |
67 | | - | |
| 62 | + | |
68 | 63 | | |
69 | 64 | | |
70 | 65 | | |
71 | 66 | | |
72 | 67 | | |
73 | | - | |
| 68 | + | |
74 | 69 | | |
75 | 70 | | |
76 | 71 | | |
| |||
212 | 207 | | |
213 | 208 | | |
214 | 209 | | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
0 commit comments