[Gradle, JS] Postpone TeamCity project property read using 'by lazy'
Replace direct Gradle property access to provider usage. See https://docs.gradle.org/6.8.2/userguide/configuration_cache.html#config_cache:requirements:undeclared_gradle_prop_read
This commit is contained in:
+3
-1
@@ -59,7 +59,9 @@ class KotlinKarma(
|
||||
private var configDirectory: File by property {
|
||||
defaultConfigDirectory
|
||||
}
|
||||
private val isTeamCity = project.hasProperty(TC_PROJECT_PROPERTY)
|
||||
private val isTeamCity by lazy {
|
||||
project.providers.gradleProperty(TC_PROJECT_PROPERTY).forUseAtConfigurationTime().isPresent
|
||||
}
|
||||
|
||||
override val requiredNpmDependencies: Set<RequiredKotlinJsDependency>
|
||||
get() = requiredDependencies + webpackConfig.getRequiredDependencies(versions)
|
||||
|
||||
+3
-1
@@ -28,7 +28,9 @@ class KotlinMocha(@Transient override val compilation: KotlinJsCompilation, priv
|
||||
private val npmProject = compilation.npmProject
|
||||
private val nodeJs = NodeJsRootPlugin.apply(project.rootProject)
|
||||
private val versions = nodeJs.versions
|
||||
private val isTeamCity = project.hasProperty(TC_PROJECT_PROPERTY)
|
||||
private val isTeamCity by lazy {
|
||||
project.providers.gradleProperty(TC_PROJECT_PROPERTY).forUseAtConfigurationTime().isPresent
|
||||
}
|
||||
|
||||
override val settingsState: String
|
||||
get() = "mocha"
|
||||
|
||||
+1
-1
@@ -114,7 +114,7 @@ abstract class KotlinNativeTest : KotlinTest() {
|
||||
prependSuiteName = targetName != null,
|
||||
treatFailedTestOutputAsStacktrace = false,
|
||||
stackTraceParser = ::parseKotlinNativeStackTraceAsJvm,
|
||||
escapeTCMessagesInLog = project.hasProperty(TC_PROJECT_PROPERTY)
|
||||
escapeTCMessagesInLog = project.providers.gradleProperty(TC_PROJECT_PROPERTY).forUseAtConfigurationTime().isPresent
|
||||
)
|
||||
|
||||
// The KotlinTest expects that the exit code is zero even if some tests failed.
|
||||
|
||||
Reference in New Issue
Block a user