Gradle version catalog

Gradle version catalog is a list of dependencies, represented as dependency coordinates, that a user can pick from when declaring dependencies. The PoqSDK publishes its Gradle version catalog, its libraries definitions and their versions, for the clients to consume as an artifact matching the PoqSDK version.

The version catalog benefits your project when you have to define the same library as the PoqSDK, such as an annotation processor dependency, to always match the version used on the PoqSDK. Also, since the Poq version catalog is released matching the PoqSDK version, every time you update the PoqSDK version you will be also updating your project libraries, so you do not have to worry about manually updating each of them.

How to use the Poq Gradle version catalog

To import the Poq Gradle version catalog you need to add to your settings.gradle:

dependencyResolutionManagement {
repositories {
maven {
url "https://android-artifacts.poq.io/repository/maven-all/"
credentials {
username NEXUS_USERNAME
password NEXUS_PASSWORD
}
}
}
versionCatalogs {
create("libs") {
from("com.poqstudio:versioncatalog:$poqPlatformVersion")
}
}
}

To use the version catalog you can:

  • Get a library version: libs.versions.{versionName}.get() i.e.: libs.versions.kotlin.get()
  • Get a library: libs.{libraryName} i.e.: kapt libs.moshi.codegen
  • Get a library bundle: libs.bundles.{bundleName} i.e.: implementation libs.bundles.androidx.room

The Poq Gradle version catalog is defined on poq.versions.toml.