Skip to content
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

Add promote actions and include stanzas #402

Merged
4 commits merged into from
Jan 15, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update doc
Jeremie Dimino committed Jan 15, 2018
commit e35ddf5e7a6b3b2a2dc6a764ed992497314916fb
8 changes: 7 additions & 1 deletion doc/jbuild.rst
Original file line number Diff line number Diff line change
@@ -1140,7 +1140,8 @@ is global to all build contexts, simply use an absolute filename:
Promotion
---------

The ``(promote (<file1> as <file2>) (<file3> as <file4>) ...)`` action
The ``(promote (<file1> as <file2>) (<file3> as <file4>) ...)`` and
``(promote-if (<file1> as <file2>) (<file3> as <file4>) ...)`` actions
can be used to copy generated files to the source tree.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't promote-if also be mentioned here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed

This method is used when one wants to commit a generated file that is
@@ -1150,6 +1151,8 @@ be used to:
- cut dependencies and/or speed up the build in release mode: we use
the file in the source tree rather than re-generate it
- support bootstrap cycles
- simplify the review when the generated code is easier to review than
the generator

How jbuilder interprets promotions can be controlled using the
``--promote`` command line argument. The following behaviors are
@@ -1162,6 +1165,9 @@ available:
- ``--promote copy``: when the two files are different, jbuilder
prints a diff and copies ``<a>`` to ``<b>`` directly in the source tree

Note that ``-p/--for-release-of-packages`` implies ``--promote
ignore``.

OCaml syntax
============