Commit Graph

2916 Commits

Author SHA1 Message Date
Adrien Piquerez 22e5308381 Fix BSP warning about semanticdb 2020-10-22 16:18:12 +02:00
eugene yokota 9f7985a2d9
Merge pull request #5991 from eed3si9n/wip/release-lint
Exclude keys starting with some prefixes from linting
2020-10-19 15:36:33 -04:00
Eugene Yokota 5d876dc287 Exclude keys starting with some prefixes from linting
Fixes https://github.com/sbt/sbt/issues/5849
2020-10-19 13:31:30 -04:00
Guillaume Martres c44e2c63bc Properly log the ClassfileManager output 2020-10-19 12:57:45 -04:00
eugene yokota 28833db333
Merge pull request #5983 from xirc/issues/5955
Add `shellPrompt` into excludeLintKeys
2020-10-18 04:06:28 -04:00
xuwei-k bbdd11150b remove unused code 2020-10-18 15:11:41 +09:00
xuwei-k d582dfc4be Scala-2-dependsOn-Scala-3 feature with Scala.js
fix 5971
2020-10-18 15:11:41 +09:00
Taichi Yamakawa cb7a08dfe2 Add `shellPrompt` into excludeLintKeys
Resolve the issue https://github.com/sbt/sbt/issues/5955
2020-10-18 14:54:54 +09:00
eugene yokota d0b8cf0984
Merge pull request #5932 from aaabramov/feature/3212/new-plugins-view
Brings new `plugins` command output message as per #3212
2020-10-11 13:19:16 -04:00
eugene yokota f02edee1d5
Merge pull request #5956 from adpi2/improve-bsp-reporter
Fix #5950: Better BSP reporting
2020-10-11 13:16:30 -04:00
eugene yokota 21c73c5bd7
Merge pull request #5967 from naderghanbari/fix-5959-dep-html
Fix #5959: dependencyBrowseGraph fails with Couldn't load 'graph.html'
2020-10-11 13:15:08 -04:00
eugene yokota b806d3ed3d
Merge pull request #5964 from rdesgroppes/detect-adoptopenjdk-on-macos
Detect AdoptOpenJDK on macOS
2020-10-11 13:12:15 -04:00
eugene yokota 916498c0c2
Merge pull request #5948 from adpi2/fix-custom-reporter
Fix #5935: Introduce bspReporter key
2020-10-11 13:10:34 -04:00
Nader Ghanbari 75be157679 Use cdnjs and github instead of samsarin.com 2020-10-11 12:03:32 -04:00
Adrien Piquerez efb8bc4ec0 Use Zinc analysis in BuildServerReporter 2020-10-11 09:09:13 +02:00
Adrien Piquerez 93ad022dca Introduce bspReporter key 2020-10-11 09:08:12 +02:00
Nader Ghanbari 495118a297
Fix #5959 add missing html resources
- Add missing graph.html and tree.html resources from
https://github.com/sbt/sbt-dependency-graph
2020-10-10 23:00:20 -04:00
Regis Desgroppes 63b375aa0f Detect AdoptOpenJDK on macOS 2020-10-09 17:07:42 +02:00
xuwei-k e0e11c71d5 preserve semanticdb files in pullRemoteCache task 2020-10-09 17:54:35 +09:00
Andrii aae6493701
Merge branch 'develop' into feature/3212/new-plugins-view 2020-10-06 23:08:41 +03:00
Andrii Abramov 6061072937 Brings new `plugins` command output message as per #3212 2020-10-06 23:06:38 +03:00
Adrien Piquerez af4deaaab1 fix BSP on custom configs 2020-10-05 13:22:48 +02:00
Eugene Yokota 081f437afc Banner URL
Fixes https://github.com/sbt/sbt/issues/5921
2020-10-04 00:10:30 -04:00
Eugene Yokota c11259ee2f Epoch directory src/main/{scala-2, scala-3}
Fixes https://github.com/sbt/sbt/issues/5895
2020-10-03 22:52:06 -04:00
Eugene Yokota 6662b2cf99 lm-coursier-shaded 2.0.0
Uses Coursier 2.0.0
2020-10-02 23:07:27 -04:00
Eugene Yokota 51466e7b84 Rename some sbt-dependency-graph keys
Fixes https://github.com/sbt/sbt/issues/5894
2020-10-01 09:28:44 -04:00
eugene yokota 34d1e62f27
Merge pull request #5908 from eatkins/scala-2.12-thin-client-console
Fix echo setting for scala 2.12 thin client console
2020-10-01 05:33:56 -04:00
Ethan Atkins 16bef0cfc8 Don't block sbt exit forever on bg service shutdown
Some of the sbt scripted tests somewhat frequently hang in CI. I added a
patch that printed a stack trace of the sbt process every 30 seconds. I
discovered that the main thread was stuck in DefaultBackgroundJobService
shutdown. To avoid the hangs, I updated the awaitTermination methods to
take a timeout parameter and we timeout shutdown if 10 seconds have
elapsed.
2020-09-29 11:48:51 -07:00
Ethan Atkins 7eaa46800a Fix echo setting for scala 2.12 thin client console
I noticed that when using the scala 2.12 console with the thin client
that there was weird behavior for the first few seconds of the session.
When prompted with 'scala> ' I would type a letter, say v, and the
output would be 'scala>v' instead of 'scala> v'. It turned out that this
was because the NetworkChannel was returning a stale value for
isEchoEnabled. This happened because NetworkChannel has a method
getProperties that is rate limited under the assumption that the
properties rarely change. This made sense for things like
isAnsiSupported or isSuperShellEnabled but not isEchoEnabled. It is
straightforward to fix this by actually getting the terminal attributes
and checking if the echo flag is set.
2020-09-29 10:21:44 -07:00
Ethan Atkins 3966d2fcb2 Catch interrupted exceptions in blockUntilNextExec
It is possible for an InterruptedException to be thrown here because of
logic in NetworkClient. This seemed to be the root cause of the fix I
tried in ca251eb7c8 so I'm reverting that
commit.

