-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support glob expressions in scripted
**Problem** It's currently not easy to write a scripted test that works on both sbt 1.x and 2.x when you want to write exists test under target. **Solution** Since we can only use the file system (and not evaluate Scala version etc) 1. this implements glob expression support in `exists`, `absent`, and `delete`. 2. this also introduces `||` operator that would mean a or b.
- Loading branch information
Showing
4 changed files
with
55 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
> compile | ||
$ exists target/out/jvm/scala-3.3.1/clean-managed/src_managed/foo.txt target/out/jvm/scala-3.3.1/clean-managed/src_managed/bar.txt | ||
$ exists target/**/clean-managed/src_managed/foo.txt target/**/clean-managed/src_managed/bar.txt | ||
|
||
> clean | ||
$ absent target/out/jvm/scala-3.3.1/clean-managed/src_managed/foo.txt | ||
$ exists target/out/jvm/scala-3.3.1/clean-managed/src_managed/bar.txt | ||
$ absent target/**/clean-managed/src_managed/foo.txt | ||
$ exists target/**/clean-managed/src_managed/bar.txt | ||
$ exists target/**/clean-managed/src_managed/bar.txt || target/**/clean-managed/src_managed/x.txt |
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,17 +1,17 @@ | ||
$ touch target/out/jvm/scala-2.12.20/compile-clean/backend/cant-touch-this | ||
$ touch target/**/compile-clean/backend/cant-touch-this | ||
|
||
> Test/compile | ||
$ exists target/out/jvm/scala-2.12.20/compile-clean/backend/A.class | ||
$ exists target/out/jvm/scala-2.12.20/compile-clean/backend/X.class | ||
$ exists target/out/jvm/scala-2.12.20/compile-clean/test-backend/B.class | ||
$ exists target/**/compile-clean/backend/A.class | ||
$ exists target/**/compile-clean/backend/X.class | ||
$ exists target/**/compile-clean/test-backend/B.class | ||
|
||
> Test/clean | ||
$ exists target/out/jvm/scala-2.12.20/compile-clean/backend/cant-touch-this | ||
$ exists target/out/jvm/scala-2.12.20/compile-clean/backend/A.class | ||
$ exists target/out/jvm/scala-2.12.20/compile-clean/backend/X.class | ||
$ absent target/out/jvm/scala-2.12.20/compile-clean/test-backend/B.class | ||
$ exists target/**/compile-clean/backend/cant-touch-this | ||
$ exists target/**/compile-clean/backend/A.class | ||
$ exists target/**/compile-clean/backend/X.class | ||
$ absent target/**/compile-clean/test-backend/B.class | ||
|
||
> Compile/clean | ||
$ exists target/out/jvm/scala-2.12.20/compile-clean/backend/cant-touch-this | ||
$ absent target/out/jvm/scala-2.12.20/compile-clean/backend/A.class | ||
$ exists target/out/jvm/scala-2.12.20/compile-clean/backend/X.class | ||
$ exists target/**/compile-clean/backend/cant-touch-this | ||
$ absent target/**/compile-clean/backend/A.class | ||
$ exists target/**/compile-clean/backend/X.class |
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,7 @@ | ||
> taskB | ||
$ exists target/out/jvm/scala-3.3.1/task-map/b | ||
$ exists target/out/jvm/scala-3.3.1/task-map/a | ||
$ exists target/**/task-map/**/b | ||
$ exists target/**/task-map/**/a | ||
|
||
> taskF | ||
$ exists target/out/jvm/scala-3.3.1/task-map/e | ||
$ exists target/out/jvm/scala-3.3.1/task-map/f | ||
$ exists target/**/task-map/e | ||
$ exists target/**/task-map/f |