Commit Graph

3204 Commits

Author SHA1 Message Date
Arman Bilge 3ce8008ae7 WIP support for `releaseNotesURL` 2023-02-10 06:19:39 +00:00
Adrien Piquerez 9b4d5a5a5a Fix reporting Java diagnostics through BSP
Java diagnostics don't have a pointer but we should report them.
Copied implementation from Bloop to translate the position of an
xsbti.Problem to a BSP range.
2023-01-27 10:21:44 +01:00
Eugene Yokota b0b7705739 Fixes Debian 11 compat
Fixes https://github.com/sbt/sbt/issues/7118

Problem
-------
sbtn 1.8.1 was built using ubuntu-latest, which meant picking up newer
glibc.

Solution
--------
This downgraded the ubuntu machine to build sbtn.
2023-01-04 17:19:29 -05:00
Matthias Kurz ac638a764d
Use latest sbtn 2023-01-03 16:02:18 +01:00
Matthias Kurz 5fa46859d2
Make use of sbtn aarch64 binary where possible 2023-01-03 12:41:49 +01:00
Eugene Yokota 39dc13668f lm-coursier-shaded 2.0.12
https://github.com/coursier/sbt-coursier/releases/tag/v2.0.12
2022-10-30 18:25:04 -04:00
Nabil Abdel-Hafeez e7a847615a
Add zio-test TestFramework to default test frameworks 2022-10-16 22:42:53 +02:00
frosforever d366b77b23 Protect against missing edges in graph by using map get vs apply 2022-10-02 14:04:50 -04:00
Eugene Yokota 2a61fb35f9 Fix /tmp/.sbt/ collision for domain socket
Problem
-------
Fixes https://github.com/sbt/sbt/issues/7013
In a shared environment, multiple users will try to create
`/tmp/.sbt/` directory, and fail.

Solution
--------
Append a deterministic hash like `/tmp/.sbt1234ABCD` based
on the user home, so the same directory is used for the given
user, but each user would have a unique runtime directory.
2022-10-02 12:45:30 -04:00
eugene yokota f0cb420fe2
Merge pull request #7031 from gontard/backport_6903_to_1.8.x
Backport #6903 to 1.8.x
2022-09-30 11:43:20 -04:00
gontard cc44169fe0 Fix testQuick on changed function in object
Fix https://github.com/sbt/sbt/issues/5504
2022-09-30 11:25:31 +02:00
gontard 89acd3eed1 Improve log for not found remote cache artifact
Before
remote cache not found for 0.0.0-7c40144bd1c774e6

After
remote cache artifact not found for org.gontard:sbt-test:0.0.0-7c40144bd1c774e6 Some(cached-compile)
2022-09-30 11:07:20 +02:00
Eugene Yokota b00792a3a7 Scala 2.12.17
This bumps up scala-xml to 2.x.
2022-09-17 04:09:52 -04:00
Eugene Yokota 573cd2de81 Giter8 0.15.0 by default 2022-09-11 13:03:43 -04:00
Devin Fisher 9f9b08edbd refactor printing error to an in-function function 2022-08-10 10:08:49 -04:00
Devin Fisher 5874ad920e add output when book server socket fails to create 2022-08-10 10:08:42 -04:00
eugene yokota ab59e4c6ba
Merge pull request #6998 from ckipp01/captureCodeBsp
feat: start forwarding diagnosticCode via BSP
2022-08-10 10:03:40 -04:00
Chris Kipp 15a45cb3c0 feat: start forwarding diagnosticCode via BSP
This change is a continuation of the work that was done in
https://github.com/sbt/sbt/pull/6874 to allow the Scala 3 compiler to
forward the `diagnosticCode` of an error as well as the other normal
things. This change in dotty was merged in
https://github.com/lampepfl/dotty/pull/15565 and also backported so it
will be in the 3.2.x series release. This change captures the
`diagnosticCode` and forwards it on via BSP so that tools like Metals
can can use this code.

You can see this in the BSP trace now for a diagnostic:

For example with some code that contains the following:

```scala
val x: Int = "hi"
```

