square-psychiatrist-19087
06/03/2024, 2:22 PMsquare-psychiatrist-19087
06/03/2024, 2:23 PMmy-project/
but not in another-project/
curved-television-6568
06/03/2024, 5:19 PMcurved-television-6568
06/03/2024, 5:20 PMsquare-psychiatrist-19087
06/03/2024, 5:21 PMassert str(build_file_dir()).startswith("my-project/")
square-psychiatrist-19087
06/03/2024, 5:22 PMcurved-television-6568
06/03/2024, 5:23 PMsquare-psychiatrist-19087
06/03/2024, 5:25 PMmy-project/BUILD
and then use them in my-project/sub1/BUILD
and my-project/sub2/BUILD
.
macro.py
files are not very convenient as you have to explicitly add them to your pants.tomlsquare-psychiatrist-19087
06/03/2024, 5:26 PMmy-project/macros.py
curved-television-6568
06/03/2024, 5:26 PMload("my-macros.py")
in the BUILD file.. but it's interesting to be able to "export" functions declared directly in the BUILD file for the sub tree to consume..square-psychiatrist-19087
06/03/2024, 5:27 PMcurved-television-6568
06/03/2024, 5:27 PMcurved-television-6568
06/03/2024, 5:27 PMcurved-television-6568
06/03/2024, 5:28 PMsquare-psychiatrist-19087
06/03/2024, 5:30 PMbuild_file_prelude_globs = ["**/macros.py"]
is good middleground, I'll try thatcurved-television-6568
06/03/2024, 5:31 PM