Skip to content

Commit

Permalink
Remove [action] field in [alias] for dune 2.0
Browse files Browse the repository at this point in the history
The [rule] stanza with the [alias] field does the same thing.

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
  • Loading branch information
rgrinberg committed Nov 5, 2019
1 parent 7c8eca6 commit 1bdf4ac
Show file tree
Hide file tree
Showing 56 changed files with 652 additions and 608 deletions.
14 changes: 7 additions & 7 deletions doc/concepts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -827,14 +827,14 @@ same lock:

.. code:: scheme
(alias
(name runtest)
(rule
(alias runtest)
(deps foo)
(locks m)
(action (run test.exe %{deps})))
(alias
(name runtest)
(rule runtest)
(deps bar)
(locks m)
(action (run test.exe %{deps})))
Expand All @@ -853,8 +853,8 @@ simply use an absolute filename:

.. code:: scheme
(alias
(name runtest)
(rule
(alias runtest)
(deps foo)
(locks /tcp-port/1042)
(action (run test.exe %{deps})))
Expand Down Expand Up @@ -913,8 +913,8 @@ More precisely, let's consider the following dune file:
(rule
(with-stdout-to data.out (run ./test.exe)))
(alias
(name runtest)
(rule
(alias runtest)
(action (diff data.expected data.out)))
Where ``data.expected`` is a file committed in the source
Expand Down
4 changes: 2 additions & 2 deletions doc/dune
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
%{targets}
(run bash %{dep:update-jbuild.sh}))))

