Commit Graph

240 Commits

Author SHA1 Message Date
Eugene Yokota 28e90ea09b Merge branch '1.1.x' into wip/merge-1.1.x 2018-04-29 14:31:30 -04:00
Dale Wijnand 3a4bc8dc0b
Dropped deprecated "compat" commands & strings
Fixes #4089
2018-04-26 14:04:05 +01:00
Eugene Yokota 334789c919 1.1.5-SNAPSHOT 2018-04-25 16:15:19 -04:00
Dale Wijnand 490f57c779
Upgrade to sbt-scalafmt 1.15 & scalafmt 1.4.0 2018-04-24 16:09:48 +01:00
OlegYch eeeb4c9ff2 Remove usage of DynamicVariable and fix memory leak, fixes https://github.com/sbt/sbt/issues/4112 2018-04-23 20:46:08 +03:00
Dale Wijnand dfff1ed928
Merge pull request #4032 from eed3si9n/wip/servertest
improve server testing
2018-04-18 07:12:53 +02:00
Eugene Yokota 1ec07c1867 Recover sbtOn 2018-04-17 23:26:29 +02:00
Dale Wijnand 54a6262f7f
Merge pull request #4041 from dwijnand/Scoped.equals
Give Scoped a default equals/hashCode implementation
2018-04-10 06:10:55 +01:00
Eugene Yokota b9eb7764f3 Zinc 1.1.5 2018-04-09 12:37:42 -04:00
Eugene Yokota 04d6a8b44c perf: optimize hash for build
This hot path was discovered by retronym using FlameGraph.
This removes intermediate creation of Array.

`filesModifiedBytes` in particular was bad as it was going through all `*.class` files, each generating an Array. This replaces that with `fileModifiedHash` that accepts `MessageDigest`.

According to the flamegraph, evalCommon footprint reduced from 4.5% to 3.6%.
Using `time sbt reload reload reload exit`, the median reduced from 41.450s to 39.467s.
2018-04-05 03:26:02 -04:00
Dale Wijnand 3692db9068
Give Scoped a default equals/hashCode implementation 2018-04-04 15:04:53 +01:00
Eugene Yokota c2837c7714 Merge branch 'wip/bumpsbt' into wip/merge-1.1.x 2018-03-27 10:16:10 -04:00
Eugene Yokota 1b77b35333 bump to 1.1.3-SNAPSHOT 2018-03-27 06:53:05 -04:00
Eugene Yokota 67e1e4a9ff improve server testing
previously I was using separate thread in a forked test to test the server, but that is not enough isolation to run multiple server tests.
This adds `RunFromSourceMain.fork(workingDirectory: File)`, which allows us to run a fresh sbt on the given working directory. Next, I've refactored the stateful client-side buffer to a class `TestServer`.
2018-03-24 12:09:41 -04:00
Dale Wijnand 00ce32f102
Cleanup CommandChannel 2018-03-20 09:17:55 +00:00
Dale Wijnand fe418c92a7
Merge pull request #4016 from dwijnand/cleanup/Watched
Make Watched use State#handleError
2018-03-20 08:54:18 +00:00
Dale Wijnand 9c0ac90ee9
Make Watched use State#handleError 2018-03-19 15:21:15 +00:00
Dale Wijnand 6ceed00f48
Cleanup NetworkChannel 2018-03-19 15:11:39 +00:00
Eugene Yokota cd9f0d2711 make sbt server extensible
Fixes #3890

Here's an example:

