This message was deleted.
# community-support
s
This message was deleted.
w
I suppose you can use it as an output with
@OutputFiles
.
👍 1
j
I thought that
@OutputFiles
only works with
List<File>
and not with that type
w
j
mmm I think it is not valid
I expect to use
Map<String, List<File>>
, not
Map<String, File>
So I am getting
Expected file collection to contain exactly one file, however, it contains more than one file
w
Ah, I see.
j
Nested is only for inputs then?
I did this as a workaround
Copy code
@Internal
    val commonMainDrawablesGroupedBySuffix: Map<String, List<File>> =
        commonMainDrawablesGroupedBySuffix(commonMainResourcesDirs.toList(), suffixes.get())

    @OutputFiles
    val commonMainDrawables: List<File> = commonMainDrawablesGroupedBySuffix.values.flatten()
it works, but the problem is
commonMainDrawables
is marked by the IDE as not used, which is technically true
it doesn't work 😞
w
You can use
@Nested
for outputs, though you’d need to define your own type. Something like should work:
Copy code
class MyOutput {
    @OutputFiles
    List<File> outputs
}

@Nested
val drawables: Map<String, MyOutput>
Why does your version above not work?
j
I had a different issue, sorry, with the new implementation even I don't need that output anymore, thank you for your help and I note the trick for the next one! :)