Slackbot
07/06/2022, 2:25 PMmelix
07/06/2022, 2:26 PMRené
07/06/2022, 2:42 PMconfigure(subprojects - project('elasticsearch-log4j')) {
/*
* All subprojects are java projects using Elasticsearch's standard build
* tools.
*/
apply plugin: 'elasticsearch.build'
}René
07/06/2022, 2:43 PMmelix
07/06/2022, 2:45 PMVersionCatalogsExtension exposes a realized catalogmelix
07/06/2022, 2:45 PMmelix
07/06/2022, 2:46 PMRené
07/06/2022, 2:47 PMmelix
07/06/2022, 2:47 PMRené
07/06/2022, 2:47 PMvar checkstyleDependencyProvider = project.provider(
() -> project.getExtensions().getByType(VersionCatalogsExtension.class).named("buildLibs").findLibrary("checkstyle").get().get()
);
dependencies.addProvider("checkstyle", checkstyleDependencyProvider);
🤮melix
07/06/2022, 2:48 PMRené
07/06/2022, 2:48 PMRené
07/06/2022, 2:48 PMmelix
07/06/2022, 2:49 PMmelix
07/06/2022, 2:50 PMRené
07/06/2022, 2:51 PMRené
07/06/2022, 2:52 PMRené
07/06/2022, 2:52 PMmelix
07/06/2022, 2:53 PMmelix
07/06/2022, 2:53 PMRené
07/06/2022, 2:54 PMmelix
07/06/2022, 2:54 PMRené
07/06/2022, 2:54 PMVampire
07/06/2022, 11:41 PMextensions and thus tried to get it from a task, instead of from the project.melix
07/07/2022, 6:08 AMRené
07/07/2022, 6:09 AM// this works!
def versionCatalogRoot = extensions.getByType(VersionCatalogsExtension).named("buildLibs")
println(versionCatalogRoot.findLibrary("checkstyle").get().get())
subprojects {
// this throws "Extension of type 'VersionCatalogsExtension' does not exist."
def versionCatalog = extensions.getByType(VersionCatalogsExtension).named("buildLibs")
println(versionCatalog.findLibrary("checkstyle").get())
}melix
07/07/2022, 6:10 AMsubprojects?René
07/07/2022, 6:11 AMmelix
07/07/2022, 6:12 AMRené
07/07/2022, 6:13 AMmelix
07/07/2022, 6:13 AMRené
07/07/2022, 6:14 AMmelix
07/07/2022, 6:16 AMRené
07/07/2022, 6:17 AMmagicRené
07/07/2022, 6:18 AMmelix
07/07/2022, 6:18 AMRené
07/07/2022, 6:25 AM