mikepenz / AboutLibraries

AboutLibraries automatically collects all dependencies and licenses of any gradle project (Kotlin MultiPlatform), and provides easy to integrate UI components for Android and Compose-jb environments
http://mikepenz.github.io/AboutLibraries/
Apache License 2.0
3.66k stars 423 forks source link

Suggest using official recommended methods to add custom resources to ensure better compatibility #866

Closed Arowa-Z closed 1 year ago

Arowa-Z commented 1 year ago

please refer to: https://github.com/android/gradle-recipes/blob/agp-8.0/Kotlin/addCustomResValueFromTask/app/build.gradle.kts

mikepenz commented 1 year ago

Thank you for the link, can you please highlight which part of the plugin should use this approach to provide custom resources?

The plugin generates a full json file which are bundled with the app, instead of individual values.

Arowa-Z commented 1 year ago

Thank you for the link, can you please highlight which part of the plugin should use this approach to provide custom resources?

The plugin generates a full file which are bundled with the app, instead of individual values.json

You can consider storing the content of aboutlibraries.json in a string resource, or using asset, please refer to: https://github.com/android/gradle-recipes/blob/agp-8.0/Kotlin/addCustomAsset/app/build.gradle.kts

mikepenz commented 1 year ago

As far as I can tell the plugin already uses an API meant for registering resources registerGeneratedResFolders https://github.com/mikepenz/AboutLibraries/blob/develop/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/AboutLibrariesPluginAndroidExtension.kt#LL50C21-L50C48

If there are better / more efficient approaches, more than happy to review a PR on this matter.

Thank you for providing the links