Commit Graph

3732 Commits

Author SHA1 Message Date
Eugene Yokota d10e5b6f48 Add test for cache hits 2025-05-02 03:23:29 -04:00
Eugene Yokota 2fd08caeda Scala compiler plugin support
**Problem**
Compiler options for the compiler plugins ends up capturing the absolute path, specific to the machine.

**Solution**
This encodes the plugin paths as virtual paths.
2025-05-01 00:15:42 -04:00
Eugene Yokota 1415b2efa4 fix: Fix incremental test with companion objects [merge-skip]
**Problem**
Incremental test (aka testQuick) has a bug when companion objects
depends on others since at some point it's failing to look up relationship from Zinc analysis.

**Solution**
This fixes the lookup.
2025-03-31 22:44:57 -04:00
Brice Jaglin 9ff4e1d1e9 cache semanticdb output when not included in JAR 2025-03-28 12:47:03 +01:00
Eugene Yokota 2f4280c6f3 fix: Fix incremental test with companion objects
**Problem**
Incremental test (aka testQuick) has a bug when companion objects
depends on others since at some point it's failing to look up relationship from Zinc analysis.

**Solution**
This fixes the lookup.
2025-03-23 22:25:16 -04:00
Eugene Yokota 12d2cc8ef1 fix: Use Retry.io for compilation
**Problem**
sbt 1.10.10 still has retry problem with compilation.

**Solution**
Revert the retry logic back to the time when we only retried IOExceptions.
2025-03-16 21:43:01 -04:00
Eugene Yokota bd7bf73de5 fix: Fix SIP-51 message
**Problem**
The error message uses name, which may not match the actual project id
that the user can type into the shell.

**Solution**
Use displayBuildRelative to calculate the proper subproject id.
2025-03-16 14:58:23 -04:00
Eugene Yokota de5c9b1869 Scala 3.6.4 2025-03-10 01:51:32 -04:00
Brice Jaglin 80ac808619
Remove debug println 2025-03-10 02:37:15 +01:00
Eugene Yokota 8db8c79d33 Implement client-side run
**Problem**
`run` task has been emulated via function call inside of a sandboxed classloader,
and blocking the command processing of sbt server loop.
This poses isolation and availability issues.

**Solution**
This implements client-side run where the server creates a sandbox environment, and sends the information to the client,
and the client forks a new JVM to perform the run.
The client-side behavior has been implemented in sbtn side already.
2025-03-09 15:00:24 -04:00
Eugene Yokota 2c3c0f4a7c Merge branch '1.10.x' into wip/merge-1.10.x 2025-03-08 19:05:30 -05:00
Eugene Yokota 946b54c858 Skip retry on CompileCancelled
**Problem**
When compilation fails, it's retrying 10 times
since Retry now retries on non-IOExceptions.

**Solution**
This adds CompileFailed to excluded exception list.
2025-03-03 22:19:22 -05:00
Eugene Yokota 5d5fe21ec5 Revert run switching on 1.x
**Problem**
client-side run apparently won't work for Scala.JS,
so forcing sbtn users to client-side run will break the Scala.JS users.

**Solution**
This reverts the client-side run on sbt 1.x, while retaining the
mechanism for sbt 2.x usages via sbtn.
Now, if `run / connectInput := true` is true, stdout will not display on sbtn.
2025-03-03 04:59:36 -05:00
Eugene Yokota a18ed19cbc fix: Use JDK path, not JRE path
**Problem**
There are a few places where javaHome or java path is set,
using java.home system property. The problem is that it points to JRE,
not JDK, so it would break on Java compilation etc.

**Solution**
If the path ends with jre, go up one directory.
2025-03-03 02:31:44 -05:00
Eugene Yokota 67265638c6 Implement client-side run
**Problem**
`run` task blocks the server, but during the run the server is just
waiting for the built program to finish.

