Is there a good way of debugging where a duplicate...
# community-support
d
Is there a good way of debugging where a duplicate file in a
Copy
task is coming from? The
process{MyConfigurationName}Resources
task is failing, but I don't understand why. I think this task is being automatically generated since my configuration specifies a
resources.srcDir
.
v
The task is always there, one for every source set, whether you specify an explicit
srcDir
for it or not.
👍 1
It's probably most pragmatic to just print the input files
Copy code
tasks.processResources {
    doFirst {
        inputs.files.forEach {
            println("input file: $it")
        }
    }
}
d
That code snippet worked, except none of these files are repeating. Each one listed is unique, and what I would expect.
v
Well, hard to guess. Also, not the full entry is relevant, that would be impossible. If they end up in the same location would cause the problem.
Doesn't the error tell you which file is the problem?
Been a while since I've seen it
d
It does, but the only instance of that file is in a separate repository that I don't think is being depended on here.. it could be, I guess it might be a rabbit hole here.
Aha, so I've got a lead. The
resources
directory has 12 files but when I use the
eachFile
closure, it reports 13 files with the one being duplicated for some reason:
Copy code
project.tasks.named('processMyConfigurationResources', ProcessResources) {
	eachFile { FileCopyDetails fcd ->
		println "${fcd}"
	}
}
👌 1
Well I've found it, and I should have read your first message a little closer. Having
resources.srcDir file('src/mySourceSetName/resources')
was trying to double the resources since like you said,
ProcessResources
always happens. 🙂
Thanks for the help!
👌 1