Catalog
Gradle versions catalog for our plugins. idofront-catalog-shaded
creates a packaged release that shades all these dependencies, which we use for our platform.
Tip
You can see all our defined versions in this file
Importing our catalog¶
dependencyResolutionManagement {
repositories {
maven("https://repo.mineinabyss.com/releases")
}
versionCatalogs {
create("libs") {
from("com.mineinabyss:catalog:<version>")
}
}
}
Note
Our catalog needs to be called libs
for some of our plugins to work. If you use your own, we recommend loading it from a file and using the name myLibs
.
dependencies {
compileOnly(libs.kotlinx.coroutines) // You will get autocomplete here!
implementation(libs.kotlinx.serialization)
// etc...
}
Using plugins from the catalog¶
@Suppress("DSL_SCOPE_VIOLATION") // The IDE shows an error without this that doesn't actually cause problems
plugins {
alias(libs.plugins...)
}
Common errors¶
Plugin is already on the classpath
Error resolving plugin
The request for this plugin could not be satisfied because the plugin is already on the classpath with an unknown version, so compatibility cannot be checked.
This error happens when the plugin has been added by a parent project, since alias
always tries to force a specific version, rather than just applying the plugin without version.
To fix this, apply the plugin by name instead of using alias
:
plugins {
id(libs.plugins.x.y.z.get().pluginId)
}
Expecting an expression
You may get an error if no configuration comes after the plugins
block. In this case add an empty run statement like so:
@Suppress("DSL_SCOPE_VIOLATION")
plugins { ... }
run {}
LibrariesForLibs does not exist
org.gradle.api.UnknownDomainObjectException: Extension of type 'LibrariesForLibs' does not exist.
It is likely that one of our conventions plugins tried to read versions from the catalog via the libs
variable, but it either hasn't been registered, or has been registered under a different name. Follow the instructions in Using plugins from the catalog.