Commit Graph

905 Commits

Author SHA1 Message Date
eugene yokota 8eb5879101 Merge pull request #3659 from eed3si9n/wip/reboot
Adds "reboot dev"
2017-10-25 04:06:59 -04:00
Eugene Yokota 6ac4571197 Adds "reboot dev"
This adds a new option `dev` to the `reboot` command, which deletes the only the current sbt artifacts from the boot directory. `reboot dev` reads actively from `build.properties` instead of using the current state since `reboot` can restart into another sbt version.

In general, `reboot dev` is intended for the local development of sbt.

Fixes #3590
2017-10-25 03:19:10 -04:00
Dale Wijnand 81c5eaec33 Merge pull request #3633 from dwijnand/misc-2017-10-12
Misc 2017-10-12
2017-10-24 20:37:20 +01:00
Dale Wijnand 78c5ee92d3
Track sources in base directory non-recursively
Using a recursive Source meant that ~ looked into target. If you have
any source generators and use ~ with anything the invokes them, like
~compile, that means that the act of generating sources triggers ~ to
re-execute compile (perhaps only on macOS where the NIO WatchService
just polls, after an initial delay).

Requires sbt/io#78

Fixes #3501
2017-10-24 11:09:00 +01:00
PanAeon 64241e0d3a Fixes #3464. Escape imports from sbt files, so if user creates a backquoted definition then task evalution will not fail. 2017-10-13 11:04:15 +01:00
Dale Wijnand 10397926aa
Make sure of EvaluateTask in Extracted obvious 2017-10-12 15:36:05 +01:00
eugene yokota fa33b6e422 Merge pull request #3632 from dwijnand/trailing-println
Kill trailing println
2017-10-11 13:38:09 -04:00
Dale Wijnand d8e52bb5d4
Kill trailing println 2017-10-11 15:29:15 +01:00
eugene yokota 8c04b267bf Merge branch '1.x' into 1.0.x 2017-10-10 10:57:05 -04:00
Michael Stringer b9a4d32916 Add system property to revert to old polling fs watcher
This adds a sbt.watch.mode system property that if set to 'polling' will
use PollingWatchService instead of WatchServiceAdapter (nio).

On macOS this will default to 'polling' and on all others 'nio'.

This is a temporary workaround for users affected by #3527
2017-10-10 01:17:42 -04:00
Michael Stringer a3c34c6c0a
Add system property to revert to old polling fs watcher
This adds a sbt.watch.mode system property that if set to 'polling' will
use PollingWatchService instead of WatchServiceAdapter (nio).

On macOS this will default to 'polling' and on all others 'nio'.

This is a temporary workaround for users affected by #3527
2017-10-09 18:01:33 +01:00
Eugene Yokota 5c394e18f6 implement window/logMessage
This sends sbt's log message as "window/logMessage" event to LSP.
2017-10-08 01:51:27 -04:00
Dale Wijnand f22843f91c
Move SlashSyntax to the settings component 2017-10-06 09:52:34 +01:00
eugene yokota 201a8031de Merge pull request #3609 from dwijnand/ref
Correct handling of resolving ThisProject
2017-10-05 15:39:24 -04:00
eugene yokota 5a6a651b8f Merge pull request #3604 from dwijnand/dedup-cmds-lists
Dedup DefaultCommands and allBasicCommands
2017-10-05 15:36:37 -04:00
Dale Wijnand f4b2fc4228
Correct handling of resolving ThisProject
In ca71b4b902 I went about fixing the
inexhaustive matching in Scope's resolveProjectBuild and
resolveProjectRef. Looking back the change was wrong.

For resolveProjectBuild the new implementation is less wrong, but still
not great, seeing as it doesn't actually do any build resolving.

For resolveProjectRef the new implementation now blows up instead of
lies. Which means it's less leneant, more "fail-fast".

isProjectThis is unused; remnant of the pre-AutoPlugin days when build
settings where defined in Plugin.settings.
2017-10-05 19:00:48 +01:00
Dale Wijnand 68129e6782
Dedup DefaultCommands and allBasicCommands
The command component's BasicCommands.allBasicCommands is a subset of
main component's BuiltinCommands.DefaultCommands, so I deduplicated.
2017-10-05 09:14:01 +01:00
Dale Wijnand a41727fb17
Add, configure & enforce file headers 2017-10-05 09:03:40 +01:00
Dale Wijnand dae4694f46 Merge pull request #3603 from eed3si9n/wip/zerozerozero
Fixes Zero / Zero / Zero / name handling
2017-10-05 08:59:30 +01:00
Eugene Yokota 60f2498c0a Implement toString for keys
toString added for REPL testing:

```
scala> Zero / Zero / Zero / name
res0: sbt.SlashSyntax.ScopeAndKey[sbt.SettingKey[String]] = Zero / Zero / Zero / name
```
2017-10-05 02:46:09 -04:00
Eugene Yokota 53bbb99617 Fixes Zero / Zero / Zero / name handling
Prior to this change `Zero / Zero / Zero / name` broke as folllows:

```
scala> Zero / Zero / Zero / name
Zero / Zero / Zero / name
<console>:18: error: inferred type arguments [sbt.Zero.type] do not conform to method /'s type parameter bounds [K <: sbt.SlashSyntax.Key[K]]
       Zero / Zero / Zero / name
                   ^
```
2017-10-05 02:43:50 -04:00
Dale Wijnand 530c405b2f
Implement Project#withId 2017-10-04 13:54:37 +01:00
Dale Wijnand d997fe8043
Oneline mkGeneratedRoot 2017-10-04 13:42:30 +01:00
Dale Wijnand ccdd77a94f
Remove old, commented out Project.apply 2017-10-04 13:42:29 +01:00
Dale Wijnand 1685dae1d9
Oneline Project.apply 2017-10-04 13:42:29 +01:00
Dale Wijnand ceb0f0228a
Use copy2 in resolveBuild 2017-10-04 13:42:29 +01:00
Dale Wijnand 9e855ffb55
Resolve some TODOs by creating a private copy2 in Project 2017-10-04 13:42:28 +01:00
eugene yokota 7af716f37b Merge pull request #3524 from eed3si9n/wip/language_server
language server protocol (VS Code integration)
2017-10-03 11:56:26 -04:00
Dale Wijnand 5c7461ada8 Merge pull request #3596 from dwijnand/slash
Cleanup and improve the unified slash syntax
2017-10-03 13:37:20 +01:00
Eugene Yokota 1ad9360e3e setting query is "sbt/setting" 2017-10-03 01:45:06 -04:00
Eugene Yokota a8e770c446 handle exec as "sbt/exec" 2017-10-03 00:18:58 -04:00
Eugene Yokota f188e60d8f Update test 2017-10-02 17:12:15 -04:00
Eugene Yokota 4fe0d08ab0 substitute println with logger 2017-10-02 15:42:55 -04:00
Dale Wijnand e7b893fdc5
Cleanup and improve the unified slash syntax 2017-10-02 17:24:37 +01:00
Eugene Yokota 0c1c380f71 begins language server protocol
This is the first cut for the Language Server Protocol on top of server that is still work in progress.

With this change, sbt is able to invoke `compile` task on saving files in VS Code.
2017-10-02 04:01:13 -04:00
Age Mooij 30e81398fd Removed unused local val 2017-09-28 13:37:38 +02:00
Dale Wijnand 21bd7c3a91 Merge pull request #3434 from eed3si9n/wip/slash
Unify sbt shell and build.sbt syntax (unified slash syntax redux)
2017-09-28 09:26:25 +01:00
Eugene Yokota b0306b738e Add whitespaces in Show of scoped keys
```
Provided by:
    ProjectRef(uri("...."), "root") / Test / test
Dependencies:
    Test / executeTests
    Test / test / streams
    Test / state
    Test / test / testResultLogger
```
2017-09-28 03:34:49 -04:00
Eugene Yokota 33a01f3ceb Unified slash syntax
Fixes sbt/sbt#1812

This adds unified slash syntax for both sbt shell and the build.sbt DSL.
Instead of the current `<project-id>/config:intask::key`,
this adds `<project-id>/<config-ident>/intask/key` where <config-ident> is the Scala identifier notation for the configurations like `Compile` and `Test`.

This also adds a series of implicits called `SlashSyntax` that adds `/` operators to project refererences, configuration, and keys such that the same syntax works in build.sbt.

