Commit Graph

343 Commits

Author SHA1 Message Date
Eugene Yokota e6492b771e [2.x] fix: Replace Scala version with u when crossPaths is false
**Problem**
sbt 2.x uses crossTarget by default, but it contains Scala version
even when crossPaths is false.

**Solution**
This replaces it with the letter "u" for unspecified.
2025-12-18 00:00:11 -05:00
Eugene Yokota 4d6ddd50a6 [2.x] projectMatrix crossVerson support
**Problem**
crossVersion is missing from projectMatrix in sbt 2.x.

**Solution**
Port it from sbt-projectmatrix.
2025-12-16 01:33:43 -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
Anatolii Kmetiuk eec0b4a6a0 Fix scripted dependency-management/update-sbt-classifiers test 2025-12-11 12:16:12 +09:00
Anatolii Kmetiuk b7cb338171 Add regression test for #8405 2025-12-11 11:44:27 +09:00
Anatolii Kmetiuk 1a3c6b5007 Fix #8340: Add regression test 2025-12-10 11:34:25 +09:00
Anatolii Kmetiuk 4bcf866193 Add regression test for #8345 2025-12-08 14:35:31 +09:00
xuwei-k 2b9211e5b4 use -Werror instead of -Xfatal-warnings 2025-12-05 16:22:07 +09:00
Eugene Yokota ffc2f8c35d fix: Fixes managed resources missing from the JAR
**Problem**
RC-7 is missing the managed resources.

**Solution**
This triggers managed resources so they get generated.
2025-11-28 23:51:08 -05:00
eugene yokota b43b73c319
Merge branch 'develop' into wip/remove-old-remote 2025-11-25 02:34:16 -05:00
Eugene Yokota 5730383340 Merge branch '1.12.x' into wip/merge-1.12.x 2025-11-24 02:14:17 -05:00
Eugene Yokota 77e74871ad Remove sbt 1.x remote cache imple 2025-11-23 22:47:21 -05:00
Eugene Yokota 68b2b7d025 [2.x] perf: Cache compiler bridge binary
**Problem**
Compiler bridge resolution calls out to Coursier,
and it shows up on the profiler.

**Solution**
This uses sbt 2.x caching to cache the prebuilt compiler bridge binaries
to avoid calling Coursier from second time onwards.
2025-11-19 03:26:13 -05:00
Eugene Yokota 6c56a769fd Enable sbt-native-packager test 2025-11-18 00:34:47 -05:00
Eugene Yokota 6a2e0a9b04 [2.x] perf: Avoid copying directories
**Problem**
Directory copying is showing up as performance hot spots.

**Solution**
This avoid copying classes or resources.
2025-11-17 05:25:59 -05:00
xuwei-k 152fe61ced fix runMain task. support JEP-512 2025-10-04 06:42:16 +09:00
xuwei-k 2a7e70ab6a fix run/daemon-exit test 2025-10-03 14:49:28 +09:00
xuwei-k 3b662f3968 fix fallback-dependencies-inter-project test 2025-10-03 09:39:16 +09:00
Eugene Yokota 8f2160ba43 Adjust tests 2025-09-29 00:31:24 -04:00
Eugene Yokota ef6c65b481 Update to Zinc 2.0.0-M9 2025-09-28 23:09:07 -04:00
Eugene Yokota d826f1f903 Merge branch '1.11.x' into wip/merge-1.11.x 2025-09-28 23:08:36 -04:00
Eugene Yokota 2e7d3fdf93 Support JDK 25 JEP-512/JEP-445 Main run
**Problem**
sbt currently does not support JDK 25 Main class. JDK 25 supports:
1. non-public main method
2. doesn't need Array[String] arg
3. doesn't have to be a static method

**Solution**
This updates Zinc, which supports new Main class detection.

In addition, this implements in-process run emulation support.
2025-09-28 01:51:24 -04:00
xuwei-k a62ee86b2b enable some scripted tests 2025-09-24 07:41:33 +09:00
xuwei-k 028dc35308 enable some scripted tests 2025-09-23 20:09:47 +09:00
Eugene Yokota 748bf1207f Auto aggregate
**Problem**
For sbt 1.x, the user is forced to pick between having a stable ID for the root project,
or having the automatic aggregation of all subprojects.
The problem becomes more pronounced for large build that frequent add/remove subprojects.

**Solution**
This implements `.autoAggregate` method on `Project`, which is implemented as
`this.aggregate(LocalAggregate)`.
At the loading time, we can automatically expand `LocalAggregate` to a list of subproject references,
after we discover all subprojects.
The `autoAggregate` will use the base directory of the subproject to pick the parent-child
relationship. For example, a root project would aggregate all subprojects,
but `bar` might aggregate only `bar/bar1` and `bar/bar2`.
2025-09-21 13:40:53 -04:00
Seth Tisue 3dfa840495
Merge pull request #8265 from zainab-ali/weaver-group-id
Migrate weaver group id to `org.typelevel`
2025-09-18 07:40:39 -07:00
xuwei-k 64357d7e2a Scala 3.7.3 2025-09-09 12:31:28 +09:00
Eugene Yokota 8a9f24b395 fix: Fixes forked test error handling on JDK 17
**Problem**
Forked tests apparently incorrectly returns success if an exception is thrown
on JDK 17 and up, due to exception failing to persist.

**Solution**
This adds custom codec for Throwable to workaround this issue.
2025-09-07 04:44:05 -04:00
zainab-ali d784515327 Migrate weaver group id to org.typelevel. 2025-09-05 12:14:20 +01:00
Eugene Yokota e0013078b5 fix: Fixes removeN operator --=
**Problem**
removeN operator doesn't work with settings because the param isn't inlined.

**Solution**
Fix it.
2025-09-03 11:35:27 -04:00
Eugene Yokota a8ce3a8cf6 test: Port remove test 2025-09-03 04:27:09 -04:00
Eugene Yokota 683a559b37 Remove log4j 2025-08-30 20:29:44 -04:00
Eugene Yokota dedaba23d0 Zinc 2.0.0-M7 2025-08-30 18:04:35 -04:00
Eugene Yokota b965277edc fix: Fixes set command
**Problem**
Once set command fails, the error state carries over to the next.

**Solution**
Create a fresh driver with a fresh reporter.
2025-08-28 23:47:07 -04:00
Eugene Yokota a883e400eb fix: Fixes exportJars handling for test
**Problem**
Test doesn't seem to work for exportJars set to false.

**Solution**
This bumps Zinc to handle directory hashing.
2025-08-27 23:28:37 -04:00
Eugene Yokota 380af10e8f fix: Fixes exportJars false support
**Problem**
Setting exportJars to false causes issues due to hashing of the directories.

**Solution**
Make exportedProducts uncached for now.
2025-08-26 01:10:27 -04:00
Eugene Yokota 21a9996b09 fix: Java-only tests
**Problem**
managedScalaInstance := false fails Java-only tests because
the test runner is based on a Scala Runner and sbt 2.x
currently derives the ScalaInstance only from update.

**Solution**
For the purpose of Java-only testing, create a dummy Scala Instance.
2025-08-25 22:12:56 -04:00
Eugene Yokota 0c9408d312 fix: Fix sbt 1.x cross building
**Problem**
Under -Xlint, sbt 1.x complains that nowarn isn't doing anything.

**Solution**
Bring back Wconf for sbt 1.x cross building.
2025-08-21 07:19:12 +02:00
Eugene Yokota 43382095ef Use scala.transient to denote the empty cache level 2025-08-16 01:27:14 -04:00
eugene yokota 9b035c9979
Merge pull request #8209 from eed3si9n/wip/bump-sjson-new
[2.x] Bump to sjson-new 0.14.0-M4
2025-08-15 22:57:06 -04:00
Eugene Yokota 44097ec127 Add plugins test 2025-08-15 22:09:29 -04:00
Martin Duhem da0fa5388e
Support annotated definitions in build.sbt
Previously, sbt would fail to load build.sbt files when they included
annotated definitions because the parser would not correctly recognize
those definitions as such. In sbt 1.x, this used to be fine, because
there was little use for annotations in build.sbt.

Starting with sbt 2, whether caching should be enabled for a task key
can be controlled via annotations on the task key definition. Because
these can appear in build.sbt, support for annotations in build.sbt
becomes more important.

This patch enhances parsing of build.sbt by keeping the parsed trees
around so that the AST can be used to determine whether a given line
represents a setting or a definition, rather than relying on string
matching.
2025-08-11 10:33:22 +02:00
Eugene Yokota (eed3si9n) 61fe604519 refactor: Unify to dependency-tree
**Problem**
While sbt-dependency-graph is useful, not just for the basic ASCII graph,
but for DOT file generation etc, it adds a large number of settings and
tasks for combination of formats and actions to the point that
we actually disable most of them by default.

**Solution*
I've had an idea for a while that dependencyTree can be implemented
as a inputTask that accepts its own subcommands and options,
and this implements that.

For example, to open the browser that hosts a DOT file, now you can write
    dependencyTree dot --browse
2025-08-10 00:37:16 -04:00
Eugene Yokota 9e37218dcf refactor: Hide Ivy-related classes
Move Ivy-related classes to internal.
Promote IvyPaths and Credentials to core.
2025-08-09 01:52:45 -04:00
Eugene Yokota 42010a317e Flip testForkedParallel to true 2025-08-08 02:06:36 -04:00
Eugene Yokota ac57fb083e Remove IntegrationTest 2025-08-03 19:50:33 -04:00
Eugene Yokota 7bb55fc9fb Remove unused code 2025-08-03 16:03:00 -04: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
xuwei-k 5581f5fd1a Scala 3.7.2 2025-07-30 09:55:46 +09:00