Commit Graph

11353 Commits

Author SHA1 Message Date
eugene yokota edd0c34186
Merge pull request #4436 from eatkins/unload-view
Close the current global file tree view on unload
2018-10-30 03:05:39 -04:00
Ethan Atkins 7ec65f174d Close the current global file tree view on unload
I noticed that when using the latest nightly, triggered execution would
fail to work if I switched projects with, e.g. ++2.10.7. This was
because the background thread that filled the file cache was incorrectly shutdown.
To fix this, we just need to close whatever view is cached in the
globalFileTreeView attribute in the exit hook rather than the view
created by the method.

After making this change and publishing a local SNAPSHOT build, I was
able to switch projects with ++ and have triggeredExecution continue to
work.
2018-10-29 14:21:36 -07:00
eugene yokota 23063e2813
Merge pull request #4427 from andreaTP/flakyCompletionsSpec
fix ServerSpec flaky test
2018-10-18 17:20:57 -04:00
eugene yokota 6935bee2c7
Merge pull request #244 from eed3si9n/wip/windows
JDK11 on Windows
2018-10-18 17:08:06 -04:00
Eugene Yokota 018034a090 JDK11 on Windows 2018-10-18 16:50:30 -04:00
eugene yokota c8d5276b0a
Merge pull request #243 from liff/issue-sbt-3598
Use `preloaded` from `-sbt-dir`
2018-10-18 16:00:02 -04:00
andrea 76be2c1621 fix ServerSpec testing with dbuild 2018-10-18 17:57:14 +01:00
Olli Helenius b791da704c
Use `preloaded` from `-sbt-dir` 2018-10-17 13:04:39 +03:00
eugene yokota 9ba283a1f1
Merge pull request #242 from eed3si9n/wip/revert-239
Revert 239
2018-10-17 03:16:24 -04:00
Eugene Yokota 1d806c9cf3 Revert "Use `preloaded` from `-sbt-dir`"
This reverts commit b8dbe42ece.
2018-10-17 01:57:08 -04:00
Eugene Yokota 9c19799b73 Revert "Improve logic for finding preloaded directory"
This reverts commit c8219f8396.
2018-10-17 01:56:57 -04:00
eugene yokota 015d85836b
Merge pull request #4425 from eed3si9n/wip/bump
[1.2.x] Fixes cached resolution, and upgrades modules
2018-10-15 16:34:22 -04:00
Eugene Yokota 137c746ac0 util 1.2.3, zinc 1.2.4 2018-10-15 12:48:47 -04:00
Eugene Yokota 4e6352179b lm 1.2.2 2018-10-15 12:46:40 -04:00
Eugene Yokota ede82b4709 Adjust the tests 2018-10-15 12:46:18 -04:00
Eugene Yokota 608c6fb990 Set withMetadataDirectory by default
This partly fixes cached resolution.

Ref https://github.com/sbt/sbt/issues/3761
2018-10-15 12:46:02 -04:00
eugene yokota 7d79a13ba9
Merge pull request #4424 from eed3si9n/wip/cached-resolution
Set withMetadataDirectory by default, bump to lm 1.2.2
2018-10-15 12:40:29 -04:00
Eugene Yokota 10fa964b6f Adjust the tests 2018-10-15 11:24:44 -04:00
Eugene Yokota 93c8ab0a2d librarymanagement 1.2.2 2018-10-15 05:13:43 -04:00
Eugene Yokota f70ce9bab0 Set withMetadataDirectory by default
This partly fixes cached resolution.

Ref https://github.com/sbt/sbt/issues/3761
2018-10-15 03:26:39 -04:00
eugene yokota 1f8e9c9657
Merge pull request #4410 from eed3si9n/wip/semantic
ThisBuild / enableSemanticDB
2018-10-12 01:00:16 -04:00
eugene yokota bca5c23eb0
Merge pull request #4420 from andreaTP/refactorCancellations
[sbt-server] Refactor cancellations
2018-10-11 20:22:54 -04:00
eugene yokota 8698622c6f
Merge pull request #4398 from andreaTP/configurableLibraryManagement
Build time configurable library management
2018-10-11 20:21:57 -04:00
Eugene Yokota aa8c1f484b implement SemanticdbPlugin
This makes it easier to enable SemanticDB build wide.
2018-10-11 15:44:15 -04:00
Eugene Yokota 9c611f2c07 -Yrangepos for sbt 2018-10-11 15:44:15 -04:00
Andrea Peruffo e4c9fbad79
Merge branch 'develop' into configurableLibraryManagement 2018-10-11 18:59:38 +01:00
Andrea Peruffo a2607f1da6
Merge branch 'develop' into refactorCancellations 2018-10-11 18:57:57 +01:00
eugene yokota e759d17b2e
Merge pull request #4397 from andreaTP/lspCompletions
[sbt-server] LSP completions support
2018-10-11 12:49:23 -04:00
eugene yokota 7fe075974c
Merge pull request #4417 from andreaTP/moreRobustServerSpec
fix ServerSpec flaky tests
2018-10-11 09:32:33 -04:00
eugene yokota 58648d680e
Merge pull request #4419 from eatkins/reload-loop
Fix windows reload loop
2018-10-11 09:19:54 -04:00
andrea 02b19752eb refactoring of server cancellation request 2018-10-11 14:03:41 +01:00
andrea 34e0fc159c [sbt-server] LSP completions support 2018-10-11 13:34:40 +01:00
andrea a23479dfb1 fixing ServerSpec flaky tests 2018-10-11 08:21:19 +01:00
Ethan Atkins f579b89577 Fix windows reload loop
On windows* it was possible to get into a loop where the build would
continually restart because for some reason the build.sbt file would get
touched during test (I did not see this behavior on osx). Thankfully,
the repository keeps track of the file hash and when we detect that the
build file has been updated, we check the file hash to see if it
actually changed.

Note that had this bug shipped, it would have been fixable by overriding
the watchOnEvent task in user builds.

The loop would occur if I ran ~filesJVM/test in
https://github.com/swoval/swoval. It would not occur if I ran
test:compile, so the fact that the build file is being touched seems
to be related to the test run itself.
2018-10-10 20:16:29 -07:00
Ethan Atkins c9a0698a18
Merge pull request #4418 from eatkins/interactive
Interactive
2018-10-10 20:01:58 -07:00
Ethan Atkins 2cfbfcc842 Disable re-run feature on windows
For whatever reason, I couldn't get jline to work on windows, so I'm
disabling the re-run with 'r' feature. This can almost surely be fixed,
but the way I was invoking jline was blocking the continuous build from
exiting when the user pressed enter.
2018-10-10 18:35:30 -07:00
Ethan Atkins a1580bafbf Improve error message
Previously, the invalid commands would be wrapped in 'Left($CMD)'.
2018-10-10 18:35:30 -07:00
Ethan Atkins d9e8ae18b2 Fix default FileTreeViewConfig
It was possible that on startup, when this function was first invoked,
that the default boot commands are present. This was a problem because
the global file repository is instantiated using the value of this task.
When we start a continuous build, this task gets run again to evaluate
again.

