So this construct here: <https://github.com/pantsb...
# plugins
b
So this construct here: https://github.com/pantsbuild/pants/blob/main/src/python/pants/core/goals/tailor.py#L146 This would imply that I can only tailor new Targets iff the
source
or
sources
field of the Target has a default value. Otherwise I can’t. Thus, if my putative sources are Treefiles, which are random YAML or JSON files and can happily be stored next to each other in the same directory and don’t have a defined name per se, I can’t actually work with the
tailor
goal because I can’t know in advance what the filename might be.
w
You can find them out at
tailor
time, by, for example - file extension
It can get dicey if they're super generic, not language specific - but maybe there is a way to cue off of something else to know that you want them under this source specifically. Or maybe for those files, a
files
or
resources
would suffice
b
That forces an indirection via another Target though.
You can get around it by not using
PutativeTarget.for_target_type
but…