These examples work for both from the shell and in build.sbt.

    Global / cancelable
    ThisBuild / scalaVersion
    Test / test
    root / Compile / compile / scalacOptions
    ProjectRef(uri("file:/xxx/helloworld/"),"root")/Compile/scalacOptions
    Zero / Zero / name

The inspect command now outputs something that can be copy-pasted:

    > inspect compile
    [info] Task: sbt.inc.Analysis
    [info] Description:
    [info] 	Compiles sources.
    [info] Provided by:
    [info] 	ProjectRef(uri("file:/xxx/helloworld/"),"root")/Compile/compile
    [info] Defined at:
    [info] 	(sbt.Defaults) Defaults.scala:326
    [info] Dependencies:
    [info] 	Compile/manipulateBytecode
    [info] 	Compile/incCompileSetup
    [info] Reverse dependencies:
    [info] 	Compile/printWarnings
    [info] 	Compile/products
    [info] 	Compile/discoveredSbtPlugins
    [info] 	Compile/discoveredMainClasses
    [info] Delegates:
    [info] 	Compile/compile
    [info] 	compile
    [info] 	ThisBuild/Compile/compile
    [info] 	ThisBuild/compile
    [info] 	Zero/Compile/compile
    [info] 	Global/compile
    [info] Related:
    [info] 	Test/compile
2017-09-28 01:01:43 -04:00
Alexey Alekhin 632b14cf78 Changed default version setting to 0.1.0-SNAPSHOT
To make it compatible with semantic versioning. Fixes #3467.
2017-09-25 15:06:17 +02:00
Eugene Yokota 348a077797 implement tokenfile authentication 2017-09-21 23:05:48 -04:00
Justin Kaeser 45d69f3762 Pass `allJars` when creating ScalaInstance instead of `otherJars`.
Fixes https://github.com/sbt/sbt/issues/3560
required for https://youtrack.jetbrains.com/issue/SCL-12591
2017-09-19 19:12:59 +02:00
Eugene Yokota 8a8215cf1b Use uri instead of url 2017-09-18 23:07:29 -04:00
Eugene Yokota c5bfc67750 Fixes test 2017-09-17 22:31:57 -04:00
Eugene Yokota 9d40404915 JSON port file
This implements JSON-based port file. Thoughout the lifetime of the sbt server there will be `cwd / "project" / "target" / "active.json"`, which contains `url` field.

Using this `url` the potential client, such as IDEs can find out which port number to hit.

Ref #3508
2017-09-17 19:19:56 -04:00
Eugene Yokota f21d190a65 `sbt.server.autostart` flag and startServer
Adds JVM flag `sbt.server.autostart` to enable/disable the automatic starting of sbt server with the sbt shell.

This also adds a new command `startServer` to manually start the server.
2017-09-16 03:24:30 -04:00
eugene yokota caf2fa2cb8 Merge pull request #3523 from guillaumebort/1.0.x
Sbt server could miss some messages
2017-09-15 23:31:13 -04:00
eugene yokota 45765583a6 Merge branch '1.0.x' into 1.0.x 2017-09-15 19:47:08 -04:00
eugene yokota 43538bdbe6 Merge pull request #3526 from dwijnand/crossplusplus
Redefine crossScalaVersions, because it's Def.derive..
2017-09-15 19:09:11 -04:00
Dale Wijnand 71ae211841
Redefine crossScalaVersions, because it's Def.derive..
Fixes #3495
2017-09-15 16:59:47 +01:00
Răzvan Flavius Panda 0124a8ad0e Fix unused imports warnings 2017-09-15 16:35:08 +01:00
Dale Wijnand 3cb281945e
Alias when strings are a scala version 2017-09-13 16:03:51 +01:00
Dale Wijnand 930fac2a78
Restrict switchScalaVersion `projects` to just ResolvedReference's 2017-09-13 16:03:51 +01:00
Dale Wijnand 936733b2b1
Cleanup 2017-09-13 16:03:51 +01:00
Guillaume Bort b355aa66e4 Sbt server could miss some messages
If the read buffer contains more that 2 messages, we need to consume them all before blocking on socket read again. For that we have to loop until the buffer does not contain anymore the message delimiter character.

