Slackbot
11/02/2022, 3:23 AMVampire
11/02/2022, 7:46 AMConfigurableFileProperty
that is derived from your directory list?wolfs
11/02/2022, 7:57 AMListProperty<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.wolfs
11/02/2022, 7:58 AMListProperty<Directory>
though and not a ConfigurableFileCollection
, what is your use-case for that?El Zhang
11/02/2022, 8:32 AMProvider<List<Directory>>
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))
...
}
}
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()
wolfs
11/02/2022, 8:34 AMConfigurableFileCollection
should be the way to go.El Zhang
11/02/2022, 8:36 AMEl Zhang
11/02/2022, 8:37 AMProvider
based APIs, so I think it would be good to keep consistent on my own plugin which works with AGP.wolfs
11/02/2022, 8:38 AMFileCollection
instead.El Zhang
11/02/2022, 8:43 AM