diff --git a/build.sc b/build.sc index dc97f80..68df8bd 100644 --- a/build.sc +++ b/build.sc @@ -74,8 +74,14 @@ trait MillKotlinModule extends PublishModule with ScoverageModule with Cross.Mod override def publishVersion: T[String] = VcsVersion.vcsState().format() override def artifactSuffix: T[String] = s"_mill${millPlatform}_${artifactScalaVersion()}" - override def javacOptions = Seq("-source", "1.8", "-target", "1.8", "-encoding", "UTF-8") + override def javacOptions = { + val release = + if (scala.util.Properties.isJavaAtLeast(11)) Seq("-release", "8") + else Seq("-source", "1.8", "-target", "1.8") + release ++ Seq("-encoding", "UTF-8", "-deprecation") + } override def scalacOptions = Seq("-target:jvm-1.8", "-encoding", "UTF-8", "-deprecation") + override def scoverageVersion = deps.scoverageVersion def pomSettings = T { @@ -96,8 +102,9 @@ object main extends Cross[MainCross](millApiVersions.map(_._1)) trait MainCross extends MillKotlinModule { override def artifactName = "de.tobiasroeser.mill.kotlin" override def moduleDeps: Seq[PublishModule] = Seq(worker) - override def ivyDeps = Agg( - ivy"${scalaOrganization()}:scala-library:${scalaVersion()}") + override def ivyDeps = Agg( + ivy"${scalaOrganization()}:scala-library:${scalaVersion()}" + ) override def sources = T.sources { val suffixes = ZincWorkerUtil.matchingVersions(millPlatform) ++ diff --git a/main/src/de/tobiasroeser/mill/kotlin/KotlinModule.scala b/main/src/de/tobiasroeser/mill/kotlin/KotlinModule.scala index 4e60f87..a1fda88 100644 --- a/main/src/de/tobiasroeser/mill/kotlin/KotlinModule.scala +++ b/main/src/de/tobiasroeser/mill/kotlin/KotlinModule.scala @@ -142,15 +142,13 @@ trait KotlinModule extends JavaModule with KotlinModulePlatform { outer => val isJava = javaSourceFiles.nonEmpty val isMixed = isKotlin && isJava - val counts = Seq("Kotlin" -> kotlinSourceFiles.size, "Java" -> javaSourceFiles.size) - ctx.log.info( - s"Compiling ${counts.filter(_._2 > 0).map { case (n, c) => s"$c $n" }.mkString(" and ")} sources to ${classes} ..." - ) - val compileCp = compileClasspath().map(_.path).filter(os.exists) val updateCompileOutput = upstreamCompileOutput() def compileJava: Result[CompilationResult] = { + ctx.log.info( + s"Compiling ${javaSourceFiles.size} Java sources to ${classes} ..." + ) // The compile step is lazy, but it's dependencies are not! internalCompileJavaFiles( worker = zincWorkerRef().worker(), @@ -164,6 +162,9 @@ trait KotlinModule extends JavaModule with KotlinModulePlatform { outer => } if (isMixed || isKotlin) { + ctx.log.info( + s"Compiling ${kotlinSourceFiles.size} Kotlin sources to ${classes} ..." + ) val compilerArgs: Seq[String] = Seq( // destdir Seq("-d", classes.toIO.getAbsolutePath()),