Commit Graph

1158 Commits

Author SHA1 Message Date
Jeremie Dimino b4dd6565b2 Add Ordered_set_lang.Unexpanded.fold_strings
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-01 21:36:26 +01: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 989a1c0058 don't use wildcard match where not necessary
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 db4aed42d6 Add %{build_profile} variable
Added for testing but could come in handy elsewhere

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-01 01:46:32 +07:00
Jeremie Dimino 80c2d61416 Factorize construction of default workspace configuration
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-01 01:46:32 +07:00
Jeremie Dimino 9ffa579dbf Restore rule about empty dune-workspace file
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-01 01:46:32 +07:00
Jeremie Dimino 757400a6a6 Fix error message about unsupported versions
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-01 01:46:32 +07:00
Jeremie Dimino 3d65c4e378 Version the user configuration file
- dune requires the (lang ...) line
- jbuilder accepts it but fallback to the jbuild syntax if it's not
  present

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-01 01:46:32 +07:00
Jeremie Dimino cdcc520430 Disable old syntax for opam contexts in dune-workspace files
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-01 01:46:32 +07:00
Jeremie Dimino d5ae6dede0 Make dune require a (lang ...) line in dune-workspace files
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-01 01:46:32 +07:00
Jeremie Dimino 7c6ecc821f Reimplement workspace.ml with the new parsing API
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-01 01:46:32 +07:00
Jeremie Dimino 19532a8c3d Generalizes handling of files starting with (lang LANG VER)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-01 01:46:32 +07:00
Jérémie Dimino 6823fb0d43 Restore eof_reached
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-01 01:46:32 +07:00
Jeremie Dimino d6c35e01df Split xxx-workspace file between jbuilder and dune
- jbuilder only looks for jbuild-workspace files
- dune only looks for dune-workspace files

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-01 01:45:02 +07:00
Jérémie Dimino e706421893 Add function to parse version header from sexp files
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-01 01:34:33 +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 793a0b7c17
Fix the build on 4.02 by emulating -no-keep-locs (#927)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-29 07:40:02 +01:00
Rudi Grinberg 8185337876
Merge branch 'master' into persistent-build-files 2018-06-29 11:07:22 +06:30
Rudi Grinberg 79224ff194 Add name to Vfile_kind functor
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-28 22:42:55 +06:30
Rudi Grinberg ef5a2144dd Add magic to to_out_string
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-28 22:40:00 +06:30
Jeremie Dimino 473dd9b440 Change the default build profile to dev during bootstrap
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-28 12:40:27 +01:00
Rudi Grinberg 3177404741 Remove extra module from Vfile_kind functor
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-28 18:02:50 +06:30
Rudi Grinberg 2071ac1072 Implement Vfile_kind in term of Persistent
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-28 18:01:06 +06:30
Rudi Grinberg aa22671b2f Remove Make_full from file_kind signature since it's unused
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-28 17:15:34 +06:30
Rudi Grinberg bc09b8fc81 Change Action.Promotion to use Utils.Persistent
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-28 17:15:34 +06:30
Rudi Grinberg 4738b6df89 Make promoted files a set
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-28 17:15:34 +06:30
Rudi Grinberg 2a80d034fa Use Util.Persistent to reimplemented promoted files store
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-28 17:15:34 +06:30
Jeremie Dimino af6f003d13 Refactor ordered_set_lang.ml
- use the new s-expression parsing API
- simplify the types and the parsing

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-28 11:26:42 +01:00
Jeremie Dimino f9f5503e81 Change the signature of Of_peek.peek
It is always used the same way: `peek raw`, and sometimes preceded by
a `eos`. Remove the old `peek` and add:

- `peek_exn` which is the same the old `peek raw`
- `peek` which returns `None` if the end of sequence is reached

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-28 11:26:42 +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
Jeremie Dimino daa4be3dd8 Add Stanza.file_kind
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-25 08:14:27 +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
Rudi Grinberg 467cecfccc Add sexp conversion to univeral maps
Very useful for debugging

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-21 23:06:39 +06:30
Rudi Grinberg f35d068836 Move Jbuild.syntax to Stanza module
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-21 12:54:27 +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
Jeremie Dimino 74c008ea62 Implement automatic edition of the dune-project file for extensions
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-20 16:06:38 +01:00
Rudi Grinberg c723150026
Merge branch 'master' into faster-bootstrap 2018-06-20 21:09:17 +06:30
Rudi Grinberg 9883c4450b Add jsoo boot file
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-20 20:36:04 +06:30
Rudi Grinberg 98f055dbed add menhir.boot.ml
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-20 20:32:57 +06:30
Rudi Grinberg 8597f599d0 Add inline_tests.boot file
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-20 20:31:52 +06:30
Rudi Grinberg 5a46dc1998 Add jbuild_lexer.boot to speed up bootstrap
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-20 20:21:40 +06:30
Rudi Grinberg 15ffc107ff Add mli's to {dune,jbuild}_lexer
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-20 20:21:23 +06:30