Commit Graph

24 Commits

Author SHA1 Message Date
Rudi Grinberg 530dbfeb81 Move String_set to stdune 2018-04-23 12:08:09 +07:00
Rudi Grinberg 9414913286 Add test to make sure that ${null} isn't a target 2018-04-17 10:58:53 +07:00
Jérémie Dimino b029d32dfb
fix String_with_vars.sexp_of_t (#595) 2018-03-07 15:01:46 +00:00
Jérémie Dimino 3fd3eb8a12
Split src/import.ml into a new library src/stdune (#548)
- 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
2018-02-25 16:35:25 +00:00
Christophe Troestler 453ce1eb56 String_with_vars: Use a functor to create generic expansion fun
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.
2018-02-15 00:43:08 +01:00
Christophe Troestler a91cf637ae Trigger an error for unquoted concatenations with list variables
Thus x${v} where v is a variable that returns several values must
necessarily be quoted: "x${v}".
2018-02-15 00:43:08 +01:00
Christophe Troestler 754aa59cc3 String_with_vars: Distinguish quoted and unquoted strings
This implies that an atom can only contain a single variable, such as
${@}, and not something like xxx${@}xxx.  The internal representation
was changed not to be able to represent the latter.
2018-02-15 00:43:08 +01:00
Christophe Troestler c27cb3541e Let the parser distinguish quoted strings
Fixes https://github.com/ocaml/dune/issues/408
2018-02-15 00:43:08 +01:00
Christophe Troestler e8e3698e15 String_with_vars: represent quoted vars differently from unquoted ones
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.
2018-02-15 00:43:08 +01:00
Christophe Troestler 3e2dc2517d Document the interface of String_with_vars 2018-02-15 00:43:08 +01:00
Jeremie Dimino 06ab34981c Capture locations of string-with-vars generated inside jbuilder 2017-06-08 10:54:46 +01:00
Jeremie Dimino 5307a92ddc Do not allow (chdir ...) with dynamic directories
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.
2017-06-08 10:03:11 +01:00
Jeremie Dimino 373e6c2524 Allow ${...:...} for in (do ...) and add more checks
Check that targets written by the user are a superset of inferred
targets.
2017-05-31 10:15:32 +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 4130bc2f63 Add support for ${version:<package>} 2017-05-05 12:26:56 +01: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 cd359538b0 simplify 2017-03-03 08:47:58 +00:00
Jérémie Dimino c6b2169037 Refactor S-expression parsing 2017-02-25 18:03:56 +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 11c61b3234 114.20+69 2016-12-23 15:32:23 +00:00
Jeremie Dimino cdcd7e907f 114.20+69 2016-12-02 13:54:32 +00:00