mikepenz / Android-Iconics

Android-Iconics - Use any icon font, or vector (.svg) as drawable in your application.
https://mikepenz.dev
Apache License 2.0
5.16k stars 619 forks source link

Document how to use "aar" artifacts with version catalogs #639

Closed nikclayton closed 1 month ago

nikclayton commented 3 months ago

About this issue

The documentation doesn't cover how to use the libraries with Gradle version catalogs. Ordinarily this would be straightforward, but it's made more complicated because Gradle version catalogs don't support the "aar" artifact type.

So if you have something like this in libs.versions.toml:

[versions]
# ...
material-iconics = "5.4.0"
material-typeface-outlined = "4.0.0.1-kotlin"
# ...

[libraries]
# ...
material-iconics = { module = "com.mikepenz:iconics-core", version.ref="material-iconics" }
material-typeface-outlined = { module = "com.mikepenz:google-material-typeface-outlined", version.ref = "material-typeface-outlined" }
# ...

You must add { artifact { type = "aar" } } after the relevant implementation, like this:

    implementation(libs.material.iconics)
    implementation(libs.material.typeface.outlined) { artifact { type = "aar" } }

Hope that's helpful.

Checklist

mikepenz commented 3 months ago

Thank you for bringing this up.

I believe strictly speaking it is better if we look into removing the dependency of the font to the typeface-api module from the pom so the @aar won't be required.

It's been a while since I last updated this project, as it is no longer as relevant in a world of compose and proper VectorDrawable support :D

mikepenz commented 1 month ago

All typeface libs will have been updated to the latest version of iconcis. so as soon as those are available the @aar wouldn't be required at this time.

Will add an example to the readme of:

implementation(libs.material.typeface.outlined) { artifact { type = "aar" } }