You'll see the code in the BSP diagnostic:
```  "diagnostics": [
    {
      "range": {
        "start": {
          "line": 9,
          "character": 15
        },
        "end": {
          "line": 9,
          "character": 19
        }
      },
      "severity": 1,
      "code": "7",
      "source": "sbt",
      "message": "Found:    (\u001b[32m\"hi\"\u001b[0m : String)\nRequired: Int\n\nThe following import might make progress towards fixing the problem:\n\n  import sourcecode.Text.generate\n\n"
    }
  ]
```

Co-authored-by: Adrien Piquerez <adrien.piquerez@gmail.com>
Refs: https://github.com/lampepfl/dotty/issues/14904
2022-08-09 19:02:52 +02:00
Adrien Piquerez 634e8799e7 Catch ClosedChannelException in background job logger
We want the background job to stay alive even if its terminal
has been closed and we cannot write to it anymore
2022-08-05 14:45:38 +02:00
Adrien Piquerez 592086b889 Don't use ProxyTerminal in background job
If we use the ProxyTerminal in the background jobs, the logs
would be spread across different terminals, switching from active
client to active client. We want the logs to stick
to the client that started the job.
2022-08-04 16:48:13 +02:00
Adrien Piquerez 6bcda6684a Use BackgroundJobService context instead of MainLoop context
A new context is created and closed for each state of the MainLoop.
But the context of the backgroundJob must stay alive.
So we use a context that is owned by the BackgroundJobService.
It creates a new logger for each background job and cleans it when
the job stops.
2022-08-04 16:48:13 +02:00
Krzysztof Pado 2bffb2731e Add support for BSP's buildTarget/outputPaths method 2022-08-03 10:13:48 +02:00
eugene yokota aad0464138
Merge pull request #6947 from eed3si9n/wip/banner
Banner
2022-07-02 19:20:11 -04:00
Eugene Yokota 31a6c60df3 Banner 2022-07-02 19:07:34 -04:00
Eugene Yokota 05d3d8689b Remove compatibility check from ++
Problem
-------
Since sbt-doge merger `++ <sv> <command1>` has used binary compatibility
as a test to select subproject, but it causes surprising situations like
sbt/sbt#6915, and it blurs the responsibility of YAML file and build
file as the version specified in the version can override the Scala
version test on local laptop.

Solution
--------
This removes the compatibiliy check (backward-only or otherwise),
and require that `<sv>` match one of `crossScalaVersions` using the new
Semantic Version selector pattern.
2022-07-02 18:38:04 -04:00
eugene yokota 6d0ef2093d
Merge pull request #6943 from raboof/more-appropriate-error-when-no-versions-match
Show a more appropriate message when no Scala versions matches
2022-06-28 09:26:06 -04:00
Arnout Engelen 697e3bce51
Show a more appropriate message when no Scala versions matches
When switching scala versions with a wildcard, and no subproject
has a matching version to switch to, show a more appropriate error
message
2022-06-28 14:43:06 +02:00
Arnout Engelen 6a79bdb461
Show a more useful log message when doing a flexible version switch
Suggested by @SethTisue in https://github.com/sbt/sbt/pull/6894#issuecomment-1168042209

Will show multiple lines when different versions are selected for different subprojects.

When no subprojects have a matching Scala version you will get a
'Switch failed' exception anyway, so in that case there is no
change in behavior.
2022-06-28 07:59:13 +02:00
Rui Gonçalves 705d3d58ce Filter incompatible Scala 3 projects in cross switch commands 2022-06-26 22:46:37 -04:00
Arnout Engelen 8973fce1fa
More flexible Scala version switch
By using SemanticSelector instead of custom globbing.

Follow-up on https://github.com/sbt/sbt/pull/6894,
fixes https://github.com/sbt/sbt/issues/6934
2022-06-26 12:43:41 +02:00
eugene yokota 1db7dd328a
Merge pull request #6935 from eed3si9n/wip/temp-directories
[1.7.x] Fix sbt trying to delete /tmp on ARM Macs
2022-06-25 20:23:39 -04:00
Eugene Yokota 87dc5da93a Fix sbt trying to delete /tmp on ARM Macs
Problem
-------
There's a bug in ipcsocket cleanup logic that effectively
tries to wipe out /tmp.