Revert "Catch interrupted exception in shell"

This reverts commit ca251eb7c8.
2020-09-28 07:28:24 -07:00
Ethan Atkins c2c2a26203 Don't throw on closed completion service
In 64c0f0acdd, I attempted to safely close
all of the completion services when the user inputs ctrl+c. I have
noticed though that sometimes sbt crashes in CI with the
RejectedExecutionException thrown by submit. To avoid throwing when
there was no cancellation, I slightly modified the shutdown logic to not
shutdown the completion service whil still shutting down the underlying
thread pool.
2020-09-28 07:03:27 -07:00
Ethan Atkins b85209be78 Add sbt.Terminal trait
It can be useful for plugin and build authors to have access to some of
the virtual terminal properties. For instance, when writing a task that
needs a password, the author may wish to put the terminal in raw mode
with echo disabled. This commit introduces a new Terminal trait at the
sbt level and a corresponding task, terminal, that provides a basic
terminal api. The Terminal returned by the terminal task will correspond
to the terminal that initiated the task so that it should work with sbtn
as well as in console mode.
2020-09-27 13:33:47 -07:00
Ethan Atkins 411c1365ef Fix getter and setter for virtual terminal attributes
Neither NetworkTerminal.getAttributes nor NetworkTerminal.setAttributes
worked correctly because they were sending the wrong json method name.
This wasn't noticeable because neither of these methods had previously
been used by sbt.
2020-09-27 12:17:34 -07:00
eugene yokota 073b3047af
Merge pull request #5901 from eatkins/interaction-service-fix
Fix interaction service for thin client
2020-09-26 15:47:23 -04:00
Ethan Atkins 6103444d5d Fix interaction service for thin client
The global SimpleReader hardwires Terminal.console so it won't work with
the ThinClient.
2020-09-26 11:51:42 -07:00
eugene yokota 71677cedca
Merge pull request #5889 from eatkins/supershell-perf-regression-fix
Fix minor supershell performance regression
2020-09-25 14:13:12 -04:00
eugene yokota c00196abf0
Merge pull request #5888 from adpi2/bsp-shutdown
reply to BSP shutdown request
2020-09-24 12:06:03 -04:00
Ethan Atkins d930cb1987 Don't do progress work on the main thread
I noticed that no-op compile was slower in
https://github.com/sbt/sbt/issues/5508 using 1.4.0-RC2 than 1.4.0-RC1.
It took around 400ms with 1.4.0-RC2 and 200-250ms on RC1. Git bisect
brought me to 41afe9fbdb which I
remembered I'd been slightly concerned about from a performance
perspective but didn't get around to testing. The problem is that we
were blocking the task from running while determing whether or not we
should force a progress report. We can do that work on the background
thread instead so the task can begin running immediately.
2020-09-24 09:02:05 -07:00
Ethan Atkins 4ec6339794 Fix logical bug in task report scheduling
The conditional for whether to make task progress events repeatable was
inverted. This wasn't actually noticeable because the function
doReport() was being schedule which had a guard to prevent it from
running more frequently than the report period.
2020-09-24 09:02:05 -07:00
Adrien Piquerez 591c2b13cd reply to BSP shutdown request 2020-09-23 18:06:56 +02:00
Adrien Piquerez 621e60ba13 Fix Test / semanticdbOptions 2020-09-23 17:38:07 +02:00
Eugene Yokota 4fe2f8eff1 Split to MiniDependencyTreePlugin
Ref https://github.com/sbt/sbt/pull/5880

