Slackbot
08/20/2022, 1:22 AMChris Lee
08/20/2022, 1:29 AMrootProject.the<VersionCatalogsExtension>().find("libs)
Suresh
08/20/2022, 1:31 AMChris Lee
08/20/2022, 1:31 AMChris Lee
08/20/2022, 1:32 AMSuresh
08/20/2022, 1:36 AMversion catalog are only suggestionsyeah i understand that.
“main source”Your application source. Say i have a spring boot app, which have an api to list all the dependencies and it’s version defined in the catalog. I understand it’s not the resolved config. But it would be great to read some other info which i kept in version catalogs like
[versions]
java = "20"
kotlin = "1.7.20-Beta"
kotlin-jvm-target = "18"
kotlin-api-version = "1.8"
kotlin-lang-version = "1.8"
gradle = "7.7-20220817221725+0000"
Chris Lee
08/20/2022, 1:38 AMSuresh
08/20/2022, 1:44 AMnclude the toml file in your jar task, and write the code to pull it in a runtime.yeah, that’s one option. But i am looking for a. type safe one.
For accuracy, grab the Java version from the toolchain in use, grab the Gradle version from Gradle itself, Kotlin info from compile task, etc.|Got it.. the thing is, in my case, those values are set from the version catalog.
java {
withSourcesJar()
withJavadocJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(libs.versions.java.asProvider().get()))
}
// modularity.inferModulePath.set(true)
}
Chris Lee
08/20/2022, 2:54 AM