diff options
author | Alexandra Dima <alexandra.dima@jetbrains.com> | 2019-07-24 16:57:44 +0200 |
---|---|---|
committer | Samvel Abrahamyan <samvel1024@gmail.com> | 2019-10-12 14:33:11 +0200 |
commit | 8138acf4911b668b3b15c19fd51c4f5e6aadc083 (patch) | |
tree | 8ce53d3b1f5707a7fe0a3826693f3050b8038b84 /main | |
parent | 0b4bcbbfabe06d549d95efb427e75356287398fb (diff) | |
download | mill-8138acf4911b668b3b15c19fd51c4f5e6aadc083.tar.gz mill-8138acf4911b668b3b15c19fd51c4f5e6aadc083.tar.bz2 mill-8138acf4911b668b3b15c19fd51c4f5e6aadc083.zip |
Added docstrigs and comments. Also cleaned unused imports. Changd the printStream connected to the compilation logger sent to the mill evaluator from Bsp from System.out (might interfere with the lsp communication ) to the outputstream of the evaluator's logger.
Diffstat (limited to 'main')
-rw-r--r-- | main/api/src/mill/api/BspCompileArguments.scala | 9 | ||||
-rw-r--r-- | main/api/src/mill/api/BspContext.scala | 14 | ||||
-rw-r--r-- | main/api/src/mill/api/TestReporter.scala | 10 |
3 files changed, 33 insertions, 0 deletions
diff --git a/main/api/src/mill/api/BspCompileArguments.scala b/main/api/src/mill/api/BspCompileArguments.scala index 1af45a61..73586cc8 100644 --- a/main/api/src/mill/api/BspCompileArguments.scala +++ b/main/api/src/mill/api/BspCompileArguments.scala @@ -1,8 +1,17 @@ package mill.api +/** + * Data structure to represent Bsp client-specified + * compilation arguments + */ class BspCompileArguments { var arguments: Seq[String] = Seq.empty[String] + /** + * Return the compilation arguments specified by the + * Bsp client, which may or may not be found in the + * compiler options of any module from the build file. + */ def args: Seq[String] = { arguments } diff --git a/main/api/src/mill/api/BspContext.scala b/main/api/src/mill/api/BspContext.scala index c93fbca1..1281518d 100644 --- a/main/api/src/mill/api/BspContext.scala +++ b/main/api/src/mill/api/BspContext.scala @@ -2,10 +2,24 @@ package mill.api import sbt.testing.Event +/** + * Bsp Context with functionality for retrieving compile + * arguments provided by a Bsp client, as well as for logging + * the start and finish of a task triggered by the request of + * a Bsp client. Can be integrated into mill's Ctx to inject + * Bsp functionality into tasks like compile/run/test. + */ trait BspContext extends BspCompileArguments with TestReporter +/** + * Dummy Bsp Context that does nothing + * upon starting or finishing a task, and + * contains no client-specified compilation + * arguments + */ object DummyBspContext extends BspContext { override def args = Seq.empty[String] + override def logStart(event: Event): Unit = { } diff --git a/main/api/src/mill/api/TestReporter.scala b/main/api/src/mill/api/TestReporter.scala index b3d0e432..97dec761 100644 --- a/main/api/src/mill/api/TestReporter.scala +++ b/main/api/src/mill/api/TestReporter.scala @@ -2,6 +2,12 @@ package mill.api import sbt.testing._ +/** + * Test reporter class that can be + * injected into the test task and + * report information upon the start + * and the finish of testing events + */ trait TestReporter { def logStart(event: Event): Unit @@ -10,6 +16,10 @@ trait TestReporter { } +/** + * Dummy Test Reporter that doesn't report + * anything for any testing event. + */ object DummyReporter extends TestReporter { override def logStart(event: Event): Unit = { |