New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version catalogs should work in buildscript dependencies #16958
Comments
@swankjesse buildscript {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
dependencies {
val libs = project.extensions.getByType<VersionCatalogsExtension>().named("libs") as org.gradle.accessors.dm.LibrariesForLibs
classpath(libs.sqlDelight.gradlePlugin)
}
}
|
I have a similar problem, but in a different place. I tried to define dependencies from service catalog for sub-projects and it does not work either. Example:
Extension with name 'libs' does not exist. Currently registered extension names: ... |
Looks like you're having this issue, which is unrelated |
@swankjesse Is this feature |
What version of Gradle should this fix show up in? (I just tested Gradle 7.1 and this seems to still be broken) |
I just tested it too with 7.1 and it doesn't work yet. I guess it was fixed too late to come into 7.1. And also some docs for that feature are waiting for review. Hopefully it will be included in next release. EDIT: it will be in 7.2, see milestones. |
Can you write a proper issue description? "Sill not working" is very hard to debug. |
I make several toml files according to usage. in myproject/gradle/gradle.versions.toml [versions] in myproject/gradle/kotlin.versions.toml [versions] in myproject/gradle/qc.versions.toml [versions] in myproject/settings.gradle.kts project level gradle file
first time it's work, then gradleLibs, kotlinLibs and qcLibs give me error, Unsolved reference |
Paul's answer in Groovy
|
This was previously reported as part 2 of Issue 16652.
Expected Behavior
I expect centralized dependency versions to work everywhere I specify dependencies. This includes my
buildscript
clause.In
myproject/settings.gradle.kts
:In
myproject/gradle/libs.versions.toml
:In
myproject/build.gradle.kts
:Current Behavior
Context
I’m using Gradle 7.
Workaround
This is a workaround. It is verbose, doesn’t have IDE support, and is inconsistent with my other dependencies blocks.
The text was updated successfully, but these errors were encountered: