This message was deleted.
# community-support
s
This message was deleted.
👀 1
c
Perhaps a
doFirst
block in processResources? Hard to say without understanding what you’re trying to accomplish.
f
I'm currently replacing tokens like
@test@
into the source files and the resource files, everything works with the source files. The files are processed and saved to
build/source/resources/
but I don't know how to make it so the ProcessReaources task use as input said folder instead of the
src/main/resources
folder
v
You should probably use
filter
or
expand
instead.
c
yes, exactly. As ProcessResources is a Copy task, using a CopySpec, you can use filter or expand to adjust files as they are copied.
f
So there is no way like AbstractCompile to set the source directory? And if I were to use the filter method, how could I do it? (Sorry but I'm new into the gradle plugin api xD)
c
no need to change the source directory. if the goal is solely to replace tokens, that can be done as processResources is copying files. Review the expand/filter options on
CopySpec
for details on that.
f
Ok, I'll check it out and share my findings when I'm done ;)
Thanks :)
Ok, since the base (using the custom source dir) was already written (for other compile tasks such as kotlin, java, etc) I needed to use the custom source directory. I first included using
ProcessResources#from(Project#files(File))
I’ve added the custom source dir, and then using
ProcessResources#eachFile
I’ve filtered and excluded the files that were not included in the custom source dir (since the tokens are replaced on every resource) It may not be the best approach, but it works :p
👌 1