This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
|
|
@ -0,0 +1,3 @@
|
|||
(executables
|
||||
(names foo)
|
||||
(libraries dune-action-plugin))
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
open Dune_action_plugin.V1
|
||||
|
||||
let action =
|
||||
let open Dune_action_plugin.V1.O in
|
||||
let+ data = read_file ~path:(Path.of_string "some_file") in
|
||||
print_endline data
|
||||
;;
|
||||
|
||||
let () = run action
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
(cram
|
||||
(deps
|
||||
(glob_files bin/*.exe)))
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
This test checks that 'dynamic-run' will not be reexecuted if
|
||||
dependencies do not change (have the same digest) even if
|
||||
they were forced to rebuild.
|
||||
|
||||
$ cat > dune-project << EOF
|
||||
> (lang dune 2.0)
|
||||
> (using action-plugin 0.1)
|
||||
> EOF
|
||||
|
||||
$ cat > dune << EOF
|
||||
> (rule
|
||||
> (target some_file)
|
||||
> (deps (universe))
|
||||
> (action
|
||||
> (progn
|
||||
> (echo "Building some_file!\n")
|
||||
> (with-stdout-to %{target} (echo "Hello from some_file!")))))
|
||||
> \
|
||||
> (rule
|
||||
> (alias runtest)
|
||||
> (action (dynamic-run ./foo.exe)))
|
||||
> EOF
|
||||
|
||||
$ cp ./bin/foo.exe ./
|
||||
|
||||
$ dune runtest
|
||||
Building some_file!
|
||||
Hello from some_file!
|
||||
|
||||
$ dune runtest
|
||||
Building some_file!
|
||||
Loading…
Add table
Add a link
Reference in a new issue