Jesse Wilson
02/18/2025, 9:42 PMFile. It looks kind of like this:
data class SqlDelightSourceFolder(
@Internal val folder: File,
@Input val dependency: Boolean,
) : Serializable
The data ultimately ends up as an input to a task (SqlDelightTask). It looks kind of like this:
@CacheableTask
abstract class SqlDelightTask : AbstractTask() {
...
@get:Nested abstract var sourceFolder: SqlDelightSourceFolder
}
This all works.
But by expressing the task’s input file as a File, Gradle doesn’t infer task dependencies if that File is the output of another task. So I want to replace the File field with something more powerful, a ConfigurableFileCollection.
data class SqlDelightSourceFolder(
@InputFiles @PathSensitive(PathSensitivity.RELATIVE) val folder: ConfigurableFileCollection,
@Input val dependency: Boolean,
) : Serializable
But when I tried that, my build broke because ConfigurableFileCollection isn’t serializable.
Is there a good way to use a ConfigurableFileCollection as a property of a class, that’s itself an input to a task?Philip W
02/18/2025, 10:11 PMPhilip W
02/18/2025, 10:12 PMPhilip W
02/18/2025, 10:13 PMPhilip W
02/18/2025, 10:13 PMPhilip W
02/18/2025, 10:14 PMJesse Wilson
02/18/2025, 11:12 PMJesse Wilson
02/18/2025, 11:12 PMVampire
02/18/2025, 11:20 PMProvider<Directory will maybe also not be Serializable.
Maybe that data class should not implement Serializable?
Besides that, as a constructor parameter ConfigurableFileCollection probably does not make much sense anyway but should be a FileCollection maybe?Jesse Wilson
02/19/2025, 2:42 PMJesse Wilson
02/19/2025, 2:43 PMJesse Wilson
02/19/2025, 2:44 PMVampire
02/19/2025, 4:20 PMSerializableVampire
02/19/2025, 4:21 PMJesse Wilson
02/19/2025, 6:49 PMPhilip W
02/19/2025, 6:50 PMPhilip W
02/19/2025, 6:51 PMVampire
02/19/2025, 6:52 PMVampire
02/19/2025, 6:52 PMVampire
02/19/2025, 6:53 PMVampire
02/19/2025, 6:54 PMJesse Wilson
02/19/2025, 7:25 PM