Commit Graph

7166 Commits

Author SHA1 Message Date
Ethan Atkins c00cc37953 Do not require leading semicolon for multi command
It has long been a frustration of mine that it is necessary to prepend
multiple commands with a ';'. In this commit, I relax that restriction.
I had to reorder the command definitions so that multi comes before act.
This was because if the multi command did not have a leading semicolon,
then it would be handled by the action parser before the multi command
parser had a shot at it. Sadness ensued.
2018-11-19 10:42:51 -08:00
Ethan Atkins 51d986d751 Make multi command parser work with string literals
Presently the multi command parser doesn't work correctly if one of the
commands includes a string literal. For example, suppose that there is
an input task defined name "bash" that shells out and runs the input.
Then the following does not work with the current multi command parser:
; bash "rm target/classes/Foo.class; touch src/main/scala/Foo.scala"; comple
Note that this is a real use case that has caused me issues in the past.

The problem is that the semicolon inside of the quote gets interpreted
as a command separator token. To fix this, I rework the parser so that
it consumes string literals and doesn't modify them. By using
StringEscapable, I allow the string to contain quotation marks itself.

I couldn't write a scripted test for this because in a command like
`; foo "bar"; baz`, the quotes around bar seem to get stripped. This
could be fixed by adding an alternative to StringEscapable that matches
an escaped string, but that is more work than I'm willing to do right
now.
2018-11-19 10:38:22 -08:00
Ethan Atkins 05e3a8609b Fix watch command parser
I discovered that when I ran multi-commands with '~' that if there was a
space between the ';' and the command, then the parsing of the command
would fail and the watch would abort. To fix this, I refactor
Watched.watch to use the multi command parser and, if that parser fails,
we fallback on a single command.
2018-11-19 10:38:22 -08:00
Ethan Atkins 4281972f1a Refactor multi parser
Prior to this commit, there was no unit testing of the parser for
multiple commands. I wanted to make some improvements to the parser, so
I reworked the implementation to be testable. This change also allows
the multiParserImpl method to be shared with Watched.watch, which I will
also update in a subsequent commit.

There also were no explicit scripted tests for multiple commands, so I
added one that I will augment in later commits.
2018-11-19 10:38:22 -08:00
Eugene Yokota 44074983bc util 1.3.0-M3 2018-11-18 12:12:38 -05:00
Eugene Yokota b00dcb1b9d Fix task progress blank line behavior
Run readyLog lazily.
2018-11-16 23:06:36 -08:00
Eugene Yokota d58b302a97 Fix prompt for task progress 2018-11-16 23:05:51 -08:00
eugene yokota 93d77d593f
Merge pull request #4449 from eatkins/managed-source-fix-develop
Fix '~' for dependent projects with a broken parent
2018-11-13 15:49:50 -08:00
eugene yokota 67b109c4bd
Merge pull request #4447 from eatkins/managed-source-fix
Fix '~' for dependent projects with a broken parent (1.2.x)
2018-11-13 12:59:05 -08:00
Ethan Atkins fd2ec7adc3 Fix '~' for dependent projects with a broken parent
In #4446, @japgolly reported that in some projects, if a parent project
was broken, then '~' would immediately exit upon startup. I tracked it
down to this managed sources filter. The idea of this filter is to avoid
getting stuck in a build loop if managedSources writes into an unmanaged
source directory. If the (managedSources in ThisScope).value line
failed, however, it would cause the watchSources, and by delegation,
watchTransitiveSources task to fail. The fix is to only create this
filter if the managedSources task succeeds.

I'm not 100% sure if we shouldn't just get rid of this filter entirely
and just document that '~' will probably loop if a build writes the
result of managedSources into an unmanaged source directory.
2018-11-11 09:36:46 -08:00
Ethan Atkins 7b5cf84fe1 Fix '~' for dependent projects with a broken parent
In #4446, @japgolly reported that in some projects, if a parent project
was broken, then '~' would immediately exit upon startup. I tracked it
down to this managed sources filter. The idea of this filter is to avoid
getting stuck in a build loop if managedSources writes into an unmanaged
source directory. If the (managedSources in ThisScope).value line
failed, however, it would cause the watchSources, and by delegation,
watchTransitiveSources task to fail. The fix is to only create this
filter if the managedSources task succeeds.

I'm not 100% sure if we shouldn't just get rid of this filter entirely
and just document that '~' will probably loop if a build writes the
result of managedSources into an unmanaged source directory.
2018-11-11 09:35:46 -08:00
eugene yokota f10455fe40
Merge pull request #4431 from andreaTP/sbtBig
adding sbt-big to the build
2018-11-10 01:53:51 -05:00
eugene yokota ab5e99c9c8
Merge pull request #4443 from eed3si9n/wip/metabuild-classpath
Use the classpath obtained by the launcher for metabuild
2018-11-09 16:43:32 -05:00
Eugene Yokota c51c00bb3f Use app classpath for metabuild
Fixes #4437

Until now, sbt was resolved twice once by the launcher, and the second time by the metabuild.
This excludes sbt from the metabuild graph, and instead uses app classpath from the launcher.
2018-11-09 04:32:38 -05:00
Eugene Yokota c91371b7f8 add isMetaBuild setting
Fixes #3436

This implements isMetaBuild setting that is explicitly for meta build only,
unlike sbtPlugin setting which can be used for both meta build and plugin development purpose.
2018-11-09 03:08:47 -05:00
andrea 39493f7869 adding a fatjar release (aka sbt-big) to the build 2018-11-07 08:37:49 +00:00
Eugene Yokota d30556f19e Refactor compiler bridge unit test
This refactors the compiler bridge unit test to use the normal Zinc facility,
namely AnalyzingCompiler that's built on Scala 2.12, but is capable of driving
the compiler bridge built on non-2.12.
This allows us to run the unit tests without any additional dependencies published for Scala 2.13.0-M5.
2018-11-06 13:46:24 -05:00
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
andrea 76be2c1621 fix ServerSpec testing with dbuild 2018-10-18 17:57:14 +01: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 2f01970007
Merge pull request #4335 from eatkins/watch-improvements
Watch improvements
2018-10-10 09:51:56 -04:00