Closed aSemy closed 1 month ago
@aSemy thanks for opening the issue!
As of Klib-related tasks, (almost) everything should be fixed with #204.
For old JVM-related tasks, we'll probably have to gradually deprecate and remove them and provide new "better" tasks as a replacements.
Currently BCV uses vars for configuring behaviour.
This causes issues when configuring BCV, as the order of operations is now very sensitive to the order of configuration, and the interaction with different plugins. It also means that values must be computed lazily.
Lazy values also means that
afterEvaluate {}
can be avoided, which can also cause compatibility issues with other Gradle plugins, and should be avoided.In order for BCV to follow best practices, properties that are compatible with the Gradle Provider API should be used instead.
For example:
FileCollection
should be replaced withConfigurableFileCollection
https://github.com/Kotlin/binary-compatibility-validator/blob/ad1bea6630508abc0ec2bb0fd516a90aa6786258/src/main/kotlin/KotlinKlibAbiBuildTask.kt#L34-L33
Primitive properties, like
Boolean
, should be replaced withProperty<Boolean>
https://github.com/Kotlin/binary-compatibility-validator/blob/ad1bea6630508abc0ec2bb0fd516a90aa6786258/src/main/kotlin/ApiValidationExtension.kt#L102-L101
Conventional values
Currently, the conventions for the non-lazy properties are configured in-place.
The Provider API allows for setting default conventions, and these should be set in the BinaryCompatibilityValidatorPlugin.
For example:
Further reading: