-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- `${path:file}` -> `%{dep:file}` - `${path-no-dep:file}` -> `%{path:file}` See #842 Signed-off-by: Etienne Millon <etienne@cryptosense.com>
- Loading branch information
Showing
15 changed files
with
100 additions
and
33 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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
(alias | ||
(name x) | ||
(action (chdir %{ROOT} (echo "running in %{path-no-dep:.}\n")))) | ||
(action (chdir %{ROOT} (echo "running in %{path:.}\n")))) |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
(alias | ||
(name x) | ||
(action (chdir %{ROOT} (echo "running in %{path-no-dep:.}\n")))) | ||
(action (chdir %{ROOT} (echo "running in %{path:.}\n")))) |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
(alias | ||
(name x) | ||
(action (chdir %{ROOT} (echo "running in %{path-no-dep:.}\n")))) | ||
(action (chdir %{ROOT} (echo "running in %{path:.}\n")))) |
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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
$ dune runtest --display short | ||
File "dune", line 63, characters 19-42: | ||
File "dune", line 44, characters 19-42: | ||
Warning: Directory dir-that-doesnt-exist doesn't exist. | ||
diff alias runtest | ||
diff alias runtest | ||
diff alias runtest | ||
diff alias runtest |
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,18 @@ | ||
;; path with dependency | ||
|
||
(rule (write-file generated-file dynamic-contents)) | ||
|
||
(alias | ||
(name test-path-with-dep) | ||
(action (cat %{dep:generated-file}))) | ||
|
||
;; path without dependency | ||
|
||
(alias | ||
(name test-path-without-dep) | ||
(action | ||
(chdir | ||
sub-tree/dir | ||
(progn | ||
(echo "%{path:file-that-doesn't-exist}\n") | ||
(echo "%{path:.}\n"))))) |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/path-variables/dune/dune-project
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 @@ | ||
(lang dune 1.0) |
18 changes: 18 additions & 0 deletions
18
test/blackbox-tests/test-cases/path-variables/jbuild/jbuild
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,18 @@ | ||
;; path with dependency | ||
|
||
(rule (write-file generated-file dynamic-contents)) | ||
|
||
(alias | ||
((name test-path-with-dep) | ||
(action (cat ${path:generated-file})))) | ||
|
||
;; path without dependency | ||
|
||
(alias | ||
((name test-path-without-dep) | ||
(action | ||
(chdir | ||
sub-tree/dir | ||
(progn | ||
(echo "${path-no-dep:file-that-doesn't-exist}\n") | ||
(echo "${path-no-dep:.}\n")))))) |
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,29 @@ | ||
In dune files, %{dep:string} expands to a file name, and registers this as a | ||
dependency. | ||
|
||
$ dune build --root dune @test-path-with-dep | ||
Entering directory 'dune' | ||
dynamic-contents | ||
|
||
On the contrary, %{path:string} expands to a file name, but does | ||
not register it as a dependency. | ||
|
||
$ dune build --root dune @test-path-without-dep | ||
Entering directory 'dune' | ||
../../file-that-doesn't-exist | ||
../.. | ||
|
||
In jbuild files, the legacy syntax is ${path:string} to register the | ||
dependency: | ||
|
||
$ dune build --root jbuild @test-path-with-dep | ||
Entering directory 'jbuild' | ||
dynamic-contents | ||
|
||
and ${path-no-dep:string} to not include it. | ||
|
||
$ dune build --root jbuild @test-path-without-dep | ||
Entering directory 'jbuild' | ||
../../file-that-doesn't-exist | ||
../.. | ||
|