Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ case class ModuleSpec(
children: Seq[ModuleSpec] = Nil,
quarkusPlatformVersion: Value[String] = Value(),
annotationProcessorsMvnDeps: Values[MvnDep] = Values(),
artifactGroupId: Value[String] = Value()
artifactGroupId: Value[String] = Value(),
kotlinVersion: Value[String] = Value(),
kotlincOptions: Values[Opt] = Values(),
kotlincPluginMvnDeps: Values[MvnDep] = Values()
) {

def isBomModule: Boolean = supertypes.contains("BomModule")
Expand Down Expand Up @@ -340,7 +343,8 @@ object ModuleSpec {
mvnDeps.iterator.map(dep => dep.organization -> dep.name).collectFirst {
case ("org.testng", _) => "TestModule.TestNg"
case ("junit", _) => "TestModule.Junit4"
case ("org.junit.jupiter", _) | ("org.springframework.boot", "spring-boot-starter-test") =>
case ("org.junit.jupiter", _) | ("org.springframework.boot", "spring-boot-starter-test") |
("org.jetbrains.kotlin", "kotlin-test" | "kotlin-test-junit5") =>
"TestModule.Junit5"
case ("com.lihaoyi", "utest") => "TestModule.Utest"
case ("org.typelevel", "weaver-cats") => "TestModule.Weaver"
Expand Down
10 changes: 8 additions & 2 deletions libs/init/buildgen/src/mill/main/buildgen/BuildGen.scala
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ trait BuildGen {
mimaReportSignatureProblems =
parentValue(a.mimaReportSignatureProblems, b.mimaReportSignatureProblems),
annotationProcessorsMvnDeps =
parentValues(a.annotationProcessorsMvnDeps, b.annotationProcessorsMvnDeps)
parentValues(a.annotationProcessorsMvnDeps, b.annotationProcessorsMvnDeps),
kotlinVersion = parentValue(a.kotlinVersion, b.kotlinVersion),
kotlincOptions = parentValues(a.kotlincOptions, b.kotlincOptions),
kotlincPluginMvnDeps = parentValues(a.kotlincPluginMvnDeps, b.kotlincPluginMvnDeps)
)

def extendValue[A](a: Value[A], parent: Value[A]) = a.copy(
Expand Down Expand Up @@ -178,7 +181,10 @@ trait BuildGen {
mimaReportSignatureProblems =
extendValue(a.mimaReportSignatureProblems, parent.mimaReportSignatureProblems),
annotationProcessorsMvnDeps =
extendValues(a.annotationProcessorsMvnDeps, parent.annotationProcessorsMvnDeps)
extendValues(a.annotationProcessorsMvnDeps, parent.annotationProcessorsMvnDeps),
kotlinVersion = extendValue(a.kotlinVersion, parent.kotlinVersion),
kotlincOptions = extendValues(a.kotlincOptions, parent.kotlincOptions),
kotlincPluginMvnDeps = extendValues(a.kotlincPluginMvnDeps, parent.kotlincPluginMvnDeps)
)

val (baseHierarchy, testHierarchy) = baseTestHierarchy.unzip
Expand Down
3 changes: 3 additions & 0 deletions libs/init/buildgen/src/mill/main/buildgen/BuildGenScala.scala
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ object BuildGenScala extends BuildGen {
lines += renderDefValues("scalacOptions", scalacOptions, encodeLiteralOpt)
lines += renderDefValues("scalacPluginMvnDeps", scalacPluginMvnDeps, encodeMvnDep)
lines += renderDefValues("javacOptions", javacOptions, encodeOpt)
lines += renderDefValue("kotlinVersion", kotlinVersion, encodeString)
lines += renderDefValues("kotlincOptions", kotlincOptions, encodeLiteralOpt)
lines += renderDefValues("kotlincPluginMvnDeps", kotlincPluginMvnDeps, encodeMvnDep)
lines += renderDefValues(
"sourcesRootFolders",
sourcesRootFolders,
Expand Down
11 changes: 11 additions & 0 deletions libs/init/buildgen/src/mill/main/buildgen/BuildGenYaml.scala
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ object BuildGenYaml extends BuildGen {
quarkusPlatformVersion.base.foreach(v =>
lines += s"""def quarkusPlatformVersion = "$v""""
)
kotlinVersion.base.foreach(v =>
lines += s"""def kotlinVersion = "$v""""
)
renderScalaOptValues("def kotlincOptions", kotlincOptions).foreach(lines += _)
renderScalaMvnDepValues("def kotlincPluginMvnDeps", kotlincPluginMvnDeps).foreach(lines += _)

artifactName.base.foreach(v => lines += s"def artifactName = $v")

Expand Down Expand Up @@ -242,6 +247,12 @@ object BuildGenYaml extends BuildGen {
"quarkusPlatformVersion",
quarkusPlatformVersion
).foreach(lines += _)
renderYamlStringValue(
"kotlinVersion",
kotlinVersion
).foreach(lines += _)
renderYamlStringListValues("kotlincOptions", kotlincOptions).foreach(lines += _)
renderYamlMvnDepsList("kotlincPluginMvnDeps", kotlincPluginMvnDeps).foreach(lines += _)

renderYamlStringValue(
"artifactGroupId",
Expand Down
Loading
Loading