Same problem in the client ServerConnection code.
2017-09-13 13:18:38 +02:00
Dale Wijnand 103e40882f
Fix run's support of directories in the classpath
Fixes #3504
2017-09-13 10:21:41 +01:00
Dale Wijnand 53e41a0045
Dedup defining bgRun/bgRunMain 2017-09-13 10:21:40 +01:00
Antonio Cunei 8b187147ef Add makeIvyXml, as a more sensibly-named alternative to deliver 2017-09-01 00:38:04 +02:00
Antonio Cunei c35220c32f Add makeIvyXmlConfiguration, restore deliver to 0.13 behavior 2017-09-01 00:38:04 +02:00
Eugene Yokota aaf259f4fd Revert "Automatically choose proper compiler bridge for dotty"
This reverts commit 2283c68031.
2017-08-28 12:12:09 -04:00
Eugene Yokota 9003ed4fac Capture errors thrown inside `bgRun`
This captures non-fatal errors in `bgRun` background thread, so if needed we can re-throw it for `run`.
2017-08-27 02:59:50 -04:00
Eugene Yokota b6f2fe7654 Forward `run` task to `bgRun`
Fixes #3425

The `Compile`-specific `run` task was removed in #2936 in favor of `bgRun` but it stop short of delegating the `run` to `bgRun`.
2017-08-26 16:49:29 -04:00
eugene yokota 7ac1b034e4 Merge pull request #3439 from Duhemm/fix/3413
Fix #3413: Include base directory to watched sources
2017-08-23 18:39:23 -04:00
eugene yokota eb4312e6fa Merge pull request #3446 from jroper/cross-build-commands
[1.0.x] Add support for cross building commands
2017-08-23 18:38:25 -04:00
eugene yokota ddaa091dec Merge pull request #3442 from dwijnand/sbt-plugin-cross-version
[fport] Fix addSbtPlugin to use the correct version of sbt
2017-08-23 18:37:23 -04:00
eugene yokota 33d3ba9d7c Merge pull request #3438 from Duhemm/source-appender
[1.0.x] `Append` instance to add `File` to `Seq[Source]`
2017-08-23 18:31:58 -04:00
Martin Duhem c1b86c7534
Address review comments 2017-08-18 15:51:53 +02:00
eugene yokota 7201898b19 Minor edit to comment 2017-08-15 13:58:33 -04:00
Dale Wijnand a5afc21bf0
Fix addSbtPlugin to use the correct version of sbt
Fixes #3393
2017-08-15 12:13:28 +01:00
James Roper be91300031 Add support for cross building commands
Fixes #2776

This allows cross building commands. When issuing a command, it detects
whether there is likely to be any Scala version incompatibilities, by
checking whether all projects have the same Scala cross version
configuration, if not, it outputs a big fat warning.
2017-08-15 16:27:45 +10:00
Dale Wijnand 4f0d2f9ffd
Scalafmt 1.2.0 2017-08-14 15:47:52 +01:00
Martin Duhem c395f1d464
Include base directory to watched sources
If `sourcesInBase` is true, we must also watch sources in the base
directory.
2017-08-14 16:00:05 +02:00
Eugene Yokota c16a3b6ffa Merge branch '1.0.0' into wip/scalafmt 2017-08-13 21:46:37 -04:00
Dale Wijnand 805b76f3d4
Add back, re-configure & re-enable Scalafmt 2017-08-10 16:35:23 +01:00
eugene yokota 6ea9dab99e Merge pull request #3407 from sbt/1.0.0
Merge the 1.0.0 branch into 1.x
2017-08-08 12:19:49 -04:00
eugene yokota 07879e26e1 Merge pull request #3385 from eed3si9n/wip/contraband2
Bump modules, and use LM API
2017-07-28 18:47:04 -04:00
eugene yokota b38dbc3618 Merge pull request #3380 from eed3si9n/wip/skipinpublish
implement `skip in publish`
2017-07-28 18:46:03 -04:00
Eugene Yokota d1a950868f Use LM API for cached update task
Fixes sbt/sbt#3326
2017-07-28 17:55:49 -04:00
Dale Wijnand 56d7d400b0
Upgrade to Scala 2.12.3 2017-07-28 07:56:08 +01:00
Eugene Yokota 5e8bbf8d0d implement `skip in publish`
`skip in publish` when set to `true` will skip publish, publishLocal, and publishM2. (sbt-pgp already skips publishSigned).

