So I have a lot of resources divided in directories that I have placed under my_pod/res.
My build.fan file references
resDirs = [`res/`]
I have noticed that only the files in res/ get build into the pod, and that the subdirectories are not included.
I know I can programmatically build resDirs to include all the directories, but I was curious to know about this behaviour, why do subdirectories under res/ get ignored?
Thanks!
brianSat 5 Jun 2010
All the build script configuration fields take lists of URIs, but do not automatically recurse. Not any specific reason really - just the way it got coded up. Although I do like the ability see all the dirs in my build script and ability to comment out a specific directory (even if its a bit more verbose).
andyMon 7 Jun 2010
Works the same way for srcDirs - and I think that consistency is correct. And that model is certainly valuable for commenting out source easily. So while inconvenient for resources, I still think this design makes the most sense. But I'm open to change if others feel differently.
liamstaskMon 7 Jun 2010
Maybe an optional syntax to explicitly specify recursion?
resDirs = [`res/**`]
or something?
dfreireMon 7 Jun 2010
Yeah, but then we enter the domain of include and exclude filters, regex, etc.
Things are simple as they are, and this is not that big deal, I was just asking out of curiosity :-)
If there's enough demand, maybe a set of helper functions on the parent BuildPod, could fill up resDirs (and others) according to a concrete pod-level defined criteria.
brianMon 7 Jun 2010
Also remember that build files are executable scripts, so you can just run a glob in your constructor to compute the value of the resDirs field. That is the really cool thing about Fantom build files - they aren't just "dumb XML" files :-)
dfreire Fri 4 Jun 2010
So I have a lot of resources divided in directories that I have placed under my_pod/res.
My build.fan file references
I have noticed that only the files in res/ get build into the pod, and that the subdirectories are not included.
I know I can programmatically build resDirs to include all the directories, but I was curious to know about this behaviour, why do subdirectories under res/ get ignored?
Thanks!
brian Sat 5 Jun 2010
All the build script configuration fields take lists of URIs, but do not automatically recurse. Not any specific reason really - just the way it got coded up. Although I do like the ability see all the dirs in my build script and ability to comment out a specific directory (even if its a bit more verbose).
andy Mon 7 Jun 2010
Works the same way for
srcDirs
- and I think that consistency is correct. And that model is certainly valuable for commenting out source easily. So while inconvenient for resources, I still think this design makes the most sense. But I'm open to change if others feel differently.liamstask Mon 7 Jun 2010
Maybe an optional syntax to explicitly specify recursion?
or something?
dfreire Mon 7 Jun 2010
Yeah, but then we enter the domain of include and exclude filters, regex, etc.
Things are simple as they are, and this is not that big deal, I was just asking out of curiosity :-)
If there's enough demand, maybe a set of helper functions on the parent BuildPod, could fill up resDirs (and others) according to a concrete pod-level defined criteria.
brian Mon 7 Jun 2010
Also remember that build files are executable scripts, so you can just run a glob in your constructor to compute the value of the resDirs field. That is the really cool thing about Fantom build files - they aren't just "dumb XML" files :-)