Ksawery Karwacki
02/26/2024, 6:17 PMval internalFileVersionSource = project.providers.of(CustomPropertiesFileValueSource::class.java) {
it.parameters.propertiesFile.convention(project.internalVersionFilePath())
}
if I add function that looks like this:
fun Project.myValueSource(): Provider<Map<String, String>> {
return this.providers.of(CustomPropertiesFileValueSource::class.java) {
it.parameters.propertiesFile.convention(this.internalVersionFilePath())
}
}
If i start using myValueSource() will it be evaluated once and cached or each instance will be treated as separate execution when provider is resolved? Is there any way to register ValueSources? Passing them as function parameters is not very convenient especially if they are used by multiple parts of the plugin.Mikhail Lopatkin
02/26/2024, 6:51 PMof call produces a new instance, which is evaluated separately. However, each instance is only evaluated at most once, the result is cached.Vampire
02/26/2024, 7:31 PMKsawery Karwacki
02/26/2024, 8:39 PM