Commit Graph

321 Commits

Author SHA1 Message Date
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
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
Eugene Yokota bf098ef911 Use Caffeine 2.8.5 for JDK 8 2025-06-28 20:01:18 -04:00
Martin Duhem 79dbcd2ff4
Support minus sign in project names
Previously, sbt would crash when attempting to load a build where
projects had minus signs (`-`) in their name.

For instance, when trying to load a project defined like this:

    lazy val `my-project` = project

After compilation, this definition looks somewhat like this

    val my$minusproject$lzy1 = ...

sbt was attempting to retrieve the original definition (without the $lzy
suffix) by taking the mangled name up to the first `$`. Unfortunately,
this approach does not work when the name includes special characters
like a minus sign, because these will be prefixed with `$` as well. In
the current example, sbt would then try to find the member named `my`,
fail, and crash.

This patch fixes the issue by using the "underlying" name, which is the
name without the additional information.
2025-06-26 10:58:11 +02:00
Eugene Yokota 6a7b56a645 Default to cached task
This flips the default `:=` operation to the cached task.
To opt out of the cache, use `Def.uncached(...)` or
mark the key with `@cacheLevel(include = Array.empty)`
2025-06-21 08:54:51 +09:00
xuwei-k 8fbffad908 update dependencies 2025-06-18 07:59:10 +09:00
Eugene Yokota 41a9e3b952 fport: Add Resolver.sonatypeCentralRepo 2025-06-08 02:08:54 -04:00
xuwei-k b1eff478ce Scala 3.7.1 2025-06-03 07:50:08 +09:00
Eugene Yokota 2036ce6836 fix: Default sbtPluginPublishLegacyMavenStyle to false
**Problem**
Central Portal no longer supports the legacy sbt plugin layout.

**Solution**
Make the default more friendly by setting sbtPluginPublishLegacyMavenStyle to false.
2025-06-01 22:43:43 -04:00
Eugene Yokota cc2631af13 Mark test pending 2025-05-26 23:40:49 -04:00
Eugene Yokota ee4c51c946 filter out launcher-interface 2025-05-25 18:50:06 -04: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 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
Eugene Yokota f3dd5dbd71 fix: Fix qual lookup
**Problem**
Nested macro that expands to map or mapN fails to
find the qual because the trees end up being different
between the record scan and actual replacement.

**Solution**
First try for equals normally, then compare the show strings.
2025-05-05 03:04:44 -04:00
Eugene Yokota f07fa809f5 Add cache tests
This adds scripted test for cached compilation and tests.
2025-05-04 17:00:13 -04:00
Eugene Yokota d10e5b6f48 Add test for cache hits 2025-05-02 03:23:29 -04:00
OlegYch baa9a919ba Reproduce testQuick + object deps bug [merge-skip]
testQuick after code change doesn't rerun the test.
This was adopted from https://github.com/OlegYch/sbt-testQuick-bug
2025-03-31 21:47:02 -04:00
Eugene Yokota 4d583fa19e Split test-quick test into two [merge-skip] 2025-03-31 21:43:04 -04:00
Brice Jaglin 9ff4e1d1e9 cache semanticdb output when not included in JAR 2025-03-28 12:47:03 +01:00
Brice Jaglin 543cf45071 rename scripted 2025-03-28 11:55:35 +01:00
OlegYch 405527266d Reproduce testQuick + object deps bug
testQuick after code change doesn't rerun the test.
This was adopted from https://github.com/OlegYch/sbt-testQuick-bug
2025-03-23 22:22:02 -04:00
Eugene Yokota 690a3947f2 Split test-quick test into two 2025-03-23 22:21:06 -04:00