Commit Graph

395 Commits

Author SHA1 Message Date
Rudi Grinberg ccabeb7181 Hack to fix printing of errors
This is a temporary hack until we have a real sexp type

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-08 17:25:26 +07:00
Rudi Grinberg a24b55ed81 Add error for %{read:x} in wrong place
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-08 17:18:38 +07:00
Rudi Grinberg 7cb068d1eb Improve error messages for all forms
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-08 16:33:18 +07:00
Rudi Grinberg 813b8d9dbc Use correct syntax for error
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-08 16:33:18 +07:00
Rudi Grinberg 1b918ecc74 Improve error message for renamed forms
Don't include the payload in these messages

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-08 16:33:18 +07:00
Rudi Grinberg c244fa9d08 Share error messages for renamed/since/deleted etc.
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-08 16:33:18 +07:00
Rudi Grinberg 3f7ad78512 Replace more code with the variable system
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-08 16:33:18 +07:00
Rudi Grinberg 9811031899 Implement a more elaborate variable expansion mechanism
That embeds changes across versions

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-08 16:33:18 +07:00
Rudi Grinberg 54ff98b36d Rename ROOT to root
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-08 16:33:18 +07:00
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 998ff8ce8c Clarify rename test
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-08 16:33:18 +07:00
Rudi Grinberg f2f0d240c4 Add tests for lower/uppercase vars
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
Etienne Millon 2c29217a20 Add a test case for project_root
Signed-off-by: Etienne Millon <etienne@cryptosense.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 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
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 7a91a2b23b
Merge branch 'master' into subsystem-versioned 2018-07-03 16:49:05 +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 8b5e1a9a13 Add tests for fallback
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 16:12:01 +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 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
Rudi Grinberg d53179a56e Make install tests less verbose (#936)
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-01 22:08:13 +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
Rudi Grinberg 60c97ab365 disable opam workspace blackbox test
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-01 01:46:32 +07:00
Rudi Grinberg d229b7811b Cleanup test by creating dune-project file
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-01 01:46:32 +07:00
Rudi Grinberg aa981b3206 Fix error message when workspace file doesn't exist
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-01 01:46:32 +07:00
Rudi Grinberg 2b307bfe99 Use Option.some_if when checking for workspace file
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-01 01:46:32 +07:00
Rudi Grinberg 5cbf391a04 Add a test suite for workspaces
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-01 01:46:32 +07:00
Rudi Grinberg d7796156fd Use Sexp.Loc.none rather than reinventing in test
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-01 00:34:45 +07:00
Nathan Rebours 23717d1fd6 Drop findlib:x syntax in dune and display an error (#887)
Signed-off-by: Nathan Rebours <nathan@cryptosense.com>
2018-06-29 21:35:41 +01:00
Jérémie Dimino 7e79e2870d
Make the set language more future proof (#930)
- forbid list starting by an atom not starting with - or :
- allow to avoid the toplevel parentheses in dune files

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-29 21:11:47 +01:00
Jérémie Dimino e886e948b7
Add a test where an action modify one of its dependency (#923)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-29 12:44:51 +01:00
Jeremie Dimino 2982567639 Make the default build profile be dev
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-28 11:23:10 +01:00
Jeremie Dimino 16d34f4a07 Add Which_program to know whether we are dune or jbuilder
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-28 11:23:10 +01:00
Jérémie Dimino 9585c8f79d
Move ocamldep output files to the object directory (#918)
- this avoid the need for the "already_used" business
- this will make it easier to support multi-dir libraries without copy_files

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-28 09:46:20 +01:00
Rudi Grinberg ec14661a01 Update tests for new variables syntax
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-28 09:48:35 +06:30
Rudi Grinberg 2257a2057b Add templates to Usexp.t directly
Templates are now directly in dune's sexp language. The syntax is change to %{}
from ${} and $(). Old templates are still supported in jbuild files.

Other changes in this PR:

* Removal of ! patterns in variables
* Strict expansion for templates in dune files. Missing vars are now an error
* Using the correct syntax to parse included files in dune
* Improvements to the tests
* Syntax aware pretty printing of sexps. Now you must pass Dune vs. Jbuild to
  print sexps

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-28 09:46:10 +06:30
Jérémie Dimino 0f68e56f64
Remove most useless parentheses from the syntax (#915) 2018-06-27 16:38:05 +01:00
Jérémie Dimino 90cdae96b2
Add a script to help making bulk updates of the tests (#914)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-27 12:21:41 +01:00
Jeremie Dimino f46a6aae53 Make (diff ...) work on Windows
- make (diff ...) trailing cr on Win32
- add a (cmp ...) action for comparing binary files
- add a test and run it in AppVeyor

Fix #844

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-25 08:14:27 +01:00
Jérémie Dimino 0eb302252e
Improve the syntax of ppx rewriters and flags (#910)
- old syntax: (pps (ppx1 -arg1 ppx2 (-foo x)))
- new syntax: (pps ppx1 -arg ppx2 -- -foo x)

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-25 07:56:35 +01:00
Jeremie Dimino 58997d9df7 Present menhir as an extension
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-20 16:06:38 +01:00