This message was deleted.
# caching
s
This message was deleted.
v
If the docs day it just be one of these types, I guess it has to be one of these types. But maybe you can add another property of type
ConfigurableFileProperty
that is derived from your directory list?
w
ListProperty<Directory>
should work as well if it has the right annotations, e.g.
@InputFiles
and
@Incremental
. The important thing right now is that the value can carry the identity of the property somehow.
❤️ 1
I am surprised that you use
ListProperty<Directory>
though and not a
ConfigurableFileCollection
, what is your use-case for that?
e
Hi @wolfs the use case is to process android source which is a
Provider<List<Directory>>
Copy code
val androidExtension = project.extensions.getByType(ApplicationAndroidComponentsExtension::class.java)
androidExtension.onVariants { appVariant ->
    val allSources: Provider<List<Directory>> = appVariant.sources.java.all
    val sourceVerificationTask = project.tasks.register<SourceToVerificationCodesTask>(
         "${appVariant.name}SourceToVerificationCodes"
    ) {
        sources.from(project.files(allSources))
        ...
    }
}
Copy code
abstract class SourceToVerificationCodesTask : DefaultTask() {
    @get:Incremental
    @get:InputFiles
    abstract val sources: ConfigurableFileCollection// ListProperty<Directory>
    ...
}
However the inputChanges.getFileChanges(…) does not accept ListProperty (Check the attached image) @Vampire I think your idea is great~ will try that as well, for now I just wrap the
ListProperty<Directory>
by
project.files()
w
Ah right, we trimmed down the API. So it seems like
ConfigurableFileCollection
should be the way to go.
e
Oh, is there any particular reason that the API got trimmed? Just curious.
Because AGP shifted to those
Provider
based APIs, so I think it would be good to keep consistent on my own plugin which works with AGP.
w
Mainly because we didn’t expect folks to use a collection property with file system locations but to use
FileCollection
instead.
e
Thanks both👍
👌 1