This split the dependency-graph plugin into MiniDependencyTreePlugin and DependencyTreePlugin.
2020-09-22 21:21:01 -04:00
eugene yokota 602cf392a6
Merge pull request #5880 from eed3si9n/wip/dependencygraph
in-sources sbt-dependency-graph
2020-09-21 22:56:10 -04:00
Eugene Yokota 17b75453b5 In-source sbt-dependency-graph
Ref https://github.com/sbt/sbt-dependency-graph/issues/178

This in-sources sbt-dependency-graph.
2020-09-21 21:43:16 -04:00
Ethan Atkins ddb626a9be Allow users to configure standard input setting
Certain tasks may prefer to have the input set to raw mode and/or have
echo off. The specific use case is that it is difficult to get the
ammonite console to work correctly with the thin client. The problem is
that the ammonite console runs some tty commands. These commands will
only work on the tty of the thin client when the thin client itself has
launched the sbt server session (since they share the same tty). Once
the thin client that launched the server exits, the ammonite console
will never work again with that server session. A workaround is to
launch sbt separately and leave that server session open. Then, if the
run task is configured with canonical input set to false and echo
disabled, the thin client will work. In the future, it's possible that
ammonite could be updated to not rely on calling stty commands and then
the thin client could work with the ammonite console even after the
initial thin client session has exited provided canonical input and echo
are disabled.
2020-09-21 13:42:04 -07:00
Ethan Atkins bb8b9a1c99 Fix switching between raw and canonical input
There were a number of issues with swithcing between raw and canonical
issues that affected both the server and the thin client. These were
reported in #5863 and #5856. In both cases, there were issues with
reading input or having the input be displayed. Debugging those issues
revealed a number of issues with how we were using the jline 3 system
terminal and the hybrid interaction with the jline 2 terminal. This
commit eliminates all of our internal jline 2 usage. The only remaining
jline 2 usage is that we create and override the global terminal for the
scala console for scala versions < 2.13. By moving away from jline 2, I
was also able to fix #5828, which reported that the home, end and delete
keys were not working.

One of the big issues that this commit addresses is that the
NetworkClient was always performing blocking reads on System.in. This
was problematic because it turns out that you can't switch between raw
and canonical modes when there is a read present. To fix this, the
server now sends a message to the client when it wants to read bytes and
only then does the client create a background thread to read a single
byte.

I also figured out how to set the terminal type properly for the thin
client on windows where we had been manually setting the capabilities to
ansi, which only worked for some keys. This fix required switching to
the WindowsInputStream that I introduced in a prior commit. Before we
were using the jline 2 wrapped input stream which was converting some
system events, like home and end, to the wrong escape sequence mappings.

The remainder of the commit is mostly just converting from jline 2 apis
to jline 3 apis.

I verified that tab completions, the scala console, the ammonite console
and a run task that read from System.in all work with both the server
and the thin client on mac, linux and windows after these changes.

Fixes #5828, #5863, #5856
2020-09-21 13:42:03 -07:00
Ethan Atkins 410a8dd4b1 Use jline-terminal-jna for sbt server
The old sbt launcher uses jansi 1.11, which is incompatible with jline3.
To work around this, we can use the jna terminal implementation for the
jline system terminal. This commit also switches to using the jline
TerminalBuilder for all system terminals except for the windows system
terminal with the thin client. The jline terminal builder uses
reflection that is difficult to make work with the thin client and it is
much easier to just manually construct the thin client. This is only
necessary for windows because on posix the thin client will fall back to
an implementation that shells out for stty commands.
2020-09-21 13:42:03 -07:00
Ethan Atkins f4c49a09d2 Filter out DashDashServer for command arguments
sbt exits abruptly when run with --server.
2020-09-21 13:42:03 -07:00
Ethan Atkins 4cea09937c Set isSuccessEnabled in network channel consistently
The thin client needs to do its own success reporting because in batch
mode it's possible for the task to exit before success is logged by the
server. If the server also prints success, there can be double printing.
Unfortunately, the Prompt.Batch check is not reliable because MainLoop
will change the prompt to Running during task evaluation. The
interactive flag is set in the NetworkChannel when the client explicitly
registers itself as an interactive session, so this should be more
reliable.
2020-09-21 13:42:03 -07:00
Ethan Atkins 52743051eb Remove Terminal.withCanonicalIn
This was implemented as a no-op so we may as well get rid of it.
2020-09-21 13:42:03 -07:00