Skip to content

Commit bc7889d

Browse files
authored
Make Gradle plugin isolation compatible (#325)
project.findProperty is not Gradle project isolation compatible (https://docs.gradle.org/current/userguide/isolated_projects.html) because it attempts to read properties from parent projects, thus violating project isolation. Instead, moving to project.providers.gradleProperty that does not have this behavior. Fixes #258
1 parent 4cb4422 commit bc7889d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugin/main/src/kotlinx/benchmark/gradle/BenchmarkConfiguration.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ constructor(
7171
extension: BenchmarksExtension,
7272
name: String
7373
) : BenchmarkTarget(extension, name) {
74-
var jmhVersion: String = (extension.project.findProperty("benchmarks_jmh_version") as? String)
75-
?: BenchmarksPluginConstants.DEFAULT_JMH_VERSION
74+
var jmhVersion: String = extension.project.providers.gradleProperty("benchmarks_jmh_version")
75+
.orElse(BenchmarksPluginConstants.DEFAULT_JMH_VERSION).get()
7676
}
7777

7878
class JavaBenchmarkTarget

0 commit comments

Comments
 (0)