Fixes sbt/sbt#3136
2017-07-27 22:04:42 -04:00
Eugene Yokota 9a26f7ba1c Fix ^^ and don't inject scalaVersion by default
This no longer injects scalaVersion at the project level, which was interfering with crossScalaVersions delegation to ThisBuild scope.

Fixes sbt/sbt#3353
2017-07-26 23:14:37 -04:00
Dale Wijnand 3a14bd8094 Merge pull request #3367 from eed3si9n/wip/keys
Unify to camel cased setting key
2017-07-26 09:07:05 +01:00
eugene yokota 996b760a9e Merge pull request #3365 from sbt/wip/terminalwidth
InteractionService#terminalWidth
2017-07-25 05:16:08 -04:00
Eugene Yokota b27ff9ace7 Unify to camel cased setting key
Fixes #3146
2017-07-25 03:06:17 -04:00
Eugene Yokota f96c8b9668 InteractionService#terminalWidth
Adds `def terminalWidth: Int` to InteractionService to wrap JLine 2 (or 3 in the future).

Fixes #3352
2017-07-24 22:44:18 -04:00
Eugene Yokota a68372fd52 Fix new command
This was caused by bad porting of lm API usage.

Fixes #3355
2017-07-24 22:23:37 -04:00
Eugene Yokota 2c4e78f414 Override current project's scalaVersion on ^^
Both the default settings and ^^ together sets the correct scalaVersion based on `sbtVersion in pluginCrossBuild`, but frequently people set up `scalaVersion` on sbt plugin's subproject, which disables the feature.
This change appends the scalaVersionSetting on ^^ so scalaVersion gets switched to 2.12.2 on ^^ 1.0.0-RC2 etc.

Fixes #3205
2017-07-24 18:45:37 -04:00
Eugene Yokota 7b2b7d696b Don't wrap InputStream for Windows
Ref #3282

We used to wrap InputStream so it will inject Thread.sleep, which then allows the thread to be cancelled, emulating a non-blocking readLine. This trick doesn't seem to work for Windows.
For non-Cygwin, actually just removing the wrapping does the job, but I couldn't get it to work for Cygwin.

To test, run some command via network, and then type `show name` into the terminal. On Cygwin, it will not respond.
2017-07-22 03:34:10 -04:00
Martin Duhem d267ec487a Show `actual` as potential option of `inspect` 2017-07-18 12:02:02 +02:00
Eugene Yokota c9fae43595 bump to Util 1.0.0-M28 and Zinc 1.0.0-X20 2017-07-16 22:16:33 -04:00
Eugene Yokota bf4901f9ef Some helpful changes for update caching
There's a bug in sbt/util#93
2017-07-16 16:45:08 -04:00
Eugene Yokota 170685f4e1 Fixes dependency-management/update-sbt-classifiers 2017-07-16 15:12:47 -04:00
Eugene Yokota 99be5b25f4 Roll back Vector changes in Keys.scala
Keys should Seq type since it's fairly common to use List in build.sbt, and it would cause annoying build changes.
Fixes actions/cross
2017-07-16 13:58:51 -04:00
Eugene Yokota f0ac6ae11c Adjust to upstream changes 2017-07-16 00:51:49 -04:00
Martin Duhem 347914191a Adapt to new library management API 2017-07-15 18:09:40 -04:00
Eugene Yokota 3cc49e49f4 Merge branch 'pr/3321' into wip/integration 2017-07-15 17:53:21 -04:00
Eugene Yokota c909de01b8 Merge branch 'pr/3317' into wip/integration 2017-07-15 17:52:41 -04:00
Eugene Yokota c2c1d0ff12 Merge branch 'pr/3316' into wip/integration 2017-07-15 17:52:15 -04:00
Martin Duhem 3fe068a4c1 Adapt to changes in ConsoleAppender 2017-07-15 17:15:42 +02:00
jvican 2da90fee03
Sync up with changes to `AnalysisContents` 2017-07-15 10:08:08 +02:00