Workaround
----------
We should fix the underlying bug, but we can start by
explicitly configuring the temp directories ipcsocket uses.

Ref https://github.com/sbt/sbt/issues/6931
2022-06-25 18:58:19 -04:00
Kamil Podsiadlo 7921cab7e3 fix: publishing bsp diagnostics
* do not publish bsp diagnostics if there were and there are no problems
* publish diagnostics if problems needs to be updated
2022-06-25 11:14:51 +02:00
Arnout Engelen cd915845db Add support for wildcards in Scala version switch
Picking from the `crossScalaVersions`

As discussed in https://github.com/sbt/sbt/discussions/6893
2022-06-24 01:41:38 -04:00
eugene yokota 290925fd99
Merge pull request #6916 from eed3si9n/wip/revert-6814
[1.7.x] Revert "Add support for scala-output-version flag in Scala 3"
2022-06-13 01:57:48 -04:00
Eugene Yokota d9e43ecfdf Revert "Add support for scala-output-version flag in Scala 3"
This reverts commit 1e89d71311.
2022-06-13 01:28:37 -04:00
Eugene Yokota d5889d3ce3 Bump to Scala 2.12.16 2022-06-13 01:27:24 -04:00
Eugene Yokota c04b2a4f73 lm 1.7.0-M1
This removes OkHttp dependency.
This also removes an experimental feature to customize HTTP for Ivy called
CustomHttp we added in sbt 1.3.0.
Since LM got switched to Coursier in 1.3.0, I don't think we advertized
CustomHttp.
2022-06-13 00:52:32 -04:00
xuwei-k 45518c7f24 Update semanticdbVersion 2022-04-17 18:32:14 -04:00
Ethan Atkins ca7c872e27 Restore watchOnTermination
At some point the watchOnTermination callback stopped working. I'm not
exactly sure how or why that happened but it is fairly straightforward
to restore. The one tricky thing was that the callback has the signature
(Watch.Action, _, _, _) => State, which requires propagating the action
to the failWatch command. The easiest way to do this was to add a
mutable field to the ContinuousState. This is rather ugly and reflects
some poor design choices but a more comprehensive refactor is out of
the scope of this fix.

This commit adds a scripted test that ensures that the callback is
invoked both in the successful and unsuccessful watch cases. In each
case the callback deletes a file and we ensure that the file is indeed
absent after the watch exits.
2022-04-17 18:31:54 -04:00
Kamil Podsiadlo faf8dfde72 bsp: add JVM test/run env capabilities to BSP 2022-04-16 13:46:12 +02:00
Kamil Podsiadlo 6eb911ad15 refactor: simplify JVm environment requests
refactor: extract common logic to the `bspInputTask`
2022-04-12 20:09:35 +02:00
Kamil Podsiadlo ad4113caeb feat: implement BSP's JVM environment requests 2022-04-12 20:09:31 +02:00
eugene yokota d065f38576
Merge pull request #6854 from eed3si9n/bport/6847
[1.7.x] Do not fire `build/publishDiagnostics` if there are (and were) no problems
2022-03-27 00:55:00 -04:00
Rikito Taniguchi 620c55d6ac Re-publish warnings on BSP server startup
Imitate 8aaf828b03
2022-03-27 00:12:23 -04:00
Rikito Taniguchi 862d373f02 Don't fire publishDiagnostic if there's no problems both in current and previous compilation 2022-03-27 00:12:14 -04:00
Brice Jaglin 491f70cd30 includePluginResolvers should work for coursier resolutions 2022-03-27 00:06:55 -04:00
Michał Pałka 1e89d71311 Add support for scala-output-version flag in Scala 3 2022-03-24 15:35:57 +01:00
Kamil Podsiadlo ce978a19ed tests: add test case for framework field in scala test classes request 2022-03-10 19:56:49 +01:00
Kamil Podsiadlo 23b50688ba feat: add optional framework field to the bsp 2022-03-04 10:53:25 +01:00