This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
|
|
@ -0,0 +1,3 @@
|
|||
(rule
|
||||
(targets x y)
|
||||
(action (with-stdout-to %{targets} (echo foo))))
|
||||
|
|
@ -0,0 +1 @@
|
|||
(lang dune 1.0)
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
This behavior is surprising, we should get an error about the fact
|
||||
that ${@} is not quoted and doesn't contain exactly 1 element
|
||||
|
||||
$ dune build x
|
||||
File "dune", line 3, characters 25-35:
|
||||
3 | (action (with-stdout-to %{targets} (echo foo))))
|
||||
^^^^^^^^^^
|
||||
Error: Variable %{targets} expands to 2 values, however a single value is
|
||||
expected here. Please quote this atom.
|
||||
[1]
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
$ cat > a
|
||||
$ cat > b
|
||||
$ cat > dune-project << EOF
|
||||
> (lang dune 3.9)
|
||||
> EOF
|
||||
|
||||
It should be possible to expand %{deps} in a cat action since it allows multiple
|
||||
arguments.
|
||||
|
||||
$ cat > dune <<EOF
|
||||
> (rule
|
||||
> (alias foo)
|
||||
> (deps a b)
|
||||
> (action
|
||||
> (cat %{deps})))
|
||||
> EOF
|
||||
|
||||
This isn't possible in 3.9.
|
||||
|
||||
$ dune build @foo
|
||||
File "dune", line 5, characters 7-14:
|
||||
5 | (cat %{deps})))
|
||||
^^^^^^^
|
||||
Error: Variable %{deps} expands to 2 values, however a single value is
|
||||
expected here. Please quote this atom.
|
||||
[1]
|
||||
|
||||
But it is in 3.10:
|
||||
|
||||
$ cat > dune-project << EOF
|
||||
> (lang dune 3.10)
|
||||
> EOF
|
||||
|
||||
$ dune build @foo
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
(alias
|
||||
(name unquoted)
|
||||
(action (echo %{read:foo bar.txt})))
|
||||
|
||||
(alias
|
||||
(name quoted)
|
||||
(action (echo "%{read:foo bar.txt}")))
|
||||
|
|
@ -0,0 +1 @@
|
|||
(lang dune 1.0)
|
||||
|
|
@ -0,0 +1 @@
|
|||
filename contains spaces
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
$ dune build @quoted
|
||||
File "dune", line 4, characters 25-26:
|
||||
4 | (action (echo %{read:foo bar.txt})))
|
||||
^
|
||||
Error: The character ' ' is not allowed inside %{...} forms
|
||||
[1]
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
(rule
|
||||
(targets s t)
|
||||
(action (with-stdout-to "%{targets}" (echo foo))))
|
||||
|
|
@ -0,0 +1 @@
|
|||
(lang dune 1.0)
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
The targets should only be interpreted as a single path when quoted
|
||||
|
||||
$ dune build s
|
||||
File "dune", lines 1-3, characters 0-72:
|
||||
1 | (rule
|
||||
2 | (targets s t)
|
||||
3 | (action (with-stdout-to "%{targets}" (echo foo))))
|
||||
Error: Rule failed to generate the following targets:
|
||||
- s
|
||||
- t
|
||||
[1]
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
foo
|
||||
bar
|
||||
baz
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
let () =
|
||||
Printf.printf "Number of args: %d\n" (Array.length Sys.argv - 1)
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
(executable
|
||||
(name count_args))
|
||||
|
||||
(alias
|
||||
(name runtest)
|
||||
(action (run ./count_args.exe %{read-lines:args})))
|
||||
|
|
@ -0,0 +1 @@
|
|||
(lang dune 1.0)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
$ dune runtest
|
||||
Number of args: 3
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
(alias
|
||||
(name runtest)
|
||||
(action (echo "lines: %{read-lines:foo}")))
|
||||
|
|
@ -0,0 +1 @@
|
|||
(lang dune 1.0)
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
foo
|
||||
bar
|
||||
baz
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
$ dune runtest
|
||||
lines: foo bar baz
|
||||
Loading…
Add table
Add a link
Reference in a new issue