```scala
    Global / serverHandlers += ServerHandler({ callback =>
      import callback._
      import sjsonnew.BasicJsonProtocol._
      import sbt.internal.protocol.JsonRpcRequestMessage
      ServerIntent(
        {
          case r: JsonRpcRequestMessage if r.method == "lunar/helo" =>
            jsonRpcNotify("lunar/oleh", "")
            ()
        },
        PartialFunction.empty
      )
```
2018-03-13 23:02:45 +09:00
Dale Wijnand dd4de14593
Upgrade to contraband 0.4.0 2018-03-12 15:39:07 +00:00
eugene yokota 92c95ce290
Merge pull request #3997 from eed3si9n/wip/test-status-thread-safety
Fix race condition in non-forked, parallel tests.
2018-03-07 16:18:55 -05:00
Eugene Yokota 49b4c3a3e0 mima 2018-03-07 15:31:24 -05:00
Dale Wijnand 26014a527e
Use Def.settings (bikeshed) 2018-03-06 19:20:33 +00:00
Dale Wijnand 3791e489b2
Use Def.settings in build.sbt 2018-03-06 11:59:27 +00:00
Dale Wijnand a69c3d6e13
Format build.sbt 2018-03-06 11:59:27 +00:00
Dale Wijnand 8187a51d31
Cleanup local Scripted plugin 2018-03-06 11:54:11 +00:00
Dale Wijnand b9e3d6aa2d
Define local Scripted plugin keys in Global scope 2018-03-06 11:54:11 +00:00
Dale Wijnand 90cd60f3b9
Merge branch '1.1.x' into merge-1.1.x-into-1.x
* 1.1.x:
  Use Java's redirectInput rather than sys.process's connectInput
  Re-write toolboxClasspath to use sbt-buildinfo
  Cleanup generateToolboxClasspath
  Upgrade to sbt-buildinfo 0.8.0
  Fix how fullClasspath is defined in TestBuildInfo
  delete buildinfo.BuildInfo from sbt main

Conflicts:
	project/plugins.sbt
2018-02-28 10:30:53 +00:00
Dale Wijnand 27fe5a6957
Re-write toolboxClasspath to use sbt-buildinfo 2018-02-23 13:20:19 +00:00
Dale Wijnand 8182741480
Cleanup generateToolboxClasspath 2018-02-23 13:19:07 +00:00
Dale Wijnand edb828a8d7
Upgrade to sbt-buildinfo 0.8.0 2018-02-23 13:19:05 +00:00
Dale Wijnand c7cc52092e
Fix how fullClasspath is defined in TestBuildInfo 2018-02-23 13:17:51 +00:00
xuwei-k c1e0785a1f
delete buildinfo.BuildInfo from sbt main
sbt-buildinfo plugin have `buildInfoScopedSettings(Compile)` in default.
I think it is unnecessary. or we should set "buildinfoPackage in Compile" and "buildinfoObject in Compile"

https://github.com/sbt/sbt-buildinfo/blob/v0.7.0/src/main/scala/sbtbuildinfo/BuildInfoPlugin.scala#L11
2018-02-22 16:46:58 +00:00
eugene yokota e078c126d1
Merge pull request #3964 from sbt/1.1.x
1.1.x
2018-02-21 15:12:44 -05:00
Eugene Yokota 594738bb9c add publishLocalAllModule command 2018-02-21 02:28:33 -05:00
Dale Wijnand 20367938b1
version := "1.2.0-SNAPSHOT" 2018-02-14 14:38:25 +00:00
Dale Wijnand 76e2f550ec
Merge branch '1.1.x' into merge-1.1.x-into-1.x
* 1.1.x:
  Update mimaPreviousArtifacts/sbt.version
  Introduce SBT_GLOBAL_SERVER_DIR env var to override too long paths
  Handle very long socket file paths on UNIX

Conflicts:
	project/build.properties
2018-02-14 14:38:07 +00:00
Dale Wijnand e8d1a30474
Update mimaPreviousArtifacts/sbt.version 2018-02-14 10:53:37 +00:00
Eugene Yokota 3db0e09b33 Merge branch '1.1.x' into wip/1.1.1
# Conflicts:
#	main/src/main/scala/sbt/internal/CommandExchange.scala
#	main/src/main/scala/sbt/internal/ConsoleProject.scala
#	notes/1.0.2/sample.md
#	notes/1.1.1/sample.md
#	notes/sample.md
#	sbt/src/test/scala/sbt/ServerSpec.scala
2018-02-09 23:55:23 -05:00
Eugene Yokota 39d9927179 1.1.2-SNAPSHOT 2018-02-08 13:08:32 -05:00
Eugene Yokota bd0e44c292 start an instance of sbt in the background 2018-02-07 17:49:22 -05:00
Eugene Yokota a2347332ab Use ipcsocket 2018-02-07 17:46:23 -05:00
Dale Wijnand 4f4328748c
Try RunFromSourceBasedRemoteSbtCreator 2018-02-06 14:14:26 +00:00
Eugene Yokota 1f9a8bf310 start an instance of sbt in the background 2018-01-30 23:46:12 -05:00
Eugene Yokota 50f3dd2e20 Use ipcsocket 2018-01-30 23:21:10 -05:00
Dale Wijnand e3f33ddf7d
Merge pull request #3897 from dwijnand/misc
Misc tweaks and cleanups
2018-01-30 13:02:55 +00:00
Dale Wijnand 2f48425511
Remove old zinc addSbtAlternateResolver stuff 2018-01-30 07:29:17 +00:00
Eugene Yokota c20029ce16 Work around package name confusion
This works around the name conflict between sbt.test package and sbt.Keys.test.

