Caleb Cushing
10/31/2024, 3:39 PMProperty "holders/extensions" (from what I can tell). is there a good way to use finalizeOnRead with those? as if you need a value and don't get it, setting it later won't work.Vampire
10/31/2024, 4:07 PMCaleb Cushing
10/31/2024, 4:44 PMthisCaleb Cushing
10/31/2024, 4:45 PMCaleb Cushing
10/31/2024, 5:05 PMValueSourceParameters (and I'm making some other assumptions here). can I have an interface that extends the ValueSourceParameters but the abstract is injected?
the assumption is that if I register the ValueSourceParameters as an extension then it'll be available if I apply the generic to the ValueSource.Caleb Cushing
10/31/2024, 5:06 PMabstract class HeadBranchValueSource implements ValueSource<String, GitConfigurationExtension> {Vampire
10/31/2024, 5:10 PMCaleb Cushing
10/31/2024, 5:12 PMGitConfigurationExtension is an interface, and there's an AbstractGitConfigurationExtension would HeadBranchValueSource::getParameters return the instance of AbstractGitConfigurationExtension? or would it just go about creating its own implementationThomas Broyer
10/31/2024, 5:38 PMAbstractGitConfigurationExtension other than by using it in the ValueSource generics.Thomas Broyer
10/31/2024, 5:42 PMfinalizeValueOnRead? Most of the time, IIRC, the property will be finalized by Gradle at some point anyway, and for parameters of a ValueSource, that would be just before the ValueSource is created, just after you configured them on the ValueSourceSpec.Vampire
10/31/2024, 5:51 PMCaleb Cushing
10/31/2024, 7:10 PMfor parameters of a ValueSource, that would be just before the ValueSource is created,interpretation, just before "new" is called which is... awful and not lazy. should be just before
obtain is called...Caleb Cushing
10/31/2024, 7:11 PMCaleb Cushing
10/31/2024, 7:12 PMCaleb Cushing
10/31/2024, 7:12 PMThomas Broyer
10/31/2024, 8:20 PMnew? Value sources are created by providers.of()Caleb Cushing
10/31/2024, 8:30 PMThomas Broyer
10/31/2024, 8:56 PMVampire
11/01/2024, 12:07 AMVampire
11/01/2024, 12:08 AMabstract class MyValueSource : ValueSource<String, MyValueSource.Parameters> {
override fun obtain(): String {
println(parameters.param.get())
parameters.param.set("bar")
println(parameters.param.get())
return ""
}
interface Parameters : ValueSourceParameters {
val param: Property<String>
}
}
providers.of(MyValueSource::class) {
parameters.param.set("foo")
}.get()
works fine and prints first foo then bar, so even within obtain you can still change the property.