**Solution**
This implements client-side run where the server creates a sandbox
environment, and sends the information to the client,
and the client forks a new JVM to perform the run.
2025-03-02 20:45:04 -05: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
Eugene Yokota cb63de6574 Merge branch '1.10.x' into wip/merge-1.10.x 2025-02-10 02:43:30 -05:00
eugene yokota 971991c72f
Merge pull request #8033 from eed3si9n/wip/inputtaskdyn
[2.x] Implement Def.inputTaskDyn
2025-02-07 20:38:57 -05:00
Adrien Piquerez 711df2cbf2 Internal usage of inputTaskDyn 2025-02-07 12:02:16 +01:00
Eugene Yokota 11cd58daa7 Implement Def.inputTaskDyn
**Problem/Solution**
This implements Def.inputTaskDyn using Scala 3 macros.
2025-02-05 02:04:22 -05:00
Dmitrii Naumenko a7d862a08b detect user-specific jdk installations on macOs (fixes #8031)
User-specific JDKs are installed, for example, by IntelliJ IDEA
2025-02-04 18:11:40 +01: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 c6b7b5a061 [2.x] fix: Fix semanticdbEnabled
**Problem**
semanticdbEnabled doesn't work on sbt 2.x
1. classes directory has changed during compilation
2. semanticdb scalacOptions are duplicated for Test

**Solution**
1. change to using the backend directory
2. reimplement scalacOptions handling
2025-02-01 01:28:57 -05:00
Dmitrii Naumenko 9352e1cdad [2.x] fix: updateSbtClassifiers task fails with error (#8022)
In `classifiersModuleTask` we now don't include the full plugin classpath, but include only the dependency classpath (effectively excluding sbt.PluginData.definitionClasspath). Only items from the dependency classpath are considered to be published. Only for them we can download classifier artifacts later in the `updateSbtClassifiers` pipeline.

This also fixes integration test "dependency-management/update-sbt-classifiers".
I also made the test stricter, it now tests the module ids that are included in the sbt classpath.
2025-01-29 14:54:09 +01:00
Josh Soref 2ee5eb7fa7 Make timing outputs consistently show hours and hint at time format
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2025-01-29 04:20:37 -05:00
Eugene Yokota 55b1fdeddb fix: Fix Chrome tracing file
**Problem**
We changed the content of Chrome tracing file incorrectly
and renamed tid to tname.

**Solution**
1. This renames tname back to to tid.
2. To retain the fix to avoid Thread#getId, this calls
   either the JDK 8 way or the JDK 19 way reflectively.
2025-01-28 04:11:36 -05:00
Josh Soref 0493dee315 Make timing outputs consistently show hours and hint at time format
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2025-01-27 12:42:53 -05:00
Lukas Rytz e46843bfd9 Add setting to allow demoting the SIP-51 build failure
Add a `allowUnsafeScalaLibUpgrade` setting (default is `false`) to
demote the SIP-51 build failure to a warning.

If the scalaVersion is 2.13.12 but some dependency pulls in
scala-library 2.13.13, the compiler will stay at 2.13.12, but
the dependency classpath will contain scala-library 2.13.13.

This usually works, the compiler can run fine with a newer
scala-library on its dependency classpath.
Macro expansion may fail, if the macro uses some library
class / method that doesn't exist in the old version.
The macro itself is loaded from the dependency classpath
into the class loader running the compiler, where the older
Scala library is on the runtime classpath.
Using the Scala REPL in sbt may also fail in a similar fashion.
2025-01-20 10:00:13 +01:00
eugene yokota 873f8b1261
Merge branch 'develop' into wip/run 2025-01-12 18:05:11 -05:00
Eugene Yokota 08fcea4c77 refactor: Refactor MainLoop.scala
**Problem/Solution**
This refactors MainLoop.scala.
2025-01-12 03:03:03 -05:00
Eugene Yokota cd09003583 fix: Fix sbtn not showing run
**Problem**
Currently sbtn doesn't correctly display the stdout
during `run` because by the time it starts the terminal has been reset.

**Solution**
Don't reset the terminal in-between the tasks.
2025-01-12 02:24:23 -05:00
Eugene Yokota bcad9f6887 fix: Fix run getting stuck
**Problem**
When the run ends too quickly it gets stuck.

**Solution**
This doesn't pause the channel if the job is already done.
2025-01-12 01:30:12 -05:00
Derek Wickern f0afda3dd0 make NetworkChannel#thread private 2025-01-11 13:08:18 -08:00
Derek Wickern a13bfd3ef9 fix race condition in NetworkChannel 2025-01-11 12:46:35 -08:00
xuwei-k da26f3078b use withFilter instead of filter 2025-01-04 09:10:36 +09:00
xuwei-k 614d9ce985 remove unused private val and def 2025-01-02 18:48:32 +09: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
eugene yokota 734d06a3c6
Merge pull request #7996 from xuwei-k/enum-sealed-trait 2025-01-01 22:04:23 -05:00
xuwei-k 13d6626564 update .scalafmt.conf. enforce new scala 3 syntax 2025-01-02 11:25:34 +09:00
xuwei-k a7ba960c17 use enum instead of sealed trait 2025-01-02 10:52:37 +09:00
xuwei-k e0a51807bc change to using param anonymous if possible 2025-01-02 10:35:15 +09:00
xuwei-k d7ec1013da remove unused type params 2025-01-01 18:42:59 +09:00
eugene yokota 8be482533a
Merge pull request #7991 from xuwei-k/lazyZip
[2.x] use `lazyZip`
2025-01-01 03:06:26 -05:00
eugene yokota 308af6c695
Merge pull request #7990 from xuwei-k/extaHashes-typo
[2.x] fix typo
2025-01-01 03:05:58 -05:00
eugene yokota 6a3f16de7c
Merge pull request #7988 from xuwei-k/correspond-file-class-name
[2.x] correspond file name and class name
2025-01-01 03:05:08 -05:00
eugene yokota df6e1bc2aa
Merge pull request #7986 from xuwei-k/string-interpolation-format-s
[2.x] use string interpolation instead of `format` method
2025-01-01 03:03:43 -05:00
xuwei-k 5c5a14aac5 use lazyZip 2025-01-01 16:34:54 +09:00
kenji yoshida 26eaee1ac1
fix typo 2025-01-01 16:29:51 +09:00
xuwei-k 2167a72ac3 correspond file name and class name 2025-01-01 16:12:30 +09:00
xuwei-k 13563f9d49 use string interpolation instead of `format` method 2025-01-01 16:02:11 +09:00
xuwei-k 3d6286edc2 remove unnecessary vararg splice 2025-01-01 15:47:55 +09:00
friendseeker c834f500b9
Add comment 2024-12-30 19:30:15 -08:00
Friendseeker 1a8fa65af3 Avoid upstream compilation when calling previousCompile 2024-12-30 17:55:42 -08:00
eugene yokota 439e24fb84
Merge pull request #7979 from eed3si9n/wip/retry 2024-12-30 08:47:04 -05:00
adpi2 011c7083ad
Merge pull request #7913 from Friendseeker/sbt-7510
[1.x] Implement `jvmBuildTarget` for `workspace/buildTargets`
2024-12-30 09:06:53 +01:00
xuwei-k f255c38892 use toIntOption instead of scala.util.Try 2024-12-30 13:13:53 +09:00
Eugene Yokota 799bd65ba5 fix: Retry create directory
**Problem**
Files.createDirectories can fail.

**Solution**
Use IO version, which retries.
2024-12-29 03:18:18 -05:00
Eugene Yokota 515cae27a8 Cache terminal capability
**Problem**
JSON-RPC is currently full of terminal capability query
since JLine seems to be asking them for each line.

**Solution**
This caches the query.
2024-12-28 04:09:01 -05:00
Friendseeker 13373415b3 Fix CI 2024-12-26 18:43:04 -08:00
friendseeker e23419efed Clean Zinc Cache for 'Compile / clean', 'Test / clean' 2024-12-26 15:37:33 -08:00
Friendseeker ad0ab07e99 Return jvmBuildTarget for workspace/buildTargets 2024-12-26 12:24:14 -08:00
Eugene Yokota de04f1f847 Update lm-coursier to 2.1.7
**Problem**
BOM support current has perf issues.

**Solution**
This bumps Coursier to 2.1.22.

This also adds a new setting `csrMavenDependencyOverride`,
which will default to false.
2024-12-22 19:59:49 -05:00
Eugene Yokota 8e13a43f48 Zinc 2.0.0-M3 2024-12-18 00:26:30 -05:00
Eugene Yokota 12db63951b Address reviews 2024-12-16 22:22:33 -05:00
Eugene Yokota 3d86f30837 Merge branch '1.10.x' into wip/merge-1.10.x 2024-12-16 03:20:10 -05:00
Eugene Yokota 0906b2d7ac fix: Use JDK path, not JRE path
**Problem**
There are a few places where javaHome or java path is set,
using java.home system property. The problem is that it points to JRE,
not JDK, so it would break on Java compilation etc.

**Solution**
If the path ends with jre, go up one directory.
2024-12-15 02:47:35 -05:00
Eugene Yokota c3e4bc53c4 Giter8 0.17.0
**Problem/Solution**
Bump to Giter8 0.17.0.
2024-12-14 01:42:48 -05:00
Matthew de Detrich eea840be2c Replace tuple with proper record type for licenses 2024-12-05 00:56:39 -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
Eugene Yokota ac4ba55e9e fix: Fix root project detection
**Problem**
Whether a subproject is root or not is currently detected by
comparing getCanonicalFile against the build base directory.
Problem is that often the root project uses "." as the directory,
and getting the canonical file works ok for the current build,
but it breaks when loading `ProjectRef`.
There might be other bugs related to the root project detection.

**Solution**
This factors out `isRootPath` function that's aware of the build base.

This PR adds the repro test prepared by xuwei-k.
2024-12-02 03:15:35 -05:00
Eugene Yokota 56e83977e9 fix: Remove -Wconf:cat=unused-nowarn:s
**Problem**
Currently the following warning shows up while compiling metabuild:

[warn] Failed to parse `-Wconf` configuration: cat=unused-nowarn:s
[warn] unknown category: unused-nowarn

-Wconf:cat=unused-nowarn in general was added as a Scala 2.12 of
falsely warning about pure expression not doing anything in the macro.

**Solution**
We should be able to remove the -Wconf flag in sbt 2.x.
2024-12-01 18:09:38 -05:00
Eugene Yokota 111eb123fa Call store.clearCache() 2024-11-30 00:51:20 -05:00
Eugene Yokota efe2a83c73 Zinc 1.10.5 2024-11-30 00:05:26 -05:00
eugene yokota f03ff1f32b
Merge pull request #7916 from Friendseeker/ctrl-c-background-task 2024-11-27 20:23:28 -05:00
friendseeker b49fe9dc97
Add boolean flag isAutoCancel
Address PR feedback from Eugene
2024-11-27 01:30:01 -08:00
friendseeker e613cb70ea
Avoid generation of negative frequency 2024-11-27 00:52:57 -08:00
Friendseeker 9494033bd6 Shutdown background jobs when pressing ctrl+c 2024-11-26 23:40:23 -08:00
friendseeker eefc89605e Improve message format for loading settings 2024-11-26 16:46:48 -08:00
Eugene Yokota eb7d43c363 Refactor RefThenConfig to be an opaque type 2024-11-26 04:55:08 -05:00
Eugene Yokota 70d7ddb258 Refactor slash syntax to mostly use methods
**Problem**
Slash syntax is currently implemented via a series of implicit
converters (Conversion), which is not nice, partly because
the behavior is difficult to follow.

**Solution**
This removes all the implicit converters and moves the slashes
into:
1. / methods under Reference for subproject scoping.
2. / methods under ScopeAxis with Reference type constraint
   for the initial Zero scoping.
3. Return RefThenConfig structure for intermediate config scoping.
4. / method under `Scoped`, which is base trait for the keys
   to implement task scoping e.g. `compile / scalacOptions`.
5. Extension methods for ConfigKey.
6. Extension methods for AttributeKey.
2024-11-25 04:54:40 -05:00
Eugene Yokota 4e3fbcced9 Refactor ScopeAxis to use enum 2024-11-24 23:10:18 -05:00
Eugene Yokota 56377274b7 fix: Fix Scala 3.x - 2.12 sandwich for matrix
Problem
Currently Scala 3.x - 2.13 sandwich doesn't seem to work for projectMatrix.
This is due to isScala2Scala3Sandwich checking for "3." while projectMatrix
uses scalaBinaryVersion, which is 3.

Solution
This consolidates the implementation of isScala2Scala3Sandwich with the one
in Defaults module, and check for both "3" and "3."
2024-11-23 04:05:28 -05:00
eugene yokota f25fde18a4
Merge pull request #7906 from Friendseeker/sbt-6905
[1.x] Synchronize `dependencyTree` console output
2024-11-22 16:28:40 -05:00
eugene yokota 0ec6424a51
Merge pull request #7905 from Friendseeker/sbt-7828
[1.x] Synchronize `java.awt.Desktop.browse()`
2024-11-22 00:30:59 -05:00
Friendseeker 27cec84333 Synchronize dependencyTree console output 2024-11-21 17:36:22 -08:00
Friendseeker de4c3da451 Add synchronized for desktop.browse() 2024-11-21 17:02:15 -08:00
Friendseeker c8940bfba0 Respect dependencyBrowseGraphTarget, dependencyBrowseTreeTarget 2024-11-21 16:24:49 -08:00
xuwei-k d8705bbac0 use given instead of implicit object 2024-11-18 17:09:03 +09: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
friendseeker 1ec08180f7
Remove enableConsistentCompileAnalysis & enableBinaryCompileAnalysis 2024-11-16 21:27:29 -08:00
friendseeker b4e9469816
Add double quote around thread name 2024-11-16 13:16:40 -08:00
Eugene Yokota 29c77f6f5f Merge branch 'develop' into wip/scalainstance 2024-11-14 22:02:10 -05:00
adpi2 4c66e5a907
Merge branch 'develop' into 2.x-fuse-info 2024-11-13 17:08:37 +01:00
Adrien Piquerez 0ccf3325c8 Optimize indexing of aggregate keys
To build the index of all aggregate keys, we were computing the reverse
aggregation of each key, before indexing them.
And so each aggregate key was indexed many times, once for each
aggregated project. It was parallelized to reduce the latency.
In this PR, we compute the reverse aggregation of all the keys at once,
removing all duplication. We cannot parallelize this process anymore
but we don't need to, because it is a lot faster. It reduces the total
CPU time by 12%. The impact for the user depends on its number of cores.
2024-11-13 12:25:31 +01:00
Adrien Piquerez f4f185a1c1 Settings as a Map[ScopedKey[x], x]
Settings0 used to be a Map[Scope, AttributeMap], and is now a
Map[ScopedKey[x], x].
This is better because we don't need to decompose all ScopedKey[x]
into a Scope and an AttributeKey[x], for recomposing it back later,
which duplicates all ScopedKey[x]. It reduces the number of long-living
ScopedKey[x] by 8%, and the total number of instances by 1.4%.

Also it improves the performance of Settings0, which was responsible of
2.95% of the total CPU time, and is now responsible of 0.41%.
2024-11-13 12:25:31 +01:00
Adrien Piquerez 327d05e28f Remove unused Structure.taskToKey 2024-11-13 11:22:53 +01:00
Adrien Piquerez d54647a46c Use referential equality on Task 2024-11-13 10:55:29 +01:00
Eugene Yokota cfbc5c078a Merge branch 'develop' into wip/scalainstance 2024-11-13 00:31:53 -05:00
Adrien Piquerez e5cedbe56b Fuse Info in Task to reduce instances 2024-11-12 17:05:20 +01:00
Adrien Piquerez 6c226a2afd Reduce settings created by Defaults 2024-11-12 11:51:42 +01:00
Adrien Piquerez 8406fc86a8 Reduce settings created by ProjectMatrix 2024-11-12 11:51:42 +01:00
Adrien Piquerez 07ac8625e5 Reduce settings created by dependency-tree plugins 2024-11-12 11:51:31 +01:00
Eugene Yokota 258a831b03 Use ScalaInstance from update
**Problem**
doc task currently doesn't work.

**Solution**
For now turn off the optimized ScalaInstance
2024-11-12 03:44:52 -05:00
eugene yokota 583939fc3c
Merge pull request #7874 from xuwei-k/ClassLoaderWarmup-scala-2-universe
[2.x] update ClassLoaderWarmup.scala
2024-11-06 03:47:09 -05:00
xuwei-k 6e4c2ea275 update ClassLoaderWarmup.scala 2024-11-06 14:17:13 +09:00
Adrien Piquerez 2f726cddf0 Add comments 2024-11-05 11:36:18 +01:00
Friendseeker 8ce6c1b47e Pass `useConsistent` to `staticCachedStore` 2024-11-04 13:21:08 -08:00
Adrien Piquerez 8b5eaa2cd5 Cache delegates during Load 2024-11-04 10:43:42 +01:00
Eugene Yokota f8280f14c8 Fix ++ with a command argument
**Problem**
sbt 1.10.0 added support for ++ command with external reference,
but broke ++ takes an aggregate command with slash.

**Solution**
This fixes the parser
2024-11-03 14:42:10 -05:00
friendseeker fae2bcc01b
Add documentation & deduplicate implementation 2024-10-29 21:40:51 -07:00
Friendseeker 92d4cfa690 Replace nnbsp with regular space 2024-10-29 17:43:33 -07:00
Friendseeker 828dc04808 Migrate all usages of `System.console == null` 2024-10-28 18:25:16 -07:00
eugene yokota 64f0acf05f
Merge pull request #7838 from Friendseeker/sbt-7017
[1.x] Pass reload action for `watchOnTermination` callback
2024-10-28 02:23:38 -04:00
friendseeker 6d4d2161b2
Set correct action for onTermination callback 2024-10-27 22:43:44 -07:00
eugene yokota 4e15180596
Merge pull request #7830 from Friendseeker/remove-early-output-version
[1.x] Use generic early output file name
2024-10-28 01:12:58 -04:00
Eugene Yokota 56941dac04 refactor: Update Scala 3 syntax 2024-10-27 23:55:30 -04:00
Eugene Yokota 14f7d29afc Contraband 0.7.0 2024-10-27 16:21:18 -04:00
friendseeker 7d674f6c93
Throw when template not found 2024-10-26 22:10:48 -07:00
Friendseeker 4beb78b260
Adopt PR feedbacks 2024-10-26 16:24:45 -07:00
xuwei-k 6922915949 use extension instead of implicit class 2024-10-26 09:05:27 +09:00
friendseeker 5e7fe0b158
Use more generic early output file name 2024-10-24 22:00:51 -07:00
eugene yokota 36fb500f8c
Merge pull request #7811 from Friendseeker/use-jline-jni
[1.x] Use `jline-terminal-jni` to replace deprecated Jansi & JNA Provider
2024-10-23 10:14:39 -04:00
philippus 1ba63a1c07
Deprecate useJCenter key 2024-10-23 07:56:00 +02:00
xuwei-k 7ecae27b3d use extension in OptionSyntax 2024-10-23 13:29:30 +09:00
xuwei-k 34832a1c3e delete sbt.internal.CompatParColls 2024-10-23 08:47:38 +09:00
xuwei-k ec70bae39a use extension instead of implicit class 2024-10-23 07:05:38 +09:00
Friendseeker 0e85726858 Use JNI to replace deprecated Jansi & JNA 2024-10-22 13:05:20 -07:00
xuwei-k 00d01ce215 Update scalafmt 2024-10-22 19:58:21 +09:00
friendseeker 9d5cddd171
Let Consistent Analysis to be opt-in by default 2024-10-21 22:00:25 -07:00
Friendseeker a959acd230 Fix more compile errors 2024-10-21 21:38:59 -07:00
Friendseeker b1c4c09a7f Fix bunch more compiler errors 2024-10-21 21:38:59 -07:00
Friendseeker 375e4f1d2e Fix bunch of unused imports 2024-10-21 21:38:59 -07:00
eugene yokota b8bef9d0b9
Merge pull request #7803 from Friendseeker/template-port-2
[2.x] update to latest versions in TemplateCommandUtil
2024-10-21 21:42:29 -04:00
eugene yokota 32464d382c
Merge pull request #7797 from Friendseeker/bump-scala-2
[2.x] Bump Scala 2.12 to 2.12.20
2024-10-21 21:41:28 -04:00
eugene yokota c39d74d062
Merge pull request #7801 from xuwei-k/delete-useJCenter
[2.x] delete `useJCenter` settingKey
2024-10-21 21:36:15 -04:00
kenji yoshida fe523c50bc update to latest versions in TemplateCommandUtil 2024-10-21 17:10:33 -07:00
xuwei-k 026f78d056 delete useJCenter settingKey 2024-10-22 09:00:05 +09:00
xuwei-k a99398eb84 update sbtResolvers default value 2024-10-22 07:25:22 +09:00
Friendseeker dd16c9b0db Bump Scala 2 to 2.19.20 2024-10-21 15:11:52 -07:00
SlowBrainDude b1b5caa1ca Fix stale BSP diagnostics
The BSP server didn't reset old diagnostic messages sent to BSP clients under
certain circumstances. This commit mitigates this edge case and ensures that
diagnostics for files that previously had compilation problems are properly
reset when fresh diagnostics messages are sent.

The culprit was a mismatch of map keys: Files with problems were sometimes recorded
under an absolute path, but later attempted to be retrieved by virtual path.
2024-10-21 12:18:41 -07:00
James Roper 4b75c97f69 Include ALL sources, and resources in source jar
This follows on from #7470, to include all sources, not just managed and
unmanaged, in the source jar, along with all resources (previously only
unmanaged resources were included).

This means that if, for whatever crazy reason, someone does modify the
`sources` task to include additional sources or filter out sources, rather than
using the managed or unmanaged source mechanisms, their changes will still be
reflected in the source jar.
2024-10-19 23:09:51 -07:00
Eugene Yokota b7a687356f deps: Zinc 1.10.3 2024-10-19 12:15:16 -04:00
xuwei-k 6bf5b8b30f Update contraband sources 2024-10-18 20:34:44 +09:00
xuwei-k 6372c2056a fix old `in` syntax 2024-10-15 14:54:52 +09:00
Adrien Piquerez c82f13c2db Fix csrCacheDirectory and add test 2024-10-14 15:35:14 +02:00
adpi2 6d6cbce465
Merge pull request #7739 from adpi2/2.x-lm-coursier
[2.x] Merge librarymanagement and sbt-coursier
2024-10-11 16:14:17 +02:00
Seth Tisue f06b7622be Scala 2.12.20 (was .19) 2024-10-10 12:53:31 -07:00
Eugene Yokota 65bc3d9722 fix: Resurrect or for tasks
**Problem**
1. `or` is missing
2. `?` should have English method name

**Solution**
1. This resurrects `or`
2. Name `??` as `option`, since `get` is taken
2024-10-10 02:39:52 -04:00