Forgive me in case the terminology is not correct as I am new to gradle and migrating one ant based build to gradle!
I want to concatenate multiple files into one using gradle, I know that I can call ant and do that but I want to utilize gradle powerful copy task to achieve this. To do this I was thinking to extend Copy task itself but I didn’t get any solid article in google explaining how to extend any core task.
My new task will have another property which will define target/concatenated file name where as source file names can still be fetched using existing ‘from’ clousures!
I’d just write my own custom task in Groovy that knows how to concatinate files. You can either put this code into your build script, use the ‘buildSrc’ project or write a plugin if you want to share the code among projects. Here’s an example: