- make sure type t always come first
- Map.map, Map.fold, ... never pass the key to the callback while Map.mapi, Map.foldi, ... do
- removed the ~key and ~data labels, I find them useless and annoying
- Set.elements --> Set.to_list
- Map.bindings --> Map.to_list
- Map.of_alist --> Map.of_list
- added Ordering.t for comparison functions
- renamed Inl/Inr to Left/Right. The latter seems clearer
- moved List.longest to String.longest
- added a Pp module with a nicer API than Format
This required to remove the labeled ~dir arguments in Action because
one would have had to use the same label for the expansion context in
String_with_vars, which would have been odd for generic expansion
functions.
Define the representation for quoted variables, adapt the test of
strings made of a single variable, and add a constructor.
[String_with_vars.t] is not yet able to use that representation
because the necessary information is not available from the parser.
Before, jbuilder used to stop its execution after an error was
encountered. Now it continues until all branches have been explored.
To implement this feature, Future was rewritten as a Fiber module with
a simpler semantic.
This patch contains various other refactorings.
The legacy DOS readonly attribute is a tedious difference on Windows,
because a user may have permission to delete a file, but unlink fails
because the attribute is set.
Signed-off-by: David Allsopp <david.allsopp@metastack.com>
* Change jbuilder to load rules lazily
Rules are now loaded on a per directory basis as needed. This speed up
the start up time on large workspaces.
Does various refactoring as well.
* Simplify the handling of META files
We no longer generate a META.foo.from-jbuilder file. Nobody is using
this feature and it's making the new code more complicated.
* Accept correction files produced by ppx_driver so that [@@deriving_inline] works
* Change promote-if so that it doesn't promote the file when the source file doesn't exist in the source tree
* Let variables say whether they are Concat or Split
To concatenate the contents of a split variable, put it in a string:
"${var} ".
Fixes#300
See also https://github.com/janestreet/jbuilder/issues/408
* Issue a deprecation warning for ${!...}
* Treat ${CC}, ${<}, ${^} and ${read-lines:...} as split vars
* Change ${!^} into ${^} for this project jbuild rules
In a host/target setup, all binaries that are built (including preprocessors)
are ran using the host *for* building targets. Final target artifacts are
compiled using the target toolchain
Make jbuilder rules work even when binaries are missing
* Proper error messages for missing binaries
* Unify Prog_spec and Maybe_prog
both can simply be unified into a path type that has a hint for the error
* Remove scarcely useful in_the_tree parameter
It's always true except for the C compiler. In which case, there's no harm in
making it true.
* Make Artifacts return Action.Prog
The old return value was simply converted to this anyway. It's simpler to just
return the proper error straight up.
* Remove remains of in_the_tree
Add (copy_files <glob>) and (copy_files# <glob>) stanzas. These
stanzas setup rules for copying files from a sub-directory to the
current directory.
This provides a reasonable way to support multi-directory
library/executables in jbuilder.
For instance (chdir ${read:foo} ...) is not allowed. This doesn't seem
really useful since we couldn't express the targets anyway and
supporting it complicate the code.
- ${read:<filename>} -> expand to the contents of the file
- ${read-lines:<filename>} -> expand to the list of lines in the file
- ${read-strings:<filename> -> expand to the list of lines in the file,
unescaped using OCaml escaping rules
Generalize ${!...} form