Commit Graph

190 Commits

Author SHA1 Message Date
Pavel Senchanka 7ecd664785 Fix #1234 and extend watch to DELETE event (#1235)
Signed-off-by: Pavel Senchanka <pavel.senchanka@gmail.com>
2018-09-06 18:47:54 +01:00
Pavel Senchanka 8f2a4c0741 Added a simple version of a polling loop. (#1140)
`dune build -w` keeps running and automatically rebuilds the project
when changes are detected.

Note that on platforms other than Linux, you need to have `fswatch`
installed for watch mode to work.

Signed-off-by: Pavel Senchanka <pavel.senchanka@gmail.com>
2018-09-05 10:53:21 +01:00
Etienne Millon 74db582b04 Add (env var) dependencies
Signed-off-by: Etienne Millon <me@emillon.org>
2018-09-05 09:32:54 +02:00
Jérémie Dimino 5cad714100
Promote a subset of the files + emacs integration (#1192)
- add support for promoting a selected list of files
- add an emacs mode with helpers for promoting the correction for the current buffer

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-08-31 11:12:49 +01:00
Rudi Grinberg 6b55c21373 Remove an overly eager lib name to string conversion
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-28 13:30:40 +03:00
Rudi Grinberg 071c2377de Introduce Lib_name.t and Lib_name.Local.t types
These types help distinguish external and internal library names

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-28 13:30:40 +03:00
Rudi Grinberg 2cfd38c199 Introduce String.{take,drop,split_n}
This simplifies quite a lot of code

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-26 14:33:47 +03:00
Rudi Grinberg 463ee3653a Invert the stdune and dsexp dependency
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-23 11:58:10 +03:00
Rudi Grinberg bc9e8dba1c Rename sexp_of_t to dgen and t to dsexp where appropriate
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-23 11:58:10 +03:00
Etienne Millon 6fe9ec68c0 Improve error message for `dune utop`
Closes #1149

Signed-off-by: Etienne Millon <me@emillon.org>
2018-08-20 13:59:24 +02:00
Etienne Millon a611205ff8 Initial implementation of `dune fmt`
This is a first draft with three main limitations:

- it is language agnostic, so it does not know about field names
- it is not able to parse comments
- it does not break long lines

The formatting rules are pretty simple:

- lists composed only of atoms, quoted strings, templates, and
  singletons are displayed on a single line
- other lists are displayed with a line break after each element
- an empty line is inserted between toplevel stanzas

The CLI is pretty light: it can either read a file or standard input,
and fix a file in place. In addition, the command is named
`unstable-fmt` for now, until some guarantees are given.

Closes #940

Signed-off-by: Etienne Millon <me@emillon.org>
2018-08-20 10:21:47 +02:00
Etienne Millon 35ea17ebc4 Use explicit comparison for path functions
Signed-off-by: Etienne Millon <me@emillon.org>
2018-08-08 21:15:45 +00:00
Etienne Millon f5c45a72a8 Do not duplicate profile in missing deps message
Closes #1106

Signed-off-by: Etienne Millon <me@emillon.org>
2018-08-07 09:53:34 +00:00
Rudi Grinberg 9a504bc86a Remove pointless polymorphic variant and check_path
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-07 11:42:25 +03:00
Rudi Grinberg 6dc6ac3668 Fix #1101
Do not attempt to convert string -> path -> string as this loses information

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-07 11:42:25 +03:00
Rudi Grinberg 264263c819 Split target resolution from string -> path conversion
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-07 11:42:25 +03:00
Rudi Grinberg 6197a49c41 Simplify target resolution code
Split it into 3 functinos
* Resolve 1 targets
* Do logging
* Resolve all targets

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-07 11:42:25 +03:00
Rudi Grinberg f74a064aed Fix #1103
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-07 00:36:27 +03:00
Etienne Millon 7129564d12 Fix placeholders in dune subst documentation
They were substituted, leading to confusing documentation.

Signed-off-by: Etienne Millon <me@emillon.org>
2018-08-02 14:30:59 +00:00
Rudi Grinberg 6e29bd10ef Remove String_map module
We can just use String.Map

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-01 11:59:33 +02:00
Jérémie Dimino 3c5fddf5fe
Add module Lib_deps_info (#1077)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-08-01 09:01:43 +01:00
Jérémie Dimino 4e15fa1522
Fix #1070 (#1072)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-31 18:06:17 +01:00
Rudi Grinberg 4769f9df9f Plumb through env node
workspace -> context -> super context

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-18 14:34:18 +02:00
Rudi Grinberg 1b71d57bba Move promotion to own module
It's not really related to actions

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-18 14:27:09 +02:00
Rudi Grinberg bf2d842075 Split executable parts of Action into Action_exec
This is required for breaking the dep cycle between the context and the Action module

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-18 14:27:09 +02:00
Jeremie Dimino 62f0e826ce Switch bin/main.ml to the let%map syntax
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-17 11:37:22 +01:00
Rudi Grinberg b4b7dde4f5 Add alias just to be sure
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-11 17:29:45 +02:00
Rudi Grinberg f9c1d56f55 Improve the path custom conv to use original path when restoring args
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-11 16:57:29 +02:00
Rudi Grinberg ab85720a06 Move custom args to Arg submodule
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-11 16:41:29 +02:00
Rudi Grinberg 02beadb856 Use path argument for workspace and config file
This path argument will take paths relatively to the initial CWD

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-11 16:41:29 +02:00
Rudi Grinberg ab6bb0d5f7 Fix workspace lookup in cojnuction with --root
The workspace is specified to the initial CWD hence we must convert it a path
relative to it

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-11 16:41:29 +02:00
Etienne Millon 654282c676 Fix "dune external-lib-deps" hint for dune exec
Previously, it was not displaying any target.

Signed-off-by: Etienne Millon <etienne@cryptosense.com>
2018-07-11 13:21:14 +02:00
Etienne Millon 1d594ce5a3 Fix typos in source code
Signed-off-by: Etienne Millon <etienne@cryptosense.com>
2018-07-10 13:05:58 +01:00
Etienne Millon 8c3690cdaa Add List.find_exn
Signed-off-by: Etienne Millon <etienne@cryptosense.com>
2018-07-10 13:47:02 +02: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
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 0c47cab606 Fix cmdliner errors
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-01 21:57:40 +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 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 744430b684 Update doc
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 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 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
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
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
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
Rudi Grinberg be7e3d6dfc Implement --build-dir and change Path.t to use symbolic paths
The motivation for this change is implement the --build-dir feature. This
feature lets us control the build directory which previously always defaulted to
_build. To accomplish this, Path.t had to be modified to be:

External of External.t | In_source_tree of Local.t | In_build_dir of Local.t

To represent the 3 kinds of paths dune is dealing with. The In_build_dir
constructor in particular, is relative to Path.root or some external path.

A few other refactorings had to be done to support this transition:

* The workspace is now "settable". This means that we no longer have to pass it
  explicitly when converting local to absolute paths.

* Path.is_local no longer makes sense and is renamed to Path.is_managed.
  Roughly, is_managed identifies paths in the build and source directories.

* Path.absoulte has been renamed of_filename_relative_to_initial_cwd

* Path.Local.root is now "." (as opposed to "")

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-02 18:14:44 +07:00
Jérémie Dimino 1860438605
Add a jbuilder transition package (#796)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-05-28 18:19:30 +01:00