Commit Graph

5700 Commits

Author SHA1 Message Date
Dale Wijnand d8e52bb5d4
Kill trailing println 2017-10-11 15:29:15 +01:00
Dale Wijnand 9ca909fe50 Merge pull request #3622 from dwijnand/slash-less-keys
Remove some duplication when only Scoped is required
2017-10-09 07:06:18 +01:00
Dale Wijnand 668ace98ee
Remove some duplication when only Scoped is required 2017-10-08 19:07:38 +01:00
eugene yokota 84dafd0bc0 Merge pull request #3620 from eed3si9n/wip/previous4
Remove thunk for slash syntax
2017-10-07 14:25:08 -04:00
eugene yokota 626cf634dc Merge pull request #4 from dwijnand/wip/previous4
Fix some minor errors
2017-10-07 13:44:27 -04:00
Dale Wijnand 5e0b080f51
Fix some minor errors 2017-10-07 18:42:26 +01:00
eugene yokota d9ab8659af Merge pull request #3 from dwijnand/wip/previous4
Add slash syntax for AttrKey that parity with "in" syntax
2017-10-07 13:24:57 -04:00
Dale Wijnand ef4828cfc2
Add slash syntax for AttrKey that parity with "in" syntax 2017-10-07 13:12:17 +01:00
Dale Wijnand d19c350687
Correct name of WithoutScope properties 2017-10-07 13:12:16 +01:00
Dale Wijnand 8af3110c00
Add .previous tests to SlashSyntaxTest 2017-10-07 13:12:16 +01:00
Dale Wijnand fb28c201c8
Make scoped keys more frequent 2017-10-07 13:12:16 +01:00
Dale Wijnand 74ac7d9e07
Drop redudant label in expectValue 2017-10-07 13:12:15 +01:00
Dale Wijnand 025075efd0
Dedup, cleanup & cover all key types 2017-10-07 13:12:15 +01:00
Dale Wijnand 165dc794ca
Extract gen{Input,Setting,Task}Key 2017-10-07 13:12:15 +01:00
Dale Wijnand 18d615701f
Remove WithScope wrapping 2017-10-07 13:12:15 +01:00
Dale Wijnand 0bcd7c3b6d
Remove boilerplate around sbtSlashSyntaxRichConfiguration 2017-10-07 12:08:32 +01:00
Dale Wijnand e5898111fe
Replace CanScope with Scoped.ScopingSetting 2017-10-07 12:07:19 +01:00
Eugene Yokota 2a6385fd94 Remove thunk for slash syntax
Ref #3606, #3611, and #3613

This removes unnecessary thunk for slash syntax.
The semantics using this approach is strictly better than the previous `in (ref, config, task)`. By removing the thunk, we retain `(a / b) / c == a / b / c`.

See the following example:

```scala
scala> import sbt._, Keys._
scala> val t: TaskKey[Unit] = (test in Test)
t: sbt.TaskKey[Unit] = TaskKey(This / Select(ConfigKey(test)) / This / test)

scala> ThisBuild / t
ThisBuild / t
res1: sbt.TaskKey[Unit] = TaskKey(Select(ThisBuild) / Select(ConfigKey(test)) / This / test)

scala> ThisBuild / t / name
ThisBuild / t / name
res2: sbt.SettingKey[String] = SettingKey(Select(ThisBuild) / Select(ConfigKey(test)) / Select(test) / name)
```

so far so good? Now look at this:

```
scala> scala> name in (ThisBuild, t)
name in (ThisBuild, t)
res3: sbt.SettingKey[String] = SettingKey(Select(ThisBuild) / This / Select(test) / name)
```

`Test` configuration knowledge is lost! For `in (..)` maybe it was ok because mostly we don't use unscoped keys, but that's the difference between `in (..)` and `/`.

Fixes #3605
2017-10-06 15:47:46 -04:00
eugene yokota 48a990b34f Merge pull request #3617 from dwijnand/slash-check
Add SlashSyntaxSpec to validate syntax parity
2017-10-06 13:24:20 -04:00
Dale Wijnand 5b03379693
Extract withScope 2017-10-06 17:41:06 +01:00
Dale Wijnand 9b526f54bf
Rarely include custom scopes in key generators 2017-10-06 15:41:28 +01:00
Dale Wijnand db87e4c871
Add SlashSyntaxSpec to validate syntax parity 2017-10-06 15:07:18 +01:00
Dale Wijnand 97ddc1ffb7
Copy the non-runtime parts of project/unified to SlashSyntaxTest 2017-10-06 15:07:17 +01:00
Dale Wijnand f22843f91c
Move SlashSyntax to the settings component 2017-10-06 09:52:34 +01:00
Dale Wijnand b546eb215e Merge pull request #3615 from cunei/wip-npm
Print npm output, handle exit code in case of errors
2017-10-06 08:41:31 +01:00
Antonio Cunei 96b476f136 Print npm output, handle exit code in case of errors 2017-10-06 02:26:59 +02:00
eugene yokota 1251817cf2 Merge pull request #3612 from dwijnand/scope-toString
Handle Global in Scope#toString
2017-10-05 17:43:25 -04: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 2a5ba9475d
Handle Global in Scope#toString
Print "Global" instead of "Zero / Zero / Zero".
2017-10-05 20:29:42 +01: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 05c2c506b2 Merge pull request #3602 from dwijnand/headers
Add, configure & enforce file headers
2017-10-05 11:22:53 +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 2799209d29 Merge pull request #3601 from dwijnand/project-id
Implement Project#withId
2017-10-04 20:18:21 +01: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 dd9b2b2f3a Merge pull request #3600 from eed3si9n/wip/scala_syntax
Add Scala syntax from daltonjorge/vscode-scala
2017-10-03 18:24:19 -04:00
Eugene Yokota 10539bcd22 update logo to a white background version 2017-10-03 18:22:14 -04:00
Eugene Yokota 90c6c61199 Add Scala syntax from daltonjorge/vscode-scala
This adds Scala syntax for VS Code. The current plugin was relying on daltonjorge/vscode-scala for detecting that `*.scala` is a Scala source. This change integrates the plugin into this one.

daltonjorge/vscode-scala is licensed under MIT license.
2017-10-03 18:19:25 -04: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