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

Expose the promote mode #437

Merged
3 commits merged into from
Jan 25, 2018
Merged

Expose the promote mode #437

3 commits merged into from
Jan 25, 2018

Conversation

ghost
Copy link

@ghost ghost commented Jan 22, 2018

This PR exposes the promote mode that was internally implemented in #370.

(mode ...) field

This PR adds a (mode <mode>) field to rule and menhir stanzas. The following modes are allowed:

  • standard, the default
  • fallback, replaces (fallback)
  • promote, after the rule has been executed copy the targets to the source tree
  • promote-until-clean, same as promote except that jbuilder clean delete the files copied to the source tree

ocamlyacc and ocamllex extensions

To allow using a different mode with ocamlyacc and ocamllex stanzas, an alternative syntax is added:

(ocamlyacc ((modules (<modules>)) (mode <mode)))
(ocamllex ((modules (<modules>)) (mode <mode)))

--ignore-promoted-rules argument

The --ignore-promoted-rules argument is added to make jbuilder filter out rules with (mode promote). It is automatically set by -p/--for-release-of-packages, to cut down dependencies during releases.

CHANGES.md Outdated
+ `(mode fallback)` replaces `(fallback)`
+ `(mode promote)` means that targets are copied to the source tree
after the rule has completed
+ `(mode promote-until-clea)` is the same as `(mode promote)` except
Copy link
Member

Choose a reason for hiding this comment

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

clea -> clean

Copy link
Author

Choose a reason for hiding this comment

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

indeed, thanks

| true, Some _ ->
Error "Cannot use both (fallback) and (mode ...) at the same time.\n\
(fallback) is the same as (mode fallback), \
please use the latter in new code."
Copy link
Member

Choose a reason for hiding this comment

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

Will (fallback) be removed in 1.0?

Copy link
Author

Choose a reason for hiding this comment

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

yes, we'll get the upgrade tool to translate it to (mode fallback)

@ghost ghost merged commit 437211f into master Jan 25, 2018
@ghost ghost deleted the promote branch February 7, 2018 14:48
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants