Commit Graph

364 Commits

Author SHA1 Message Date
Eugene Yokota 00a9dd14a4 Bump Contraband to latest 2017-07-17 01:05:30 -04:00
Martin Duhem 3fe068a4c1 Adapt to changes in ConsoleAppender 2017-07-15 17:15:42 +02:00
Eugene Yokota efa3b1d340
Bump to latest io, scalajson, sjsonnew, contraband, util, lm, zinc 2017-07-06 11:05:24 +01:00
Martin Duhem 0daca42c29 Adapt to use the new `WatchService`
This commit adapts `Watched` so that it supports the new `WatchService`
infrastructure introduced in sbt/io. The goal of this infrastructure is
to provide and API for and several implementations of services that
monitor changes to the file system.

The service to use to monitor the file system can be configured with the
key `watchService`.
2017-07-02 00:28:04 -04:00
Dale Wijnand e4be5f4a09 Remove the "hit [ENTER] to switch to interactive mode" feature
In sbt 0.13.15, in addition to notifying the user about the existence of
sbt's shell, a feature was added to allow the user to switch to sbt's
shell - a more pro-active approach to just displaying a message.

Unfortunately sbt is often unintentionally invoked in shell scripts in
"interactive mode" when no interaction is expected by, for exmaple,
invoking `sbt package` instead of `sbt package < /dev/null`. In that
case hitting [ENTER] would silently trigger sbt to run its shell,
easily wrecking the script. In addition to that I was unhappy with the
implementation as it created a tight coupling between sbt's command
processing abstraction to sbt's shell command.

If you want to stay in sbt's shell after running a task like `package`
then invoke sbt like so:

    sbt package shell

Fixes #3091
2017-05-26 21:42:41 -04:00
Dale Wijnand b54c0ff059 Notify users about shell only if compile is present
This is a change in strategy.

The motivation is the need to find a good balance between:

  + informing the uninformed that would benefit from this information, &
  + not spamming the already informed

Making it dependent on "compile" being present in remainingCommands will
probably make it trigger for, for example, Maven users who are used to
running "mvn compile" and always run "sbt compile", and who therefore
are unneccesarily suffering terribly slow compile speeds by starting up
the jvm and sbt every time.

Fixes #3091
Fixes #3097
2017-05-26 21:33:49 -04:00
Eugene Yokota da046791e0 Apply Scalafmt formatting 2017-04-21 04:48:31 -04:00
Eugene Yokota 86342d0bdd server is now called shell
server command is renamed to shell,
and the old shell command is called oldshell.
2017-04-14 16:35:54 -04:00
Eugene Yokota 0e8459ad66 Better error message if socket is taken
We need to communicate the error states in the thread, so I added a `Future[Unit]` called `ready`.

If something goes wrong during the startup, like if the port is already taken, this can be used to communicate back to the main thread, and display the error accordingly.
2017-04-13 15:49:21 -04:00
Dale Wijnand ec15837f43
Replace unnecessary uses of Command.make with Command.apply 2017-04-13 13:52:30 +01:00
Dale Wijnand 6c07972dd0
Cleanup Command/Help and usage 2017-04-13 13:52:30 +01:00
Dale Wijnand 308abcde9f Merge pull request #3082 from dwijnand/remove-most-deprecated
Remove most @deprecated
2017-04-13 10:32:10 +01:00
Dale Wijnand 881cb4246a Notify about shell less
+ Don't notify ScriptMain users by moving the logic to xMain
+ Only trigger shell if shell is a defined command
+ Use existing Shell/BootCommand strings instead of new ones
2017-04-12 03:24:38 -04:00
Dale Wijnand 3f590d8e13
Drop most remaining deprecations 2017-04-11 16:46:11 +01:00
Eugene Yokota 7ffae0f7df Fix patch error 2017-04-04 19:59:25 -04:00
Dale Wijnand 1a2bfc546b Notify & enable users to stay in the warm shell
Notify & enable users to stay in sbt's shell on the warm JVM by hitting
[ENTER] while sbt is running.

Looks like this; first I run 'sbt about', then I hit [ENTER]:

    $ sbt about
    [info] !!! Executing in batch mode !!! For better performance, hit [ENTER] to remain in the sbt shell

    [info] Loading global plugins from /Users/dnw/.dotfiles/.sbt/0.13/plugins
    [info] Loading project definition from /s/t/project
    [info] Set current project to t (in build file:/s/t/)
    [info] This is sbt 0.13.14-SNAPSHOT
    [info] The current project is {file:/s/t/}t 0.1.0-SNAPSHOT
    [info] The current project is built against Scala 2.12.1
    [info] Available Plugins: sbt.plugins.IvyPlugin, sbt.plugins.JvmPlugin, sbt.plugins.CorePlugin, sbt.plugins.JUnitXmlReportPlugin, sbt.plugins.Giter8TemplatePlugin
    [info] sbt, sbt plugins, and build definitions are using Scala 2.10.6
    >
    >

Fixes #2987
2017-04-04 19:43:28 -04:00
Dale Wijnand c7be291946
Fix StateOps#fail != fail 2017-03-27 14:38:02 +01:00
Eugene Yokota b6d8b565de Codegen change 2017-03-23 14:30:51 -04:00
Eugene Yokota 180bdfd129 Bump underlying modules to latest 2017-03-23 12:41:24 -04:00
Dale Wijnand e67cd6948b
Fix a bunch but not all compile warnings 2017-03-03 01:33:44 +01:00
Dale Wijnand e83564a6b7
Move some server pieces from main-command to main 2017-01-20 17:07:25 +00:00
Josh Soref eefef9d686 spelling: publish 2017-01-20 08:21:56 +00:00
Josh Soref ae22cc2293 spelling: incoming 2017-01-20 08:17:56 +00:00
Josh Soref c81894e45b spelling: command 2017-01-20 08:10:32 +00:00
Josh Soref f66acb8c0e spelling: abstraction 2017-01-20 08:06:55 +00:00
Dale Wijnand c239b553b6
Fix logic in client 2017-01-17 11:49:00 +00:00
Eugene Yokota d91df1f189 Adjust to 1.0.x 2017-01-16 08:44:13 -05:00
Eugene Yokota 1b79cb85b6 Safer template resolver
Fixes #2761

With sbt 0.13.13-RC1 rediscovered that the dependency pulled in from
Giter8 was affecting the plugins. To avoid this, this change splits up
the template resolver implementation to another module called
sbt-giter8-resolver, and it will be downloaded using Ivy into
`~/.sbt/0.13/templates/`, and then launched reflectively using Java as
the interface.
2017-01-16 08:44:13 -05:00
Eugene Yokota 729119a15a Fix parser for new command 2017-01-16 08:43:23 -05:00
Eugene Yokota 73a427c0b8 Adds templateResolvers and `new` command
This adds `new` command, which helps create a new build definition. The
`new` command is extensible via a mechanism called the template
resolver,
which evaluates the arbitrary arguments passed to the command to find
and run a template.

As a reference implementation [Giter8][g8] is provided as follows:

    sbt new eed3si9n/hello.g8

This will run eed3si9n/hello.g8 using Giter8.

  [g8]: http://www.foundweekends.org/giter8/
2017-01-16 08:43:23 -05:00
Eugene Yokota 0365d7cb11 Uncomment publishEvent 2017-01-14 02:30:59 -05:00
Eugene Yokota 8c9dfda089 Split log output per channel
LogManager implementation is modified to use ManagedLogger, which can swap out backing Appenders without re-creating the log instance.

The State was also changed to track `currentCommand: Option[Exec]`. `Exec` knows the origin of the command invocation, and using that we can now send the network-originated events only to the network clients.

Combined together, this implements log splitting between the sbt clients (channels).
2017-01-13 03:00:02 -05:00
Eugene Yokota 66301dbaf1 Adjust from rebasing 2017-01-06 11:35:08 -05:00
Eugene Yokota a2df1a4b53 Formatting fix 2017-01-06 11:27:41 -05:00
Eugene Yokota a0dde10f8a Use NonFatal 2017-01-06 11:27:41 -05:00
Eugene Yokota 892e25d23f Introduce execId that gets sent back
Now the client can put an id on each exec.
This can then be tracked and/or be used to block the user input.
2017-01-06 11:27:41 -05:00
Eugene Yokota 1bf50e10c8 Use Exec in State 2017-01-06 11:27:41 -05:00
Eugene Yokota d96ef58605 Unifying towards using events 2017-01-06 11:27:06 -05:00
Eugene Yokota 46d8f952e4 Refactor to make NetworkChannel per client connection 2017-01-06 11:27:06 -05:00
Eugene Yokota d618f91c6d Replace var with AtomicReference 2017-01-06 11:27:06 -05:00
Eugene Yokota fa7253ece3 Start lightweight client
This is the beginning of a lightweight client, which talks to the
server over Contraband-generated JSON API. Given that the server is
started on port 5173:

```
$ cd /tmp/bogus
$ sbt client localhost:5173
> compile
StatusEvent(Processing, Vector(compile, server))
StatusEvent(Ready, Vector())
StatusEvent(Processing, Vector(, server))
StatusEvent(Ready, Vector())
```
2017-01-06 11:27:06 -05:00
Eugene Yokota 272e733b87 Update to Contraband 2017-01-06 11:27:06 -05:00
Dale Wijnand 7fcfec8b8e
-sbinary/+sjson-new, -datatype/+contraband & upgrades
* start to replace sbinary with sjson-new
* upgrade from sbt/datatype to sbt/contraband
* upgrade and migrate to new sbt modules APIs
2017-01-05 21:59:00 +00:00
Dale Wijnand 43821667bf
Upgrade scalariform version 2016-12-11 12:13:11 +00:00
Eugene Yokota 18233ace05 Using sbt-datatype + sjson-new for JSON serialization 2016-10-27 09:27:41 -04:00
Eugene Yokota e7456b5653 Use the new FullReader 2016-10-27 09:20:06 -04:00
Eugene Yokota a94107e673 Handle closed socket 2016-10-27 02:42:12 -04:00
Eugene Yokota fe1a24cf7c Adjust to 1.0.x 2016-10-27 02:42:12 -04:00
Eugene Yokota a89fcb37ca Exec and CommandExchange refactoring 2016-10-27 02:42:12 -04:00
Eugene Yokota 3359163636 Adds serverPort attribute key 2016-10-27 02:42:12 -04:00
Eugene Yokota ebf4715dd1 Refactor to CommandExchange and CommandChannel 2016-10-27 02:42:12 -04:00
Eugene Yokota 48d3b01e6b Move files around 2016-10-27 02:42:12 -04:00
Eugene Yokota 3381f59ae8 Implement ConsoleListener 2016-10-27 02:42:12 -04:00
Johan Andrén ff211d08f9 Server hooked in as a CommandListener 2016-10-27 02:42:12 -04:00
Eugene Yokota f9dd8b73b7 Refactor to abstract listening for command line 2016-10-27 02:42:12 -04:00
Eugene Yokota 649dc0ce3c This is where we can multiplex commands 2016-10-27 02:42:12 -04:00
Eugene Yokota 9529f0c304 Add `-error` etc for log levels with one hyphen 2016-09-15 02:23:37 -04:00
Eugene Yokota 06724d1c4b Rename early command to `early(command)`
Fixes #2734, Ref #1041
e93c4450a1 added a feature called early
command, which uses `--` as a prefix to denote some commands that runs
ahead of session loading. While the feature might be useful especially
for logging, `--` is too useful just for this purpose.
2016-09-15 01:45:50 -04:00
Dale Wijnand 84c611af36 Remove unused vals/defs 2016-07-12 14:31:35 +01:00
Dale Wijnand deea82542c Remove unused imports 2016-07-12 11:55:10 +01:00
Dale Wijnand 32760bed55 Remove some fatal exception catching 2016-07-07 18:21:25 +01:00
Dale Wijnand 387674a451 Remove some heads and tails 2016-07-07 18:21:25 +01:00
Dale Wijnand 12d2b5a63b Cleanup commandProj 2016-06-21 08:09:30 +01:00
Eugene Yokota ee272d780e Reorganize directory structure 2016-05-06 16:01:49 -04:00