Loose files with path manipulation applied.
Allows you to relocate the files at runtime to something more convenient than their actual paths in your project.
For example, you can relocate
src/resources/project1/data.json to instead be
resources/data.json. Your other target types can then add this target to their
dependencies field, rather than using the original
To remove a prefix:
# Results in `data.json`. relocated_files( files_targets=["src/resources/project1:target"], src="src/resources/project1", dest="", )
To add a prefix:
# Results in `images/logo.svg`. relocated_files( files_targets=["//:logo"], src="", dest="images", )
To replace a prefix:
# Results in `new_prefix/project1/data.json`. relocated_files( files_targets=["src/resources/project1:target"], src="src/resources", dest="new_prefix", )
str | None
A human-readable description of the target.
./pants list --documented :: to see all targets with descriptions.
The new prefix that you want to add to the beginning of the path, such as
You can set this field to the empty string to avoid adding any new values to the path; the value in the
src field will then be stripped, rather than replaced.
Addresses to the original
files targets that you want to relocate, such as
Every target will be relocated using the same mapping. This means that every target must include the value from the
src field in their original path.
The original prefix that you want to replace, such as
You can set this field to the empty string to preserve the original path; the value in the
dest field will then be added to the beginning of this original path.
Iterable[str] | None
Arbitrary strings to describe a target.
For example, you may tag some test targets with 'integration_test' so that you could run
./pants --tag='integration_test' test :: to only run on targets with that tag.
Updated 11 months ago