When sbt is started without an implicit task list, then the task is
implicitly shell as indicated by the command "iflast shell". We can use
this to determine whether or not to use the global file system cache or
not.
2018-10-10 18:35:30 -07:00
Andrea Peruffo cd69a112bd
Merge branch 'develop' into configurableLibraryManagement 2018-10-10 17:43:50 +01:00
eugene yokota 0b9a531ac3
Merge pull request #239 from liff/issue-sbt-3598
Use `preloaded` from `-sbt-dir`
2018-10-10 10:52:51 -04:00
eugene yokota 2f01970007
Merge pull request #4335 from eatkins/watch-improvements
Watch improvements
2018-10-10 09:51:56 -04:00
Olli Helenius c8219f8396 Improve logic for finding preloaded directory 2018-10-10 09:36:35 +03:00
Olli Helenius b8dbe42ece Use `preloaded` from `-sbt-dir`
Fixes sbt/sbt#3598.
2018-10-10 09:36:35 +03:00
Ethan Atkins 0a9ae7b4b4 Use FileTreeRepository when interactive or continuous
Ideally we use the FileTreeRepository for interactive sessions by
default. A continuous build is effectively interactive, so I'd like that
case to also use the file tree repository. To avoid breaking scripted
tests, many of which implicitly expect file tree changes to be
instantaneously available, we set interactive to true only if we are not
in a scripted run, which can be verified by checking that the commands
contains "setUpScripted".
2018-10-09 21:52:38 -07:00
eugene yokota 927a536554
Merge pull request #240 from eed3si9n/wip/openjdk11
Fix test on openjdk11
2018-10-10 00:29:56 -04:00
Eugene Yokota 88229e03ba Fix test on openjdk11 2018-10-10 00:13:10 -04:00
eugene yokota cd679591d0
Merge pull request #187 from eed3si9n/fport/avoid-temp-string
Avoid temporary string in JSON reading
2018-10-09 18:50:20 -04:00
Jason Zaugg 65e2980e9d Avoid temporary string in JSON reading 2018-10-09 18:31:13 -04:00
Ethan Atkins dc4f705500 Add support to rebuild a '~' task by pressing 'r'
Sometimes a user may want to rerun their task even if the source files
haven't changed. Presently this is a little annoying because you have to
hit enter to stop the build and then up arrow or <ctrl+r> plus enter to
rebuild. It's more convenient to just be able to press the 'r' key to
re-run the task.

To implement this, I had to make the watch task set up a jline terminal
so that System.in would be character buffered instead of line buffered.
Furthermore, I took advantage of the NonBlockingInputStream
implementation provided by jline to wrap System.in. This was necessary
because even with the jline terminal, System.in.available doesn't return
> 0 until a newline character is entered. Instead, the
NonBlockingInputStream does provide a peek api with a timeout that will
return the next unread key off of System.in if there is one available.
This can be use to proxy available in the WrappedNonBlockingInputStream.

To ensure maximum user flexibility, I also update the watchHandleInput Key to
take an InputStream and return an Action. This setting will now receive
the wrapped System.in, which will allow the user to create their own
keybindings for watch actions without needing to use jline themselves.

Future work might make it more straightforward to go back to a line
buffered input if that is what the user desires.
2018-10-09 12:09:42 -07:00
Ethan Atkins 25e97f99f5 Add custom external hooks
For projects with a large number of files, zinc has to do a lot of work
to determine which source files and binaries have changes since the last
build. In a very simple project with 5000 source files, it takes roughly
750ms to do a no-op compile using the default incremental compiler
options. After this change, it takes about 200ms. Of those 200ms, 50ms
are due to the update task, which does a partial project resolution*.

The implementation is straightforward since zinc already provides an api
for overriding the built in change detection strategy. In a previous
commit, I updated the sources task to return StampedFile rather than
regular java.io.File instances. To compute all of the source file
stamps, we simply list the sources and if the source is in fact an
instance of StampedFile, we don't need to compute it, otherwise we
generate a StampedFile on the fly. After building a map of stamped files
for both the sources files and all of the binary dependencies, we simply
diff these maps with the previous results in the changedSources,
changedBinaries and removedProducts methods.

The new ExternalHooks are easily disabled by setting
`externalHooks := _ => None`
in the project build.

In the future, I could see moving ExternalHooks into the zinc project so
that other tools like bloop or mill could use them.

* I think this delay could be eliminated by caching the UpdateResult so
long as the project doesn't depend on any snapshot libraries. For a
project with a single source, the no-op compile takes O(50ms) so caching
the project resolution would make compilation start nearly
instantaneous.
2018-10-09 12:09:42 -07:00