Shared catalog of red_mad_robot based on Gradle Shared Catalogs (Gradle version 7.2).
⚠️ Version catalogs is experimental feature. You should activate it by addingenableFeaturePreview("VERSION_CATALOGS")
to thesetting.gradle.kts
. Read more in the documentation.
The catalog provides some Jetpack libraries. You can find them in the androidx catalog.
The catalog provides the red_mad_robot libraries. You can find them in the redmadrobot catalog.
The catalog provides a main red_mad_robot stack. You can find them in the stack catalog.
You can read more about install shared catalogs in the gradle documentation.
You need to create version catalogs in settings.gradle.kts
from remote repository:
dependencyResolutionManagement {
repositories {
mavenCentral()
}
versionCatalogs {
create("rmr") {
from("com.redmadrobot.versions:versions-redmadrobot:2022.03.09")
}
create("androidx") {
from("com.redmadrobot.versions:versions-androidx:2022.03.09")
}
create("stack") {
from("com.redmadrobot.versions:versions-stack:2022.03.09")
}
}
}
⚠️ Be careful with version catalogs naming. Make sure selected name does not conflict with any of Gradle plugin extensions, otherwise your project will not sync. For example, if you have gradle-infrastructure plugin, you cannot create version catalog namedredmadrobot
, because gradle-infrastructure contains an extension namedredmadrobot
. Also you should not name the published version catalog aslibs
if you want to use the local version catalog, or you must rename the local version catalog.
After sync the project gradle create accessors for dependencies like:
plugins {
alias(rmr.plugins.android.application)
alias(androidx.plugins.navigation.safeargs)
}
dependencies {
implementation(androidx.core.ktx)
implementation(androidx.fragment)
implementation(rmr.extension.fragment)
implementation(core.dagger)
}
You can find Troubleshooting in gradle documentation page.
Caused by: java.lang.IllegalArgumentException: Cannot add extension with name, as there is an extension already registered with that name
Probably, you named a version catalog as one of the gradle plugin extensions. Please, read the warning under Importing a published catalog section.
Caused by: org.gradle.plugin.management.internal.InvalidPluginRequestException: Plugin request for plugin already on the classpath must not include a version
This exception can occur if the plugin has already been applied in the root build.gradle, or has a notation in the buildscripts section, or has a notation in the plugins section of the settings.gradle file.
You can leave the plugin notation only in the modules you need, because alias
applies the plugin version from the version catalog file.
If this is not possible, you can use the id
extension instead of alias
and get only pluginId from the accessor.
plugins {
id(rmr.plugins.infrastructure.detekt.get().pluginId)
}
This is an Intellij IDEA issue and it does not affect the build.
You can suppress it with @Suppress("DSL_SCOPE_VIOLATION")
Problem: In version catalog libs, you can only import a single external catalog in a given catalog definition.
Probably, you named a published version catalog as libs
.
Please, read the warning under Importing a published catalog section.
Check your Gradle wrapper version. The current catalog based on Gradle 7.2.
- You can find some useful information and some answers to questions about the version catalog at https://melix.github.io/blog/tags/catalog.html