Skip to content

Commit

Permalink
Specify output directory when compiling
Browse files Browse the repository at this point in the history
This way, logging looks similar to Scala/Java sources compilation in sbt
  • Loading branch information
timaliberdov committed Jan 5, 2024
1 parent 7c61a7c commit 637ae58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/scala/kotlin/KotlinCompile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ object KotlinCompile {
f0.relativeTo(f).isDefined && f != f0)) map (d =>
(d, (d ** javaFiles).get)) filter (_._2.nonEmpty)
if (kotlinSources.isEmpty) {
s.log.debug("No sources found, skipping kotlin compile")
s.log.debug("No sources found, skipping Kotlin compile")
} else {
s.log.debug(s"Compiling sources $kotlinSources")
def pluralizeSource(count: Int) =
if (count == 1) "source" else "sources"
val message =
s"Compiling ${kotlinSources.size} Kotlin ${pluralizeSource(kotlinSources.size)}"
s"Compiling ${kotlinSources.size} Kotlin ${pluralizeSource(kotlinSources.size)} to ${output.getAbsolutePath} ..."
s.log.info(message)
args.freeArgs = (kotlinSources ++ javaSources.map(_._1)).map(_.getAbsolutePath).asJava
args.noStdlib = true
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/sbt/KotlinTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ object KotlinTest {
JavaAnalyze(xs.map(_.toPath), srcs, log, output, None)(callback, loader, readAPI)
}._2
val frameworks = (Test / loadedTestFrameworks).value.values.toList
log.info(s"Compiling ${srcs.length} Kotlin source to $out...")
log.info(s"Compiling ${srcs.length} Kotlin source to $out ...")
Tests.discover(frameworks, a0, log)._1
}
}

0 comments on commit 637ae58

Please sign in to comment.