1. sbt.test package is renamed to sbt.scriptedtest. This allows 1.0 plugins and builds to use `test` to mean `Keys.test`.
2. To keep binary compatibility for sbt 0.13 scripted, I am adding `sbt.test.ScriptedRunner` and `sbt.test.ScriptedTests` in `scripted-plugin` artifact.
3. Another affected user is Giter8 plugin that uses ScriptedPlugin. Since the intereactions are limited to `sbt.ScriptedPlugin.*`, we should be fine here. - https://github.com/foundweekends/giter8/blob/v0.11.0-M2/plugin/src/main/scala-sbt-1.0/giter8/SBTCompat.scala
2018-01-22 14:03:02 -05:00
Eugene Yokota 08eaba9107 Add SbtPlugin
Fixes #3538

This brings in `sbt.ScriptedPlugin` as `sbt.plugins.ScriptedPlugin` into sbt mothership.
In addition, `sbt.plugins.SbtPlugin` is added that enables the scripted plugin and `sbtPlugin := true`.

This allows plugin authors to bring in scripted plugin by writing:

```scala
lazy val root = (project in file("."))
  .enablePlugins(SbtPlugin)
```
2018-01-22 14:02:06 -05:00
Dale Wijnand c00739ebcd
Fix sbtOn's prompt & echo
This is what it looks like now! 🎉

    > sbtOn /s/t-sbtOn
    [...]
    [info] Running (fork) sbt.RunFromSourceMain /s/t-sbtOn
    Listening for transport dt_socket at address: 5005
    [warn] sbt version mismatch, current: 1.0.3, in build.properties: "1.1.0", use 'reboot' to use the new value.
    [info] Loading settings from idea.sbt,global-plugins.sbt ...
    [info] Loading global plugins from /Users/dnw/.dotfiles/.sbt/1.0/plugins
    [info] Updating ProjectRef(uri("file:/Users/dnw/.sbt/1.0/plugins/"), "global-plugins")...
    [info] Done updating.
    [info] Loading settings from plugins.sbt ...
    [info] Loading project definition from /s/t-sbtOn/project
    [info] Updating ProjectRef(uri("file:/s/t-sbtOn/project/"), "t-sbton-build")...
    [info] Done updating.
    [info] Loading settings from build.sbt ...
    [info] Set current project to t (in build file:/s/t-sbtOn/)
    [info] sbt server started at local:///Users/dnw/.sbt/1.0/server/2c27eaf4c750902a3a41/sock
    > show baseDirectory
    [info] /s/t-sbtOn
    > exit
    [info] shutting down server
    [success] Total time: 34 s, completed 16-Jan-2018 14:37:32
    > Exception in thread "Thread-17" java.io.IOException: Stream closed
    	at java.lang.ProcessBuilder$NullOutputStream.write(ProcessBuilder.java:433)
    	at java.io.OutputStream.write(OutputStream.java:116)
    	at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    	at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    	at java.io.FilterOutputStream.close(FilterOutputStream.java:158)
    	at scala.sys.process.BasicIO$.$anonfun$input$1(BasicIO.scala:200)
    	at scala.sys.process.BasicIO$.$anonfun$input$1$adapted(BasicIO.scala:198)
    	at scala.sys.process.ProcessBuilderImpl$Simple.$anonfun$run$2(ProcessBuilderImpl.scala:75)
    	at scala.sys.process.ProcessImpl$Spawn$$anon$1.run(ProcessImpl.scala:23)

    > show {.}/baseDirectory
    [...]
    [info] ThisBuild / baseDirectory
    [info] 	/d/sbt
2018-01-16 14:40:03 +00:00