Commit Graph

48 Commits

Author SHA1 Message Date
Jérémie Dimino af5d7f5e6f
Report better errors for globs pointing to non-existing directories (#413)
Fix #412
2018-01-15 13:28:32 +00:00
Spiros Eliopoulos 7383b0b006 docs: add some docstrings in various places (#252)
* docs: update some documentation in the Build module

* docs: document what [Scope.resolve] does

* docs: add a toplevel docstring to the Alias module

* docs: document (or not) the bootstrap function

* docs: lightly document the bootstrap module

* fix ignore comment
2017-11-09 20:41:52 +08:00
Rudi Grinberg a57c488dd7
Fix jbuilder rule in case of missing binaries (#292)
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
2017-11-07 21:42:55 +08:00
François Bobot cecf0a2aaf Add (copy_files <glob>) stanza (#35)
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.
2017-09-10 02:31:07 +01:00
Jeremie Dimino 297e82061e Update_file --> Write_file
The difference is not meaningful anymore. Also expose Write_file as
write-file.
2017-08-17 15:13:11 +01:00
David Allsopp be4b5fa454 Extend (:include ) form to library_flags
library_flags already included variable expansion.
2017-08-03 17:28:32 +01:00
Jeremie Dimino b74544919a jbuild_types.ml --> jbuild.ml 2017-06-02 14:32:05 +01:00
Jeremie Dimino 4e7cb253e1 Add support for reading files from actions
- ${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
2017-05-30 17:02:45 +01:00
Jeremie Dimino 116769724f Allow to use ${^} in actions in conjunction with (glob_files ...) and (file_recursively_in ...) 2017-05-29 18:53:54 +01:00
Jeremie Dimino 1d3341ed28 Add a (mkdir ...) action 2017-05-29 14:51:46 +01:00
Jérémie Dimino 73a4cef9f8 Move the context out of Action.t
And add it to the rule. It is never dynamic, so it is simpler this
way, we just set it in Super_context.add_rule.
2017-05-29 07:51:52 +01:00
Jeremie Dimino 500f224098 Delete old odoc artifacts before running odoc 2017-05-26 18:34:49 +01:00
Jeremie Dimino 37d7131a11 Simplify hack for not deleting odoc files 2017-05-26 18:34:49 +01:00
Jeremie Dimino 0a1f4f5658 Replace Build.and_... by Build.progn 2017-05-26 18:34:49 +01:00
Jeremie Dimino f2a857f406 Fix Super_context.expand_and_eval_set
It declared its own dependencies as action dependencies rather than
rule dependencies
2017-05-16 12:19:18 +01:00
Jeremie Dimino 9a5bb0ca1f Compute dynamic dependencies correctly for memoized arrows 2017-05-15 15:09:56 +01:00
Jeremie Dimino 648b2b2990 Revert some changes:
- Make targets explicit b7ad08df84.
- Get rid of Vfile      e73fd90b65.

Without vfile we need some new concepts to avoid parsing the requires
file multiple times and with vfile it's annoying to specify the
dependencies by hand.

Will leave that for future work. Just use memoize where it make sense,
for instance when we read the result from only the current directory
(for instance the ocamldep stuff).
2017-05-15 14:58:37 +01:00
Jérémie Dimino b7ad08df84 Make targets explicit 2017-05-15 09:37:46 +01:00
Jérémie Dimino e73fd90b65 Get rid of Vfile
replace it by just memoize
2017-05-15 09:37:46 +01:00
Jérémie Dimino f5192122f8 add Build.memoize 2017-05-15 09:37:46 +01:00
Jeremie Dimino 87c958f2e0 Add Build.if_file_exists 2017-05-15 09:37:46 +01:00
Jeremie Dimino 4130bc2f63 Add support for ${version:<package>} 2017-05-05 12:26:56 +01:00
Jeremie Dimino 411d1a2f2c Refactoring
- add Super_context.resolve_program and use it everywhere.
- add src/js_of_ocaml.mli
2017-05-02 12:01:27 +01:00
Jeremie Dimino 32c20cc561 Move var expansions to Super_context 2017-04-28 13:53:44 +01:00
Jeremie Dimino c7add98ea6 Add a new Super_context module
Moved most of the global values computed at the beginning of
Gen_rules.Gen to Super_context.t. This will allow to split
gen_rules.ml into multiple files.
2017-04-28 11:58:41 +01:00
Jeremie Dimino 07871b1190 Add support for ${lib-available:<name>} forms 2017-04-17 12:48:54 +01:00
Jeremie Dimino e7b543e7cb Don't scan the tree a second time for files_recursively_in 2017-03-15 09:10:22 +00:00
Jeremie Dimino cac1dc0e3e fixes 2017-03-06 15:14:57 +00:00
Jeremie Dimino 7850bf67f5 Write_file --> Update_file 2017-03-06 14:34:53 +00:00
Jeremie Dimino a26b787456 Fix expansion of user actions 2017-03-06 12:22:44 +00:00
Jérémie Dimino 0b7d664f49 Don't recompile everything when the .merlin changes 2017-03-05 20:58:51 +00:00
Jérémie Dimino ca4b6fbf41 All IO must go through Build 2017-03-05 12:04:19 +00:00
Jeremie Dimino e300ca0f16 Simplify actions
Make Bash a normal action
2017-03-03 12:59:52 +00:00
Jeremie Dimino adf423a595 Change the rule signature
Now rules are arrows of type: (unit, Action.t) Build.t

They don't execute command directly, but instead build a serializable
action to execute.
2017-03-03 12:27:34 +00:00
Jeremie Dimino 2967987356 add a few more actions 2017-03-03 09:18:03 +00:00
Jeremie Dimino 987d437a99 Revert name change 2017-03-03 08:57:20 +00:00
Jeremie Dimino cd359538b0 simplify 2017-03-03 08:47:58 +00:00
Jeremie Dimino 304e4d9a7a prepare for change 2017-03-03 08:18:10 +00:00
Jeremie Dimino 6e25a7dfe5 Remove (provides ...) and uses (install ...) instead 2017-03-01 11:20:17 +00:00
Jérémie Dimino 157ecaab60 Resolve path properly in actions 2017-02-28 23:23:51 +00:00
Jeremie Dimino df866a5840 Refactor actions 2017-02-27 13:34:16 +00:00
Jérémie Dimino 27a299437d 4.02.3 compatiblity 2017-02-26 21:28:30 +00:00
Thomas Refis f00fd49f0b 114.33+05 2017-02-21 17:13:30 +00:00
Jeremie Dimino 193f8d5238 moved cmdliner and re to vendor/ 2017-02-21 15:09:58 +00:00
Rudi Grinberg 428c0b5368 Implement (alias ...) stanzas (#7) 2017-02-21 14:52:26 +00:00
Jeremie Dimino 5f239a349f 114.29+19 2017-01-25 15:41:22 +00:00
Jeremie Dimino e054ce4d71 114.20+69 2016-12-15 13:00:30 +00:00
Jeremie Dimino 2357fa0799 114.20+69 2016-12-15 11:20:46 +00:00