Skip to content

Conversation

eed3si9n
Copy link
Member

@eed3si9n eed3si9n commented Dec 9, 2024

Fixes #7931

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.

**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.
Copy link
Member

@adpi2 adpi2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks great! Thank you @eed3si9n

@eed3si9n eed3si9n merged commit 35eda2e into sbt:develop Dec 9, 2024
13 checks passed
@eed3si9n eed3si9n deleted the wip/exists branch December 9, 2024 07:55
@mkurz mkurz mentioned this pull request Dec 9, 2024
Copy link
Contributor

@jtjeferreira jtjeferreira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this successfully by publishing both sbt 1.x and 2.x locally and using $ exists target/**/universal/simple-test-0.1.0.zip to handle both target/universal/simple-test-0.1.0.zip and target/out/jvm/scala-3.5.2/simple-test/universal/simple-test-0.1.0.zip

mzuehlke added a commit to mzuehlke/contraband that referenced this pull request Jan 4, 2025
After support for globs in scripted tests:
* sbt/sbt#7933
* sbt/sbt#7932

The changes introduced in sbt#184 can be simplified again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants