You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
val prop = project.properties[BANNED_TARGETS_PROPERTY_NAME] asString?
Here is a fragment of stacktrace showing how applying BCV unexpectedly triggers evaluation of jvmToolchain in JavaPluginExtension.
...
at org.gradle.api.internal.provider.AbstractMinimalProvider.calculatePresence(AbstractMinimalProvider.java:95)
at org.gradle.api.internal.provider.MappingProvider.calculatePresence(MappingProvider.java:50)
at org.gradle.api.internal.provider.AbstractProperty.calculatePresence(AbstractProperty.java:81)
at org.gradle.api.internal.provider.AbstractMinimalProvider.isPresent(AbstractMinimalProvider.java:90)
at org.gradle.jvm.toolchain.internal.DefaultToolchainSpec.isConfigured(DefaultToolchainSpec.java:82)
at org.gradle.jvm.toolchain.internal.DefaultToolchainSpec_Decorated.isConfigured(Unknown Source)
at org.gradle.api.plugins.internal.DefaultJavaPluginExtension.getSourceCompatibility(DefaultJavaPluginExtension.java:135)
at org.gradle.api.plugins.internal.DefaultJavaPluginExtension_Decorated.getSourceCompatibility(Unknown Source)
at org.gradle.api.plugins.internal.DefaultJavaPluginExtension.getTargetCompatibility(DefaultJavaPluginExtension.java:158)
at org.gradle.api.plugins.internal.DefaultJavaPluginExtension_Decorated.getTargetCompatibility(Unknown Source)
at org.gradle.api.plugins.internal.DefaultJavaPluginConvention.getTargetCompatibility(DefaultJavaPluginConvention.java:92)
at org.gradle.api.plugins.internal.DefaultJavaPluginConvention_Decorated.getTargetCompatibility(Unknown Source)
at org.gradle.api.plugins.internal.NaggingJavaPluginConvention.getTargetCompatibility(NaggingJavaPluginConvention.java:83)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
at org.codehaus.groovy.runtime.metaclass.MultipleSetterProperty.getProperty(MultipleSetterProperty.java:49)
at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.getProperties(BeanDynamicObject.java:500)
at org.gradle.internal.metaobject.BeanDynamicObject.getProperties(BeanDynamicObject.java:208)
at org.gradle.internal.extensibility.DefaultConvention$ExtensionsDynamicObject.getProperties(DefaultConvention.java:261)
at org.gradle.internal.metaobject.CompositeDynamicObject.getProperties(CompositeDynamicObject.java:80)
at org.gradle.internal.extensibility.ExtensibleDynamicObject$InheritedDynamicObject.getProperties(ExtensibleDynamicObject.java:238)
at org.gradle.internal.metaobject.CompositeDynamicObject.getProperties(CompositeDynamicObject.java:80)
at org.gradle.api.internal.project.DefaultDynamicLookupRoutine.lambda$getProperties$0(DefaultDynamicLookupRoutine.java:52)
at org.gradle.internal.deprecation.DeprecationLogger.whileDisabled(DeprecationLogger.java:253)
at org.gradle.api.internal.project.DefaultDynamicLookupRoutine.getProperties(DefaultDynamicLookupRoutine.java:52)
at org.gradle.api.internal.project.DefaultProject.getProperties(DefaultProject.java:1228)
at kotlinx.validation.KlibValidationPipelineBuilder.bannedTargets(BinaryCompatibilityValidatorPlugin.kt:467)
at kotlinx.validation.KlibValidationPipelineBuilder.targetIsSupported(BinaryCompatibilityValidatorPlugin.kt:546)
at kotlinx.validation.KlibValidationPipelineBuilder.access$targetIsSupported(BinaryCompatibilityValidatorPlugin.kt:352)
at kotlinx.validation.KlibValidationPipelineBuilder$configureTargets$4.invoke(BinaryCompatibilityValidatorPlugin.kt:505)
at kotlinx.validation.KlibValidationPipelineBuilder$configureTargets$4.invoke(BinaryCompatibilityValidatorPlugin.kt:497)
at kotlinx.validation.BinaryCompatibilityValidatorPluginKt$sam$org_gradle_api_Action$0.execute(BinaryCompatibilityValidatorPlugin.kt)
<17 internal lines>
at org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtensionKt.configureOrCreate(KotlinMultiplatformExtension.kt:341)
The problem is in Project.getProperties call which gathers properties from the following sources (in a non-lazy way):
Project object properties
Project extensions
Project convention properties
Project extra properties
Project tasks
Searches up through this project's ancestor projects for convention properties or extra properties.
The solution is to replace this call with Project.findProperty which searches by name without triggering evaluation of all properties.
binary-compatibility-validator/src/main/kotlin/BinaryCompatibilityValidatorPlugin.kt
Line 467 in 49b5b55
Here is a fragment of stacktrace showing how applying BCV unexpectedly triggers evaluation of
jvmToolchain
inJavaPluginExtension
.The problem is in
Project.getProperties
call which gathers properties from the following sources (in a non-lazy way):The solution is to replace this call with
Project.findProperty
which searches by name without triggering evaluation of all properties.Related:
The text was updated successfully, but these errors were encountered: