-
-
Notifications
You must be signed in to change notification settings - Fork 636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: there may be multiple BUILD files in a directory #20818
docs: there may be multiple BUILD files in a directory #20818
Conversation
f5d6710
to
a1d61a4
Compare
may want to use as part of your builds. However, you can have multiple BUILD files in a single directory. | ||
When running a Pants goal, the contents of the BUILD files will be merged making it possible to better group your | ||
targets, if desired. For instance, you could store source code targets and | ||
[macros](../../writing-plugins/macros.mdx) in different files to have better separation of concerns: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For instance, you could store source code targets and
macros in different files to have better separation of concerns
The example seems to show having different targets in the files, which works fine, but the above text talks about macros, and that will not work. The files are not merged before parsing, so if you decalare a def my_macro(): ...
in one, you can't call it from the other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is, they're parsed, and processed, individually, they will just share "namespace" for their respective targets, so they show up together..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Andreas! Perhaps bringing macros into this wasn't worth it. I've updated the docs to use files and code targets; this should keep things simple.
a1d61a4
to
00daf2b
Compare
Thanks for improving the documentation! I think that we should be careful with how we phrase this: I think that for most users, having everything in one A couple of questions:
|
I agree with ☝🏽
See this thread: https://chat.pantsbuild.org/t/16949338/is-there-a-way-to-exclude-an-arbitrary-build-target-at-runti#45196675-a2bb-4472-a837-e4de911f6898
|
I use this in the StackStorm repo to separate tool resolve requirements from the primary code requirements targets: |
00daf2b
to
1aa56e3
Compare
I am sorry for the late reply.
Yes, I do. We have some targets that I only want to become available at CI builds as there is some code generation done before Pants runs.
Definitely, I've updated the docs.
I've added a sentence at the beginning of the paragraph to make it clearer. |
Docs rendered locally: