[Build] Change how buildSrc buildscript detects versions
This commit is contained in:
committed by
Space Team
parent
2570be129f
commit
2304b0f12d
@@ -1,3 +1,5 @@
|
|||||||
|
import org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
// workaround for KGP build metrics reports: https://github.com/gradle/gradle/issues/20001
|
// workaround for KGP build metrics reports: https://github.com/gradle/gradle/issues/20001
|
||||||
project.extensions.extraProperties["kotlin.build.report.output"] = null
|
project.extensions.extraProperties["kotlin.build.report.output"] = null
|
||||||
@@ -13,9 +15,34 @@ buildscript {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info("buildSrcKotlinVersion: " + extra["bootstrapKotlinVersion"])
|
logger.info("buildSrcKotlinVersion: " + project.getKotlinPluginVersion())
|
||||||
logger.info("buildSrc kotlin compiler version: " + org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION)
|
|
||||||
logger.info("buildSrc stdlib version: " + KotlinVersion.CURRENT)
|
configurations {
|
||||||
|
fun NamedDomainObjectProvider<Configuration>.printResolvedDependencyVersion(formatString: String, group: String, name: String) {
|
||||||
|
configure {
|
||||||
|
incoming.afterResolve {
|
||||||
|
val dependency = resolutionResult.allDependencies
|
||||||
|
.filterIsInstance<ResolvedDependencyResult>()
|
||||||
|
.map { it.selected.id }
|
||||||
|
.filterIsInstance<ModuleComponentIdentifier>()
|
||||||
|
.find { it.group == group && it.module == name }
|
||||||
|
if (dependency != null) {
|
||||||
|
logger.info(formatString, dependency.version)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
kotlinCompilerClasspath.printResolvedDependencyVersion(
|
||||||
|
"buildSrc kotlin compiler version: {}",
|
||||||
|
"org.jetbrains.kotlin",
|
||||||
|
"kotlin-compiler-embeddable"
|
||||||
|
)
|
||||||
|
compileClasspath.printResolvedDependencyVersion(
|
||||||
|
"buildSrc stdlib version: {}",
|
||||||
|
"org.jetbrains.kotlin",
|
||||||
|
"kotlin-stdlib"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
`kotlin-dsl`
|
`kotlin-dsl`
|
||||||
|
|||||||
Reference in New Issue
Block a user