Kelvin Chung
03/17/2025, 5:56 PMValueSource
, is there a serializability requirement on the parameters?
eg.
abstract class MyValueSource : ValueSource<String, MyValueSource.Parameters> {
interface Parameters : ValueSourceParameters {
val myClient: Property<MyClient>
}
}
vs.
abstract class MyValueSource : ValueSource<String, MyValueSource.Parameters> {
interface Parameters : ValueSourceParameters {
val myService: Property<MyService> // from a BuildService provider
val clientName: Property<String>
}
private val myClient = parameters.myService.zip(parameters.myClient) { ... }
}
I seem to recall that there being a case, but I want to make sure, since you can certainly design without.ritesh singh
03/19/2025, 8:44 AMritesh singh
03/19/2025, 8:45 AMMikhail Lopatkin
03/19/2025, 7:33 PMreadResolve
or writeObject
). It is only used when CC is enabled.
The output of the ValueSource may only be serialized with the first serialization if it is used as a task input. It may also be serialized by CC serialization if the ValueSource is obtained at configuration time, for build input fingerprinting.Kelvin Chung
03/19/2025, 8:16 PMValueSource
parameters in such a way that we use "serializable" types, which rules out client objects. I presume BuildService
instances, due to being named, are OK.
Aside: there is no such requirement for a WorkAction
, right?Mikhail Lopatkin
03/19/2025, 8:26 PMwe have to design ValueSource parameters in such a way that we use "serializable" typesBasically yes
I presume BuildService instances, due to being named, are OK.There is at least one corner case of BuildServices and ValueSources that Gradle doesn't support yet. It is configuration cache specific
there is no such requirement for a WorkAction, right?My reading of the code suggests that
WorkAction
parameters, ArtifactTransform
parameters, and other similar XxxParameter
things all share the same infrastructure and thus requirements.Kelvin Chung
03/19/2025, 8:29 PM