This commit is contained in:
swrup 2025-11-11 02:07:51 +01:00
parent aa2ff7b2f0
commit 2f3113f55d
11742 changed files with 1223940 additions and 0 deletions

View file

@ -0,0 +1,3 @@
(executables
(names foo)
(libraries dune_action_plugin dune_glob))

View file

@ -0,0 +1,11 @@
open Dune_action_plugin.V1
module Glob = Dune_glob.V1
let action =
let open Dune_action_plugin.V1.O in
let glob = Glob.of_string "some_file*" in
let+ listing = read_directory_with_glob ~path:(Path.of_string "some_dir") ~glob in
String.concat "\n" listing |> print_endline
;;
let () = run action

View file

@ -0,0 +1,3 @@
(cram
(deps
(glob_files bin/*.exe)))

View file

@ -0,0 +1,43 @@
$ cat > dune-project << EOF
> (lang dune 2.0)
> (using action-plugin 0.1)
> EOF
$ cat > dune << EOF
> (rule
> (alias runtest)
> (action (dynamic-run ./foo.exe)))
> EOF
$ mkdir some_dir
$ cat > some_dir/dune << EOF
> (rule
> (target some_file)
> (action
> (progn
> (echo "Building some_file!\n")
> (with-stdout-to %{target} (echo "")))))
> \
> (rule
> (target another_file)
> (action
> (progn
> (echo "SHOULD NOT BE PRINTED!")
> (with-stdout-to %{target} (echo "")))))
> \
> (rule
> (target some_file_but_different)
> (action
> (progn
> (echo "Building some_file_but_different!\n")
> (with-stdout-to %{target} (echo "")))))
> EOF
$ cp ./bin/foo.exe ./
$ dune runtest
Building some_file!
Building some_file_but_different!
some_file
some_file_but_different