I am working on a project where the default processResources task won’t do, since we don’t use a single resources folder, but rather copy our resources from several folders, with some of the files they contain being excluded.
I achieved what I wanted by modifying the srcSets configuration and setting a resources folder. Then I overwrite all the actions of the default processResources task and set my own copy actions.
Do I understand this correctly that you solved your issue?
BTW: The task processResources is of type Copy so you don’t need to add an action that uses the copy method. You can simply add your copy definition (from, into) to the task.
I have to configure the processResources task, since by default the task copies all the files from the resources directory. But I need to exclude some of them.
As to only using “from” and “into” instead of the copy method: Is that possible, if I copy from several folders to several others? My task looks something like this now:
As Peter mentioned, you should be able to do what you want by configuring the sources to be copied, rather than configuring the task. The ‘processResources’ task doesn’t copy everything from a directory, it copies everything in ‘sourceSets.main.resources’, which by default is everything in the resources directory.