Commit Graph

602 Commits

Author SHA1 Message Date
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
Eugene Yokota 348a077797 implement tokenfile authentication 2017-09-21 23:05:48 -04:00
Eugene Yokota 87e95e3a51 bump lm to 1.0.2 2017-09-16 01:43:42 -04:00
Eugene Yokota 4bd7010a4f bump Zinc to 1.0.1
Fixes #2884
2017-09-16 00:38:22 -04:00
Eugene Yokota 01e8f609e8 lm 1.0.1 2017-09-10 14:13:51 -04:00
Eugene Yokota afd5ff03f8 WatchSource = sbt.internal.io.Source
Ref #3438
2017-08-28 00:56:27 -04:00
Eugene Yokota 0e77d9f8a2 Merge branch 'wip/npe' into wip/use_sbt1 2017-08-26 15:37:19 -04:00
Eugene Yokota 12be2e28a6 Use sbt 1.0.0 2017-08-26 14:40:58 -04:00
Eugene Yokota c74d397cd7 Bump Util for NPE fix attempt
Ref sbt/util#119
2017-08-26 01:39:51 -04:00
Dale Wijnand ec54269467 Merge pull request #3428 from SethTisue/be-2.13-friendly
be 2.13 friendly
2017-08-14 10:39:08 +01:00
Seth Tisue f5d51bf387 be 2.13 friendly
for the Scala 2.13 community build
2017-08-12 07:35:26 -07:00
Dale Wijnand 805b76f3d4
Add back, re-configure & re-enable Scalafmt 2017-08-10 16:35:23 +01:00
Eugene Yokota ffacc62b86 IO 1.0.0, Util 1.0.0, LM 1.0.0, Zinc 1.0.0 2017-08-09 23:56:59 -04:00
Dale Wijnand a495aa7cb0
Upgrade to sbt 1.0.0-RC3 2017-08-01 14:35:27 +01:00
Eugene Yokota 4d8d5f5df0 IO, Util, LM, Zinc 1.0.0-RC3 2017-07-28 15:45:59 -04:00
Eugene Yokota 0850df67e8 Contraband 0.3.0 2017-07-28 15:40:30 -04:00
Dale Wijnand 716203fefa Merge pull request #3383 from dwijnand/2123
Upgrade to Scala 2.12.3
2017-07-28 16:53:37 +01:00
Dale Wijnand 56d7d400b0
Upgrade to Scala 2.12.3 2017-07-28 07:56:08 +01:00
Eugene Yokota 5768ad2468 Log4j 2 SLF4J Binding
Fixes sbt/sbt#3333
2017-07-28 01:00:47 -04:00
Dale Wijnand c103950b10
Add, configure & enable MiMa 2017-07-26 14:14:04 +01:00
Eugene Yokota b2220fe9d4
sbt 1.0.0-RC2 2017-07-20 06:56:37 +01:00
Eugene Yokota 00a9dd14a4 Bump Contraband to latest 2017-07-17 01:05:30 -04: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 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 850832a31c Bump modules 2017-07-15 17:50:00 -04:00
Dale Wijnand 9494967e05
Upgrade util/lm/zinc & config build for util modules
Welcome back home!
2017-07-07 12:11:59 +01:00
Dale Wijnand f63306140e
Format the build 2017-07-07 09:48:48 +01:00
Dale Wijnand 58956d1c58
Drop util-apply-macro dep, given it was brought back 2017-07-07 09:48:42 +01:00
Eugene Yokota efa3b1d340
Bump to latest io, scalajson, sjsonnew, contraband, util, lm, zinc 2017-07-06 11:05:24 +01:00
Eugene Yokota 04f2a04fa4 sbt-scalafmt 1.3 2017-06-16 16:12:37 -04:00
Eugene Yokota bcc74a962e bump to using sbt 1.0.0-M6
We are missing the plugin for Scalafmt but I think we need to use beta2 ourselves.
2017-06-13 01:09:19 -04:00
Eugene Yokota d952dbb7ba Fix build to publish M6 2017-05-30 02:44:13 -04:00
Eugene Yokota 03c9b648fb Adjust to Zinc and lm changes 2017-05-30 00:59:43 -04:00
jvican 2b12721a68
Add fully-fledged macro check for value inside if
`.value` inside the if of a regular task is unsafe. The wrapping task
will always execute the value, no matter what the if predicate yields.

This commit adds the infrastructure to lint code for every sbt DSL
macro. It also adds example of neg tests that check that the DSL checks
are in place.

The sbt checks yield error for this specific case because we may want to
explore changing this behaviour in the future. The solutions to this are
straightforward and explained in the error message, that looks like
this:

```
EXPECTED: The evaluation of `fooNeg` happens always inside a regular task.

PROBLEM: `fooNeg` is inside the if expression of a regular task.
  Regular tasks always evaluate task inside the bodies of if expressions.

SOLUTION:
  1. If you only want to evaluate it when the if predicate is true, use a dynamic task.
  2. Otherwise, make the static evaluation explicit by evaluating `fooNeg` outside the if expression.
```

Aside from those solutions, this commit also adds a way to disable any
DSL check by using the new `sbt.unchecked` annotation. This annotation,
similar to `scala.annotation.unchecked` disables compiler output. In our
case, it will disable any task dsl check, making it silent.

Examples of positive checks have also been added.

There have been only two places in `Defaults.scala` where this check has
made compilation fail.

The first one is inside `allDependencies`. To ensure that we still have
static dependencies for `allDependencies`, I have hoisted up the value
invocation outside the if expression. We may want to explore adding a
dynamic task in the future, though. We are doing unnecessary work there.

The second one is inside `update` and is not important because it's not
exposed to the user. We use a `taskDyn`.
2017-05-25 15:33:00 +02:00
jvican b4299e7f34
Add check of task invocation inside `if`
This commit adds the first version of the checker that will tell users
if they are doing something wrong.

The first version warns any user that write `.value` inside an if
expression.

As the test integration is not yet working correctly and messages are
swallowed, we have to println to get info from the test.
2017-05-24 17:27:18 +02:00
jvican 2692bec21d
Reformat sbt source (minor changes) 2017-05-24 11:17:45 +02:00
jvican fd4bf0e635
Replace previous scalafmt plugin by neo-scalafmt
The previous scalafmt plugin had two problems:

* Caching with Coursier did not work correctly
* It failed after the upgrade to 1.0 in my computer (from a clean fork):

```
[error] (testingProj/compile:scalafmtInc) java.lang.NoClassDefFoundError: Could not initialize class scala.meta.package$
[error] (runProj/compile:scalafmtInc) java.lang.NoClassDefFoundError: Could not initialize class scala.meta.package$
[error] (taskProj/compile:scalafmtInc) java.lang.NoClassDefFoundError: Could not initialize class scala.meta.package$
[error] (stdTaskProj/compile:scalafmtInc) java.lang.NoClassDefFoundError: Could not initialize class scala.meta.package$
[error] (actionsProj/compile:scalafmtInc) java.lang.NoClassDefFoundError: Could not initialize class scala.meta.package$
[error] (protocolProj/compile:scalafmtInc) java.lang.NoClassDefFoundError: Could not initialize class scala.meta.package$
[error] (commandProj/compile:scalafmtInc) java.lang.NoClassDefFoundError: Could not initialize class scala.meta.package$
[error] (mainSettingsProj/compile:scalafmtInc) java.lang.NoClassDefFoundError: Could not initialize class scala.meta.package$
[error] (mainProj/compile:scalafmtInc) java.lang.NoClassDefFoundError: Could not initialize class scala.meta.package$
[error] (sbtProj/compile:scalafmtInc) java.lang.NoClassDefFoundError: Could not initialize class scala.meta.package$
[error] (scriptedPluginProj/compile:scalafmtInc) java.lang.NoClassDefFoundError: Could not initialize class scala.meta.package$
[error] (scriptedSbtProj/compile:scalafmtInc) java.lang.NoClassDefFoundError: Could not initialize class scala.meta.package$
[error] Total time: 19 s, completed May 24, 2017 10:44:56 AM
```

This commit replaces the previous scalafmt integration by the one
created by Lucidsoftware, big shoutout! (/cc @pauldraper)

https://github.com/lucidsoftware/neo-sbt-scalafmt
2017-05-24 11:15:22 +02:00
Eugene Yokota b013c30c30 Fix content log not showing up on `test`
Fixes #3198

Bump util to 1.0.0-M24. This fixes content log not showing up on `test`
2017-05-19 00:15:19 -04:00
Eugene Yokota 3724277704 migrate ForkOptions to Contraband 2017-05-12 05:22:08 -04:00
Dale Wijnand 0b33c195ef
Upgrade the build to sbt 1.0.0-M5
Some plugins remain commented out, for now.

sbt-doge is no longer needed because a variant of it has been folded
into sbt 1.

