Skip to content

Commit 87b8319

Browse files
pvlugterbantonsson
authored andcommitted
Upgrade sbt versions to 0.13.18 and 1.2.8
1 parent 04371d4 commit 87b8319

File tree

11 files changed

+19
-34
lines changed

11 files changed

+19
-34
lines changed

build.sbt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ name := "sbt-javaagent"
1010
organization := "com.lightbend.sbt"
1111

1212
// sbt cross build
13-
crossSbtVersions := Seq("0.13.16", "1.0.0-RC3")
14-
15-
// fixed in https://github.com/sbt/sbt/pull/3397 (for sbt 0.13.17)
16-
sbtBinaryVersion in update := (sbtBinaryVersion in pluginCrossBuild).value
13+
crossSbtVersions := Seq("0.13.18", "1.2.8")
1714

1815
// dependencies
1916
val packagerVersion = "1.2.2-RC2" // with sbt 1.0 cross build

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=0.13.16
1+
sbt.version=0.13.18

src/sbt-test/agent/compile/test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
> set outputStrategy := Some(CustomOutput(new java.io.FileOutputStream(file("run.log"))))
12
> checkDependency
23
> compile
34
> run

src/sbt-test/agent/compile/test.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def expect(name: String, contents: String, expected: String): Unit =
99
assert(contents contains expected, s"$name should contain '$expected'")
1010

1111
TaskKey[Unit]("checkLog") := {
12-
val log = IO.read(BuiltinCommands.lastLogFile(state.value).get)
12+
val log = IO.read(file("run.log"))
1313
expect("run log", log, "Agent 86")
1414
expect("run log", log, "class maxwell.Maxwell")
1515
}

src/sbt-test/agent/confs/build.sbt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,3 @@ lazy val agentConfs = project in file(".") enablePlugins JavaAgent
33
javaAgents += "sbt.javaagent.test" % "maxwell" % sys.props("project.version") % "compile;test"
44

55
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test"
6-
7-
// send test stdout to log — works but should be easier?
8-
// outputStrategy is a setting, so it can't access tasks like streams
9-
testGrouping in Test := {
10-
(testGrouping in Test).value map {
11-
case group @ Tests.Group(_, _, Tests.SubProcess(forkOptions)) =>
12-
group.copy(runPolicy = Tests.SubProcess(copyForkOptions(forkOptions, LoggedOutput(streams.value.log))))
13-
case group => group
14-
}
15-
}
16-
17-
// copy manually to be compatible with both sbt 0.13 (case class) and sbt 1.0 (contraband)
18-
def copyForkOptions(o: ForkOptions, newOutputStrategy: OutputStrategy): ForkOptions = {
19-
ForkOptions(o.javaHome, Some(newOutputStrategy), o.bootJars, o.workingDirectory, o.runJVMOptions, o.connectInput, o.envVars)
20-
}

src/sbt-test/agent/confs/test

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
> set outputStrategy := Some(CustomOutput(new java.io.FileOutputStream(file("run.log"))))
12
> run
2-
> checkLog
3-
> clearLog
3+
> checkRunLog
4+
> set outputStrategy := Some(CustomOutput(new java.io.FileOutputStream(file("test.log"))))
45
> test
5-
> checkLog
6+
> checkTestLog

src/sbt-test/agent/confs/test.sbt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
TaskKey[Unit]("checkLog") := {
2-
val log = IO.read(BuiltinCommands.lastLogFile(state.value).get)
1+
TaskKey[Unit]("checkRunLog") := checkLog("run.log")
2+
TaskKey[Unit]("checkTestLog") := checkLog("test.log")
3+
4+
def checkLog(logFile: String): Unit = {
5+
val log = IO.read(file(logFile))
36

47
def expect(expected: String): Unit = {
58
assert(log contains expected, s"log should contain '$expected'")
@@ -8,7 +11,3 @@ TaskKey[Unit]("checkLog") := {
811
expect("Agent 86")
912
expect("class maxwell.Maxwell")
1013
}
11-
12-
TaskKey[Unit]("clearLog") := {
13-
IO.write(BuiltinCommands.lastLogFile(state.value).get, "")
14-
}

src/sbt-test/agent/provided/test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
> set outputStrategy := Some(CustomOutput(new java.io.FileOutputStream(file("run.log"))))
12
> compile
23
> stage
34
> run

src/sbt-test/agent/provided/test.sbt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ TaskKey[Unit]("check") := {
22
def expect(name: String, contents: String, expected: String): Unit =
33
assert(contents contains expected, s"$name should contain '$expected'")
44

5-
val lastLog = IO.read(BuiltinCommands.lastLogFile(state.value).get)
5+
val log = IO.read(file("run.log"))
66

7-
expect("run log", lastLog, "Agent 86")
8-
expect("run log", lastLog, "class maxwell.Maxwell")
7+
expect("run log", log, "Agent 86")
8+
expect("run log", log, "class maxwell.Maxwell")
99

1010
import scala.sys.process._
1111
val output = ((stagingDirectory in Universal).value / "bin" / packageName.value).absolutePath.!!

src/sbt-test/agent/run/test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
> set outputStrategy := Some(CustomOutput(new java.io.FileOutputStream(file("run.log"))))
12
> run
23
> check

0 commit comments

Comments
 (0)