Don't add runtime dependencies if nothing is generated
Opened this issue · 0 comments
androidx.collection:collection
, paraphrase-runtime
, and optionally paraphrase-runtime-compose-ui
are all added as soon as the Paraphrase plugin is applied. But if the module to which it is applied has no format-able string resources, nothing is generated and the dependencies are unused. Paraphrase should only depend on these if it uses them.
Unfortunately, this is not trivial to implement. Moving addDependencies
into GenerateFormattedResources
results in compilation failure:
org.gradle.api.InvalidUserDataException: Cannot change dependencies of dependency configuration ':sample:app:api' after it has been included in dependency resolution.
I suspect moving the resource parsing into ParaphrasePlugin.apply
would be too heavy, so I'm not sure how to solve this.