So, I stumble upon an usage problem of `Configurab...
# community-support
t
So, I stumble upon an usage problem of
ConfigurableFileCollection
used in
SourceTask
s: Whenever a plugin uses one of those and multiple source directories are added to it (say
build/generated/foo/kotlin
and
build/generated/bar/kotlin
), I cannot exclude files from this said file collection via
exclude("**/build/**")
or
exclude("**/generated/**")
, but only match path parts beyond the configured source directories, e.g.
**/SomeFile.kt
. I could not see an API in
PatternFilterable
that makes this possible and my naive attempt to use
FileTreeElement
via
Copy code
exclude { spec ->
    spec.file.absolutePath.contains("**/build/**")
}
failed as well. So what do I overlook here?
v
That you path is
bla/build/generated/blu
and not
**/build/**/generated/blu
.
You do a
String.contains
and that string does not contain
**/build/**
🙂
t
Ah, damn me, right 🙂
Anyways, wish that API was a bit easier to find in
PatternFilterable
.
👌 1