File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
plugin/main/src/kotlinx/benchmark/gradle Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ package kotlinx.benchmark.gradle
2
2
3
3
import org.gradle.api.*
4
4
import org.gradle.util.*
5
- import org.jetbrains.kotlin.gradle.plugin.*
6
5
7
6
@Suppress(" unused" )
8
7
class BenchmarksPlugin : Plugin <Project > {
@@ -35,9 +34,11 @@ class BenchmarksPlugin : Plugin<Project> {
35
34
return // TODO: Do we need to fail build at this point or just ignore benchmarks?
36
35
}
37
36
38
- logger.info(" Detected Kotlin plugin version '${project.getKotlinPluginVersion()} '" )
39
- if (! getKotlinVersion().isAtLeast(1 , 7 , 20 )) {
40
- logger.error(" JetBrains Gradle Benchmarks plugin requires Kotlin version 1.7.20 or higher" )
37
+ plugins.withType(org.jetbrains.kotlin.gradle.plugin.KotlinBasePlugin ::class .java) { kotlinPlugin ->
38
+ logger.info(" Detected Kotlin plugin version '${kotlinPlugin.pluginVersion} '" )
39
+ if (! getKotlinVersion(kotlinPlugin.pluginVersion).isAtLeast(1 , 7 , 20 )) {
40
+ logger.error(" JetBrains Gradle Benchmarks plugin requires Kotlin version 1.7.20 or higher" )
41
+ }
41
42
}
42
43
43
44
// Create empty task that will depend on all benchmark building tasks to build all benchmarks in a project
@@ -81,8 +82,7 @@ class BenchmarksPlugin : Plugin<Project> {
81
82
}
82
83
}
83
84
84
- private fun Project.getKotlinVersion (): KotlinVersion {
85
- val kotlinVersion = getKotlinPluginVersion()
85
+ private fun getKotlinVersion (kotlinVersion : String ): KotlinVersion {
86
86
val (major, minor) = kotlinVersion
87
87
.split(' .' )
88
88
.take(2 )
You can’t perform that action at this time.
0 commit comments