(alias
(name runtest)
(rule
(alias runtest)
(action
(diff dune.inc dune.inc.gen)))
4 changes: 2 additions & 2 deletions doc/dune-files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1069,8 +1069,8 @@ The typical use of the ``alias`` stanza is to define tests:

.. code:: scheme
(alias
(name runtest)
(rule
(alias runtest)
(action (run %{exe:my-test-program.exe} blah)))
See the section about :ref:`running-tests` for details.
Expand Down
4 changes: 2 additions & 2 deletions doc/migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ should be rewritten to the following dune file:

.. code:: scheme
(alias
(name runtest)
(rule
(alias runtest)
(deps (:x input))
(action (run ./test.exe %{x})))
Expand Down
4 changes: 2 additions & 2 deletions doc/tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,8 @@ command. For instance let's consider this test:
(rule
(with-stdout-to tests.output (run ./tests.exe)))
(alias
(name runtest)
(rule
(alias runtest)
(action (diff tests.expected test.output)))
After having run ``tests.exe`` and dumping its output to ``tests.output``, dune
Expand Down
8 changes: 4 additions & 4 deletions example/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(data_only_dirs sample-projects)

(alias
(name runtest)
(rule
(alias runtest)
(deps
(package dune)
(source_tree sample-projects/hello_world))
Expand All @@ -12,8 +12,8 @@
(run %{exe:../test/blackbox-tests/cram.exe} -test run.t)
(diff? run.t run.t.corrected)))))

(alias
(name runtest)
(rule
(alias runtest)
(deps
(package dune)
(source_tree sample-projects/with-configure-step))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(data_only_dirs test)

(alias
(name run_dynamic)
(rule
(alias run_dynamic)
(deps
(package dune)
(source_tree test/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
$ cat > dune << EOF
> (data_only_dirs some_dir)
> \
> (alias
> (name runtest)
> (rule
> (alias runtest)
> (action (dynamic-run ./foo.exe)))
> EOF

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(data_only_dirs test)

(alias
(name run_dynamic)
(rule
(alias run_dynamic)
(deps
(package dune)
(source_tree test/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ they were forced to rebuild.
> (echo "Building some_file!\n")
> (with-stdout-to %{target} (echo "Hello from some_file!")))))
> \
> (alias
> (name runtest)
> (rule
> (alias runtest)
> (action (dynamic-run ./foo.exe)))
> EOF

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(data_only_dirs test)

(alias
(name run_dynamic)
(rule
(alias run_dynamic)
(deps
(package dune)
(source_tree test/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
> EOF

$ cat > dune << EOF
> (alias
> (name runtest)
> (rule
> (alias runtest)
> (action (dynamic-run ./foo.exe)))
> EOF

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(data_only_dirs test)

(alias
(name run_dynamic)
(rule
(alias run_dynamic)
(deps
(package dune)
(source_tree test/)
Expand Down
4 changes: 2 additions & 2 deletions otherlibs/action-plugin/test/depends-on-its-target/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(data_only_dirs test)

(alias
(name run_dynamic)
(rule
(alias run_dynamic)
(deps
(package dune)
(source_tree test/)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(data_only_dirs test)

(alias
(name run_dynamic)
(rule
(alias run_dynamic)
(deps
(package dune)
(source_tree test/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ only the dependencies up to this stage are rebuilt.
> (echo "Building foo_or_bar!\n")
> (copy %{deps} %{target}))))
> \
> (alias
> (name runtest)
> (rule
> (alias runtest)
> (action (dynamic-run ./client.exe)))
> EOF

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(data_only_dirs test)

(alias
(name run_dynamic)
(rule
(alias run_dynamic)
(deps
(package dune)
(source_tree test/)
Expand Down
4 changes: 2 additions & 2 deletions otherlibs/action-plugin/test/no-dependencies/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(data_only_dirs test)

(alias
(name run_dynamic)
(rule
(alias run_dynamic)
(deps
(package dune)
(source_tree test/)
Expand Down
4 changes: 2 additions & 2 deletions otherlibs/action-plugin/test/no-dependencies/test/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ but requires no dependencies can be successfully run.
> EOF

$ cat > dune << EOF
> (alias
> (name runtest)
> (rule
> (alias runtest)
> (action (dynamic-run ./foo.exe)))
> EOF

Expand Down
4 changes: 2 additions & 2 deletions otherlibs/action-plugin/test/one-absent-dependency/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(data_only_dirs test)

(alias
(name run_dynamic)
(rule
(alias run_dynamic)
(deps
(package dune)
(source_tree test/)
Expand Down
8 changes: 4 additions & 4 deletions otherlibs/action-plugin/test/one-absent-dependency/test/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ and requires dependency that can not be build fails.
> EOF

$ cat > dune << EOF
> (alias
> (name runtest)
> (rule
> (alias runtest)
> (action (dynamic-run ./foo.exe)))
> EOF

Expand All @@ -17,8 +17,8 @@ and requires dependency that can not be build fails.
$ dune runtest --display short
foo alias runtest
File "dune", line 1, characters 0-57:
1 | (alias
2 | (name runtest)
1 | (rule
2 | (alias runtest)
3 | (action (dynamic-run ./foo.exe)))
Error: No rule found for some_absent_dependency
[1]
4 changes: 2 additions & 2 deletions otherlibs/action-plugin/test/one-dependency-with-chdir/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(data_only_dirs test)

(alias
(name run_dynamic)
(rule
(alias run_dynamic)
(deps
(package dune)
(source_tree test/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ when we 'chdir' into different directory.
> EOF

$ cat > dune << EOF
> (alias
> (name runtest)
> (rule
> (alias runtest)
> (action
> (chdir some_dir
> (dynamic-run ./foo.exe))))
> (dynamic-run ./foo.exe))))
> EOF

$ mkdir some_dir
Expand Down
4 changes: 2 additions & 2 deletions otherlibs/action-plugin/test/one-dependency/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(data_only_dirs test)

(alias
(name run_dynamic)
(rule
(alias run_dynamic)
(deps
(package dune)
(source_tree test/)
Expand Down
4 changes: 2 additions & 2 deletions otherlibs/action-plugin/test/one-dependency/test/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ and requires one dependency can be successfully run.
> (target some_dependency)
> (action (with-stdout-to %{target} (echo "Hello from some_dependency!"))))
> \
> (alias
> (name runtest)
> (rule
> (alias runtest)
> (action (dynamic-run ./foo.exe)))
> EOF

Expand Down
4 changes: 2 additions & 2 deletions otherlibs/action-plugin/test/one-directory-dependency/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(data_only_dirs test)

(alias
(name run_dynamic)
(rule
(alias run_dynamic)
(deps
(package dune)
(source_tree test/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ directory to be build.
> EOF

$ cat > dune << EOF
> (alias
> (name runtest)
> (rule
> (alias runtest)
> (action (dynamic-run ./foo.exe)))
> EOF

Expand Down
4 changes: 2 additions & 2 deletions otherlibs/action-plugin/test/one-target/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(data_only_dirs test)

(alias
(name run_dynamic)
(rule
(alias run_dynamic)
(deps
(package dune)
(source_tree test/)
Expand Down
4 changes: 2 additions & 2 deletions otherlibs/action-plugin/test/one-target/test/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
> (action
> (dynamic-run ./foo.exe)))
> \
> (alias
> (name runtest)
> (rule
> (alias runtest)
> (action (cat some_target)))
> EOF

Expand Down
4 changes: 2 additions & 2 deletions otherlibs/action-plugin/test/one-undeclared-target/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(data_only_dirs test)

(alias
(name run_dynamic)
(rule
(alias run_dynamic)
(deps
(package dune)
(source_tree test/)
Expand Down
4 changes: 2 additions & 2 deletions otherlibs/action-plugin/test/one-undeclared-target/test/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
> EOF

$ cat > dune << EOF
> (alias
> (name runtest)
> (rule
> (alias runtest)
> (action (dynamic-run ./foo.exe)))
> EOF

Expand Down
4 changes: 2 additions & 2 deletions otherlibs/action-plugin/test/ordinary-executable/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(data_only_dirs test)

(alias
(name run_dynamic)
(rule
(alias run_dynamic)
(deps
(package dune)
(source_tree test/)
Expand Down
Loading

0 comments on commit 1bdf4ac

Please sign in to comment.