For some reason scripted requires src/doc jars of sbt, so switch back to
using `publishAll` rather than `publishLocalBinAll`. :(

Also, the sys.prop change in scripted is to force log4j2 to not use a
thread context classloader, and avoid the following:

    ERROR StatusLogger Unable to create custom ContextSelector. Falling back to default.
     java.lang.ClassCastException: Cannot cast org.apache.logging.log4j.core.async.AsyncLoggerContextSelector to org.apache.logging.log4j.core.selector.ContextSelector
    	at java.lang.Class.cast(Class.java:3369)
    	at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceOf(LoaderUtil.java:201)
    	at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceOfProperty(LoaderUtil.java:226)
    	at org.apache.logging.log4j.core.impl.Log4jContextFactory.createContextSelector(Log4jContextFactory.java:97)
    	at org.apache.logging.log4j.core.impl.Log4jContextFactory.<init>(Log4jContextFactory.java:58)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    	at java.lang.Class.newInstance(Class.java:442)
    	at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java:94)
    	at org.apache.logging.log4j.spi.ThreadContextMapFactory.createThreadContextMap(ThreadContextMapFactory.java:73)
    	at org.apache.logging.log4j.ThreadContext.init(ThreadContext.java:223)
    	at org.apache.logging.log4j.ThreadContext.<clinit>(ThreadContext.java:202)
    	at org.apache.logging.log4j.core.impl.ContextDataInjectorFactory.createDefaultInjector(ContextDataInjectorFactory.java:83)
    	at org.apache.logging.log4j.core.impl.ContextDataInjectorFactory.createInjector(ContextDataInjectorFactory.java:67)
    	at org.apache.logging.log4j.core.lookup.ContextMapLookup.<init>(ContextMapLookup.java:34)
    	at org.apache.logging.log4j.core.lookup.Interpolator.<init>(Interpolator.java:117)
    	at org.apache.logging.log4j.core.config.AbstractConfiguration.<init>(AbstractConfiguration.java:125)
    	at org.apache.logging.log4j.core.config.DefaultConfiguration.<init>(DefaultConfiguration.java:46)
    	at org.apache.logging.log4j.core.layout.PatternLayout$Builder.build(PatternLayout.java:650)
    	at org.apache.logging.log4j.core.layout.PatternLayout.createDefaultLayout(PatternLayout.java:487)
    	at sbt.internal.util.ConsoleAppender.<init>(ConsoleAppender.scala:245)
    	at sbt.internal.util.ConsoleAppender$.apply(ConsoleAppender.scala:196)
    	at sbt.internal.util.ConsoleLogger.<init>(ConsoleAppender.scala:42)
    	at sbt.internal.util.ConsoleLogger$.apply(ConsoleAppender.scala:34)
    	at sbt.test.ScriptedRunner.run(ScriptedTests.scala:221)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at Scripted$.doScripted(Scripted.scala:125)
    	at $0483e89d182e9d240274$.$anonfun$scriptedTask$5(build.sbt:301)
2017-05-11 09:44:42 +01:00
jvican 70cf417525
Fix #3161: Don't fail if group is not present
This covers the case described in #1361 plus an esoteric case too.
Parsers are initialized when sbt starts and text completions use the
knowledge at that time. If we happen to move a new file that should
influence the behaviour of the tab completion, that file will not be
picked up. Before, since we were throwing an error, the previous case
that would no produce any tab completion would also fail, though the
files are legitimately in the correct place.
2017-05-10 21:40:02 +02:00
jvican f497e15cd8
Run scripted tests in parallel
Add binary-compatible methods to run scripted tests in parallel using
parallel collections. Parallel collections are not tuned and a default
of 4 cores is used for the `ForkJoinPool`. This can be a matter of
experimentation in the future but for now I prefer to stay with it.

The non-parallel methods are not affected by this change.

The changes to the scripted plugin have not been used, only the sbt
scripted plugin is using `runInParallel`. In the future, this change can
also happen so that plugin authors can benefit from parallel sbt
testing. This is not a priority for me now :)
2017-05-10 21:32:36 +02:00
Dale Wijnand 55e055fa39
Upgrade to sbt-ghpages 0.6.0 2017-05-08 15:02:32 +01:00
Dale Wijnand b65dc1830e
Upgrade to sbt-bintray 0.4.0 2017-05-08 15:02:31 +01:00
Dale Wijnand ad03595584
Upgrade to sbt-site 1.2.0 2017-05-08 15:02:31 +01:00
Dale Wijnand 3a7fc6d1e5
Upgrade to sbt-git 0.9.2 2017-05-08 14:34:30 +01:00
Dale Wijnand f9e0dc0a48
Upgrade to sbt-mima 0.1.14 2017-05-08 14:16:35 +01:00
Dale Wijnand 33f79a9fcd
Make sure addSbtModule will work in sbt 1
For some reason using ClasspathDependency doesn't work in sbt 1, while
ClasspathDep[ProjectReference] does. The latter is less specific and
works just as well.
2017-05-08 14:07:37 +01:00
jvican 818b8c85ae
Bump util to X11 and rename `SbtExclusionRule` 2017-05-03 12:42:16 +02:00