diff options
author | Alexandra Dima <alexandra.dima@jetbrains.com> | 2019-07-12 17:52:57 +0200 |
---|---|---|
committer | Samvel Abrahamyan <samvel1024@gmail.com> | 2019-10-12 14:33:03 +0200 |
commit | 2be400138fb32a63a3bb05e6fdec31508673331b (patch) | |
tree | 643b58b6b810f28509fdc4fbbcfa9495bc826164 /main/api | |
parent | 9c39dd6776944b15433f44c5c4fba994cdd7d152 (diff) | |
download | mill-2be400138fb32a63a3bb05e6fdec31508673331b.tar.gz mill-2be400138fb32a63a3bb05e6fdec31508673331b.tar.bz2 mill-2be400138fb32a63a3bb05e6fdec31508673331b.zip |
Partially fixed test request by implementing a test reporter, adding it to each task context and sending it to the test task. Implemented BspContext to hold information about the test reporter and the additional bsp compiler arguments. Made a common data structure for different bsp parameters - TaskParameters.
Diffstat (limited to 'main/api')
-rw-r--r-- | main/api/src/mill/api/BspCompileArguments.scala | 13 | ||||
-rw-r--r-- | main/api/src/mill/api/BspContext.scala | 16 | ||||
-rw-r--r-- | main/api/src/mill/api/Ctx.scala | 2 | ||||
-rw-r--r-- | main/api/src/mill/api/TestReporter.scala | 21 |
4 files changed, 51 insertions, 1 deletions
diff --git a/main/api/src/mill/api/BspCompileArguments.scala b/main/api/src/mill/api/BspCompileArguments.scala new file mode 100644 index 00000000..9cfdd500 --- /dev/null +++ b/main/api/src/mill/api/BspCompileArguments.scala @@ -0,0 +1,13 @@ +package mill.api + +class BspCompileArguments { + var arguments: Seq[String] = Seq.empty[String] + + def args: Seq[String] = { + arguments + } + + def setArgs(args: Seq[String]): Unit = { + arguments = args + } +} diff --git a/main/api/src/mill/api/BspContext.scala b/main/api/src/mill/api/BspContext.scala new file mode 100644 index 00000000..c93fbca1 --- /dev/null +++ b/main/api/src/mill/api/BspContext.scala @@ -0,0 +1,16 @@ +package mill.api + +import sbt.testing.Event + +trait BspContext extends BspCompileArguments with TestReporter + +object DummyBspContext extends BspContext { + override def args = Seq.empty[String] + override def logStart(event: Event): Unit = { + + } + + override def logFinish(event: Event): Unit = { + + } +}
\ No newline at end of file diff --git a/main/api/src/mill/api/Ctx.scala b/main/api/src/mill/api/Ctx.scala index 0799d887..439f08d3 100644 --- a/main/api/src/mill/api/Ctx.scala +++ b/main/api/src/mill/api/Ctx.scala @@ -62,7 +62,7 @@ class Ctx( val home: os.Path, val env: Map[String, String], val reporter: Option[ManagedLoggedReporter], - val compileArguments: Seq[String] = Seq.empty[String] + val bsp: BspContext ) extends Ctx.Dest with Ctx.Log diff --git a/main/api/src/mill/api/TestReporter.scala b/main/api/src/mill/api/TestReporter.scala new file mode 100644 index 00000000..b3d0e432 --- /dev/null +++ b/main/api/src/mill/api/TestReporter.scala @@ -0,0 +1,21 @@ +package mill.api + +import sbt.testing._ + +trait TestReporter { + def logStart(event: Event): Unit + + def logFinish(event: Event): Unit + + +} + +object DummyReporter extends TestReporter { + override def logStart(event: Event): Unit = { + + } + + override def logFinish(event: Event): Unit = { + + } +} |