Rudi Grinberg
1a37977f62
Fix error message
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-08 16:33:18 +07:00
Rudi Grinberg
90cde684e6
Remove uppercase vars in dune files
...
While maintaing them in jbuild files (with proper error messages)
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-08 16:33:18 +07:00
Jérémie Dimino
3348b6a913
Adapt the behavior of dune subst for dune projects ( #960 )
...
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-08 09:51:16 +01:00
Rudi Grinberg
b8f11b1f04
Make variable rename errors more consistent
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-06 18:48:30 +07:00
Rudi Grinberg
c4545fce18
Get rid of indexed lookups for deps
...
Have %{first-dep} to replace %{<}
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-06 18:46:10 +07:00
Rudi Grinberg
ca342fd840
Fix inverted conditionals for version check
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-06 18:46:09 +07:00
Rudi Grinberg
204b21f4fb
Rename %{<} to %{deps[0]} and implement %{deps[i]}
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-06 18:46:09 +07:00
Rudi Grinberg
97fba5537d
Write lexer to parse %{deps[i]}
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-06 18:46:09 +07:00
Rudi Grinberg
0195b4bd03
Add some helpers to impldement %{deps[i]}
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-06 18:46:09 +07:00
Rudi Grinberg
13c12e9def
Rename %{^} to %{deps}
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-06 18:45:43 +07:00
Rudi Grinberg
a317fb0606
Rename %{@} to %{targets}
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-06 18:45:43 +07:00
Rudi Grinberg
c290ad288f
Rename scope_root to project_root
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-06 18:45:43 +07:00
Rudi Grinberg
7707872e54
Test Stanza Proposal ( #822 )
...
Add tests and test stanza
These stanzas are used to easily define tests. If a test has a corresponding .expect file, it will be immediately considered as an expect test.
2018-07-06 18:43:31 +07:00
Rudi Grinberg
a8bd8ffa44
Rename JBUILDER_GEN to DUNE_GEN
...
Technically, we still support JBUILDER_GEN
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-06 15:10:13 +07:00
Etienne Millon
35ff6466de
Remove path-no-dep syntax
...
See #944
Signed-off-by: Etienne Millon <etienne@cryptosense.com>
2018-07-04 10:39:57 +02:00
Etienne Millon
628914fe28
Rename path to dep in dune files
...
See #842
Signed-off-by: Etienne Millon <etienne@cryptosense.com>
2018-07-03 15:59:52 +02:00
Rudi Grinberg
63eb0f2312
Merge branch 'master' into subsystem-versioned
2018-07-03 18:59:02 +07:00
Jérémie Dimino
e6a5ef9508
Add the lib_root and libexec_root install sections ( #947 )
...
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-03 10:49:18 +01:00
Rudi Grinberg
7a91a2b23b
Merge branch 'master' into subsystem-versioned
2018-07-03 16:49:05 +07:00
Rudi Grinberg
e09695e116
Relax versions for subsystems
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 16:36:11 +07:00
Rudi Grinberg
8e09749f12
Add missing words to syntax error message
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 16:12:01 +07:00
Rudi Grinberg
aee019577b
Change fallback check to use ?check param
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 16:12:01 +07:00
Rudi Grinberg
dee6c9aa96
Disable fallback in dune files
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 16:12:01 +07:00
Jérémie Dimino
e56fba9a57
Do not use opam-installer to copy files ( #941 )
...
Instead of calling opam-installer, manually parse .install files and copy the files.
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-03 10:10:09 +01:00
Jeremie Dimino
6589464f21
Rewrite lexing of installed dune files
...
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-03 09:22:57 +01:00
Rudi Grinberg
04ee6b0b2d
Set M.syntax when reading subsystems generated by dune
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 01:01:06 +07:00
Rudi Grinberg
044c78281d
Use parsing context when parsing name, version, raw triple of sub systems
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 01:01:06 +07:00
Rudi Grinberg
0051aeca29
Do not read .dune files twice
...
Reuse the same lexer by pushing back some tokens manually
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 01:01:06 +07:00
Rudi Grinberg
4af1f189f0
Using Syntax.Verison.t to decide how to generate sub system files
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 01:01:06 +07:00
Rudi Grinberg
22cf958b0c
Add dune_version field for libraries
...
This field is necessary to know how to generate .dune files for a particular
library.
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 01:01:06 +07:00
Rudi Grinberg
9005ca8998
Simplify error handling
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 01:01:06 +07:00
Rudi Grinberg
01163776ad
s/Dune/lang/
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 01:01:06 +07:00
Rudi Grinberg
f6fe5d20bb
Generate dune file version correctly
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 01:01:06 +07:00
Rudi Grinberg
9c0daa24de
Don't hard code parsing_context for sub systems
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 01:01:06 +07:00
Rudi Grinberg
ba9335badf
Simplify dump_config with Option.map
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 01:01:06 +07:00
Rudi Grinberg
7b12e12571
Share loc variable
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 01:01:06 +07:00
Rudi Grinberg
bedad1f689
Set version when parsing dune files
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 01:01:06 +07:00
Rudi Grinberg
8390af90e4
Simplify versioning matching
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 01:01:06 +07:00
Rudi Grinberg
a4bc260241
Loc.of_lexbuf
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 01:01:06 +07:00
Rudi Grinberg
c906801c69
Parse dune files in a versioned way.
...
We read the first 3 tokens of a dune file and use it recognize if the file was
generated using jbuilder or dune
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 01:01:06 +07:00
Rudi Grinberg
179d23ee38
Expose the type of tokens and lexers
...
This will be necessary for some manual parsing
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 01:01:06 +07:00
Rudi Grinberg
67edb7f89e
Move make_loc to Loc module and rename it to of_lexbuf
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 01:01:06 +07:00
Jérémie Dimino
438fef915f
Forbid #require in dune files in OCaml syntax ( #938 )
...
And add run_and_read_lines to replace old use cases of Unix.open_process_in
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-02 08:17:53 +01:00
Rudi Grinberg
f163f6197a
Merge branch 'master' into rename-build-profile
2018-07-02 13:45:00 +07:00
Rudi Grinberg
d19e55bd4d
Rename %{build_profile} to %{profile}
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-02 12:52:48 +07:00
Jeremie Dimino
fc9f3357ab
Allow some part of a Build.t to be lazy
...
This is useful for (alias_rec ...) since at definition site we recurse
through all sub-directories. This is especially relevant now that we
have the default alias which defaults to (alias_rec install).
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-01 21:50:44 +01:00
Jeremie Dimino
81bcd0f3e1
Add a "default" alias defined as follow:
...
- if "default" is specified by the user explicitely, use this
definition
- otherwise assume the following definition:
(alias
(name default)
(deps (alias_rec install)))
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-01 21:50:44 +01:00
Jeremie Dimino
0a970aba35
Improve error message for undefined aliases
...
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-01 21:50:44 +01:00
Jeremie Dimino
30db63ef71
Support @@alias to build an alias non-recursively
...
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-01 21:50:44 +01:00
Jeremie Dimino
79f3506922
Add String_with_vars.text_only
...
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-01 21:36:26 +01:00