Skip to content

Commit

Permalink
Move dependency declarations into main build
Browse files Browse the repository at this point in the history
  • Loading branch information
lefou committed Oct 14, 2024
1 parent 30b3445 commit b39ea8d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
33 changes: 18 additions & 15 deletions build.mill
Original file line number Diff line number Diff line change
Expand Up @@ -190,32 +190,35 @@ object Deps {
val kotlinCompiler = ivy"org.jetbrains.kotlin:kotlin-compiler:1.9.24"

object RuntimeDeps {
val dokkaVersion = "1.9.20"
val koverVersion = "0.8.3"

val detektCli = ivy"io.gitlab.arturbosch.detekt:detekt-cli:1.23.7"
val dokkaAnalysisDescriptors = ivy"org.jetbrains.dokka:analysis-kotlin-descriptors:$dokkaVersion"
val dokkaBase = ivy"org.jetbrains.dokka:dokka-base:$dokkaVersion"
val dokkaCli = ivy"org.jetbrains.dokka:dokka-cli:$dokkaVersion"
val errorProneCore = ivy"com.google.errorprone:error_prone_core:2.31.0"
val freemarker = ivy"org.freemarker:freemarker:2.3.31"
val jupiterInterface = ivy"com.github.sbt.junit:jupiter-interface:0.11.4"
val sbtTestInterface = ivy"com.github.sbt:junit-interface:0.13.2"
val koverVersion = "0.8.3"
val kotlinxHtmlJvm = ivy"org.jetbrains.kotlinx:kotlinx-html-jvm:0.8.0"
val koverCli = ivy"org.jetbrains.kotlinx:kover-cli:$koverVersion"
val koverJvmAgent = ivy"org.jetbrains.kotlinx:kover-jvm-agent:$koverVersion"
val ktfmtVersion = "0.52"
val ktfmt = ivy"com.facebook:ktfmt:$ktfmtVersion"
val detektVersion = "1.23.7"
val detektCli = ivy"io.gitlab.arturbosch.detekt:detekt-cli:$detektVersion"
val dokkaVersion = "1.9.20"
val dokkaCli = ivy"org.jetbrains.dokka:dokka-cli:$dokkaVersion"
val dokkaBase = ivy"org.jetbrains.dokka:dokka-base:$dokkaVersion"
val dokkaAnalysisDescriptors = ivy"org.jetbrains.dokka:analysis-kotlin-descriptors:$dokkaVersion"
val ktfmt = ivy"com.facebook:ktfmt:0.52"
val sbtTestInterface = ivy"com.github.sbt:junit-interface:0.13.2"

def all = Seq(
detektCli,
dokkaAnalysisDescriptors,
dokkaBase,
dokkaCli,
errorProneCore,
freemarker,
jupiterInterface,
sbtTestInterface,
kotlinxHtmlJvm,
koverCli,
koverJvmAgent,
ktfmt,
detektCli,
dokkaCli,
dokkaBase,
dokkaAnalysisDescriptors
sbtTestInterface,
)
}

Expand Down
8 changes: 5 additions & 3 deletions kotlinlib/package.mill
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ object `package` extends RootModule with build.MillPublishScalaModule with Build
def buildInfoObjectName = "Versions"
def buildInfoMembers = Seq(
BuildInfo.Value("koverVersion", build.Deps.RuntimeDeps.koverVersion, "Version of Kover."),
BuildInfo.Value("ktfmtVersion", build.Deps.RuntimeDeps.ktfmtVersion, "Version of Ktfmt."),
BuildInfo.Value("detektVersion", build.Deps.RuntimeDeps.detektVersion, "Version of Detekt."),
BuildInfo.Value("dokkaVersion", build.Deps.RuntimeDeps.dokkaVersion, "Version of Dokka.")
BuildInfo.Value("ktfmtVersion", build.Deps.RuntimeDeps.ktfmt.version, "Version of Ktfmt."),
BuildInfo.Value("detektVersion", build.Deps.RuntimeDeps.detektCli.version, "Version of Detekt."),
BuildInfo.Value("dokkaVersion", build.Deps.RuntimeDeps.dokkaVersion, "Version of Dokka."),
BuildInfo.Value("kotlinxHtmlJvmDep", Dep.unparse(build.Deps.RuntimeDeps.kotlinxHtmlJvm).get, "kotlinx-html-jvm dependency (used for Dokka)"),
BuildInfo.Value("freemarkerDep", Dep.unparse(build.Deps.RuntimeDeps.freemarker).get, "freemarker dependency (used for Dokka)")
)

trait MillKotlinModule extends build.MillPublishScalaModule {
Expand Down
5 changes: 2 additions & 3 deletions kotlinlib/src/mill/kotlinlib/KotlinModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,8 @@ trait KotlinModule extends JavaModule { outer =>
Agg(
ivy"org.jetbrains.dokka:dokka-base:${dokkaVersion()}",
ivy"org.jetbrains.dokka:analysis-kotlin-descriptors:${dokkaVersion()}",
// TODO: use versions defined in Mill build instead
ivy"org.jetbrains.kotlinx:kotlinx-html-jvm:0.8.0",
ivy"org.freemarker:freemarker:2.3.31"
Dep.parse(Versions.kotlinxHtmlJvmDep),
Dep.parse(Versions.freemarkerDep)
)
)
}
Expand Down

0 comments on commit b39ea8d

Please sign in to comment.