Commit Graph

192 Commits

Author SHA1 Message Date
PandaMan c7da2b72c3
[2.x] fix: Fixes explicitlySpecified and selectors for testOnly (#8727)
**Problem**
When the user runs testOnly with an explicit suite name (e.g. testOnly com.example.MySuite),
ScalaTest suites annotated with @DoNotDiscover were not run because sbt always passed
explicitlySpecified=false to the test framework.

**Solution**
In Tests.processOptions, when the user has specified test filters (orderedFilters.nonEmpty),
mark the filtered tests as explicitlySpecified=true with SuiteSelector so frameworks
can run @DoNotDiscover suites when explicitly requested.
2026-02-13 09:19:05 -08:00
eugene yokota edd7061f15
[2.x] Minimalist console (#8722)
**Problem**
Forked console currently pulls in full Zinc, which includes JLine.

**Solution**
This implements a lighter-weight, full Java ForkConsoleMain,
which no longer depends on JLine.
2026-02-09 10:55:44 -05:00
Eugene Yokota 138621eacb [2.x] client-side console and fixes
**Problem**
1. forked console is missing user code from the classpath.
2. forked console still blocks the server.

**Solution**
1. This includes proper products and classpaths to the console.
2. This also implements client-side run for console.
2026-02-07 00:42:54 -05:00
DEBORAH FUNMILOLA OLABOYE a66a3064f9
[2.x] fix: Display HTTP response body when bundle upload fails (#8630)
When a bundle upload to Central Portal fails, the error now displays the HTTP response body instead of just the status code. This provides more useful debugging information, as the response body typically contains detailed error messages from the server.
2026-01-28 10:36:45 -05:00
eugene yokota cc0915fed9
[2.x] refactor: Scala Instance (#8648)
**Problem**
Strings are used to pass paths around.

**Solution**
This cleans up the Scala instance construction code.
2026-01-28 02:27:57 -05:00
calm 9951a302c9
[2.x] feat: Support fork in console task (#8604)
When enabled, the Scala REPL runs in a separate JVM.
2026-01-25 02:16:49 -05:00
Eugene Yokota 9813e60fe3 refactor: Clean up infix etc 2026-01-24 04:52:28 -05:00
calm c099be5f18
[2.x] fix: Race condition in WorkerExchangeTest.propBye (#8606) 2026-01-22 00:49:41 -05:00
eugene yokota 215e9d6325
[2.x] fix: Prevent fork test cross talk (#8575)
**Problem**
currently all notifications go to all listeners.

**Solution**
This adds "re" field so we can check if it matches with the id.
2026-01-19 00:55:16 -05:00
E.G 574654900f
[2.x] test: migrate SonaClientTest from ScalaTest to verify.BasicTestSuite (#8562)
- Convert class to object with BasicTestSuite
- Use test() syntax instead of 'should ... in'
- Move RecordingLogger and extension to top-level
- Use Scala 3 colon indentation syntax

Co-authored-by: GlobalStar117 <GlobalStar117@users.noreply.github.com>
2026-01-18 14:31:06 -05:00
MkDev11 fb53925fb6
[2.x] fix: Prevent sbt test from hanging when forked process crashes (#8536)
When a forked test process crashes (e.g., due to UnsupportedClassVersionError),
sbt would hang forever waiting for test results. This happened because
notifyExit only completed the promise with success, regardless of the
exit code.

This fix checks the exit code and fails the promise if the process
exited with a non-zero code, allowing sbt to properly report the failure
and exit.

Fixes #7429
2026-01-14 21:54:17 -05:00
MkDev11 061145e67b
[2.x] Add testForkedParallelism setting for forked test thread count (#8453)
**Problems**

When running forked tests, sbt uses `Runtime.getRuntime().availableProcessors()` to determine the thread pool size, ignoring `concurrentRestrictions`. This is inconsistent with non-forked parallel tests.

**Expectations**

Users should be able to control the number of parallel test threads in forked mode, similar to how `concurrentRestrictions` works for non-forked tests.

**Notes**

Added a new setting `testForkedParallelism` that allows explicit control:

```scala
testForkedParallelism := Some(2)  // Use 2 threads
testForkedParallelism := None     // Use availableProcessors() (default)
```
2026-01-09 12:43:50 -05:00
Eugene Yokota c20d83a8e2 Use TCP for the fork test
**Problem**
Forked test currently uses stdio, but that println to be lost.

**Solution**
Use TCP for communication similar to sbt 1.x.
2026-01-04 01:48:45 -05:00
Eugene Yokota 9888aae7fa [2.x] Switch to using shaded-gson
Fixes https://github.com/sbt/sbt/issues/8334
2025-12-15 03:17:33 -05:00
xuwei-k 038fa6c476 remove unnecessary nowarn annotations 2025-10-04 19:25:11 +09:00
Eugene Yokota 645908f597 Apply Contraband 2025-09-28 21:28:21 -04:00
Eugene Yokota 2fa3159f18 Update to Contraband 0.8.0 2025-09-19 00:46:34 -04:00
Eugene Yokota f7a3c593e9 fix: Catch gson parsing error
If non-JSON leaks into stdout, send it to the logger.
2025-09-13 22:52:24 -04:00
Eugene Yokota ed0b16375d Update test 2025-08-09 13:58:35 -04:00
Eugene Yokota 7d00a2c51d Merge branch '1.11.x' into wip/merge-1.11.x 2025-08-09 13:47:36 -04:00
Dmitrii Naumenko b83eee4528 [sonatype publishing] print deployment validation errors if present
Before this change you had to log into the sonatype account and search for the errors there.
(https://central.sonatype.com/publishing/deployments)
This was inconvenient, especially if you don't have the admin access to the account.
2025-08-04 15:03:53 +02:00
Eugene Yokota b1a3ef3743 Merge branch '1.11.x' into wip/merge-1.11.x 2025-08-02 23:13:41 -04:00
Eugene Yokota c8737b8e4f refactor: Change the test type
**Problem**
test task is typed to unit.
To distinguish test from any other tasks, we want to actually type this to something.

**Solution**
Forward TestResult to the test task.
2025-08-02 18:12:20 -04:00
Eugene Yokota 9b1e644be1 fix: Use promise to wait for forked test
**Problem**
I'm seeing NPE in some test-related tests like tests/junit:
[info] [error] java.lang.NullPointerException: Null output stream
[info] [error] 	at java.io.PrintStream.requireNonNull(PrintStream.java:79)
[info] [error] 	at java.io.PrintStream.<init>(PrintStream.java:151)
[info] [error] 	at java.io.PrintStream.<init>(PrintStream.java:135)
[info] [error] 	at sbt.internal.WorkerProxy.inputStream$lzyINIT1(WorkerExchange.scala:69)
[info] [error] 	at sbt.internal.WorkerProxy.inputStream(WorkerExchange.scala:69)
[info] [error] 	at sbt.internal.WorkerProxy.println(WorkerExchange.scala:77)
[info] [error] 	at sbt.ForkTests$.mainTestTask$$anonfun$1(ForkTests.scala:160)

This is likely coming from ProcessBuilder#run not immediately processing the passed in processIO.

**Solution**
This uses Promise to wait for the processIO to be processed.
2025-08-02 15:14:22 -04:00
Jules Ivanic 8c0010a086
Review: the new configurable request timeout value should be `10.minutes` and should only be used for upload 2025-07-04 16:40:52 +04:00
Eugene Yokota b247e2620f Reimplement test agent as a worker command
This sends JSON-RPC over stdin as opposed to using ObjectStream over socket.
2025-07-04 01:28:56 -04:00
Jules Ivanic 084ca08f34
Allow users to configure the timeout when publishing to the Maven Central repo 2025-07-02 13:53:50 +04:00
Leonidas Spyropoulos 1cd9c1ec64
fix: semanticdb expects Wildcard imports to be in the last position
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2025-06-11 08:57:07 +01:00
Eugene Yokota e023c2dc64 Merge branch '1.11.x' into wip/merge-1.11.x 2025-05-25 17:20:48 -04:00
Eugene Yokota 929b0bf525 fix: Fix Sonatype publishing
**Problem**
1. query string wasn't passed in, so sonaRelease wasn't working
2. deployment name should be human readable

**Solution**
This fixes the query string passing by hand-crafting the URL.

This also generates human readable deployment name.
2025-05-18 15:25:27 -04:00
Eugene Yokota ff6ea5570b fix: Fix Central Portal status checking
**Problem**
It's supposed to be POST but I'm usin g GET, which results in 500.
2025-05-18 12:51:06 -04:00
Eugene Yokota d8813bc506 Sonatype Publish Portal support
**Problem**
Sonatype is sunsetting HTTP Rest endpoint OSSRH in June 2025.

**Solution**
This implements a built-in publishing mechanism.
Kudos to David Doyle who has spearheaded Sonatype Central support via sonatype-central-client etc.
2025-05-15 03:27:54 -04:00
Eugene Yokota 3b4547718e Remove deprecated methods 2025-05-11 05:23:41 -04:00
Eugene Yokota 967ecb49bc deps: Scala 3.7.0 2025-05-11 01:30:07 -04:00
xuwei-k 74a4abf049 add `using` if explicitly providing arguments to methods defined with `implicit` 2025-05-09 20:11:43 +09:00
xuwei-k 5d660ab8b5 remove unnecessary `case`
- 3ca3633505/rules/src/main/scala/fix/RemoveParameterUntuplingCase.scala
- https://docs.scala-lang.org/scala3/reference/other-new-features/parameter-untupling.html
- https://docs.scala-lang.org/scala3/reference/other-new-features/parameter-untupling-spec.html
2025-02-22 08:48:29 +09:00
Josh Soref 613eb86447
Spelling (#8028)
* spelling: 1.x

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: a

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: aether

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: anymore

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: artifact

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: available

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: be

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: bridge

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: cannot

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: case-insensitive

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: checksum

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: class loads

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: contra

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: dependencies

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: dependency

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: dependent

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: deriveds

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: describes

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: early

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: enclosed

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: evaluation

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: excluding

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: execution

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: for

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: frequently

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: github

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: green

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: https://www

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: https

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: in-sourcing

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: include

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: incompatible

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: indefinitely

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: information

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: inputted

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: just

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: lastmodifiedtimes

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: latest

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: manifest

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: miscellaneous

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: more

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: neither

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: never

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: nonexistent

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: opted

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: outputting

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: params

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: performance

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: preceding

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: presentation

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: project

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: projects

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: protocol

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: related

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: representation

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: res

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: resolverlist

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: resolverset

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: response

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: returned

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: sbt_version

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: scalacheck

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: sentinels

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: separates

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: serves

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: should

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: significant

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: specifically

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: substitute

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: suppress

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: terminal

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: the

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: title

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: transitive

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: version

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: versions

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: want

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: wanting

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: whether

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* link: sbt Cached Resolution

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* link: Testing sbt plugins

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

---------

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2025-02-04 01:11:28 -05:00
eugene yokota 52d36653da
Merge pull request #7997 from xuwei-k/scalafmt-convertToNewSyntax
[2.x] update `.scalafmt.conf`. enforce new scala 3 syntax
2025-01-01 22:34:03 -05:00
xuwei-k 13d6626564 update .scalafmt.conf. enforce new scala 3 syntax 2025-01-02 11:25:34 +09:00
xuwei-k e0a51807bc change to using param anonymous if possible 2025-01-02 10:35:15 +09:00
eugene yokota ae64f718d7
Merge pull request #7989 from xuwei-k/incorrect-scaladoc-param
[2.x] remove incorrect scaladoc `@param` tag
2025-01-01 03:05:35 -05:00
xuwei-k c35e1539a0 remove incorrect scaladoc `param` tag 2025-01-01 16:25:30 +09:00
xuwei-k 5438781142 use collectFirst instead of collect and headOption 2025-01-01 16:06:34 +09:00
Eugene Yokota 0b744c1ded Port MapperTest 2024-12-16 00:22:29 -05:00
João Ferreira a2b046e0c3 translate mapper to use VirtualFile 2024-12-15 21:55:56 -05:00
João Ferreira f4ae48bf72 move Mapper from sbt/io 2024-12-15 21:55:56 -05:00
Eugene Yokota 02c7cf309d Avoid the use of URL
**Problem**
`java.net.URL` calls out to the network to perform `equals`,
so we should remove that from anywhere that can be involved in caching etc.

**Solution**
This changes java.net.URL to java.net.URI in Keys.
2024-12-04 22:12:54 -05:00
xuwei-k f11d9d76f0 remove more implicit. use given and using 2024-11-18 14:39:00 +09:00
xuwei-k d193c990d1 remove implicit params. change to using 2024-11-18 06:49:22 +09:00
xuwei-k c5b7038f3a use `given` instead of `implicit val` 2024-11-17 17:35:23 +09:00