-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: multiple alias support in rules
Signed-off-by: Ali Caglayan <[email protected]> ps-id: 7f58c532-3611-4290-b07c-9ad973f2a995 Signed-off-by: Ali Caglayan <[email protected]>
- Loading branch information
Showing
6 changed files
with
107 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
Testing multiple aliases in rules stanza | ||
|
||
First we start with a dune-project before alias was introduced: | ||
$ cat > dune-project << EOF | ||
> (lang dune 1.9) | ||
> EOF | ||
|
||
$ cat > dune << EOF | ||
> (rule | ||
> (alias a) | ||
> (action (echo "I have run"))) | ||
> EOF | ||
|
||
$ dune build @a | ||
File "dune", line 2, characters 0-9: | ||
2 | (alias a) | ||
^^^^^^^^^ | ||
Error: 'alias' is only available since version 2.0 of the dune language. | ||
Please update your dune-project file to have (lang dune 2.0). | ||
[1] | ||
|
||
Next we update the dune-project file to use dune 2.0: | ||
$ cat > dune-project << EOF | ||
> (lang dune 2.0) | ||
> EOF | ||
|
||
$ dune build @a | ||
I have run | ||
|
||
We now update the dune file to use multiple aliases | ||
$ cat > dune << EOF | ||
> (rule | ||
> (alias a b) | ||
> (action (echo "I have run"))) | ||
> EOF | ||
|
||
$ dune build @a @b | ||
File "dune", line 2, characters 0-11: | ||
2 | (alias a b) | ||
^^^^^^^^^^^ | ||
Error: 'alias' is only available since version 3.5 of the dune language. | ||
Please update your dune-project file to have (lang dune 3.5). | ||
[1] | ||
|
||
Updating the dune-project file to use dune 3.5 allows the build to succeed: | ||
$ cat > dune-project << EOF | ||
> (lang dune 3.5) | ||
> EOF | ||
|
||
$ dune build @a | ||
I have run | ||
$ dune build @b | ||
I have run |