Skip to content

Commit

Permalink
Cap JLine version at 3.25.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Gedochao committed Nov 13, 2024
1 parent fae8a7b commit a685a10
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ object Versions {
def coursier = "2.1.14"
def osLib = "0.11.3"
def uTest = "0.8.4"
def jline = "3.25.0"
}

trait JavaMainClassNativeImage extends NativeImage {
Expand All @@ -45,17 +46,30 @@ trait JavaMainClassNativeImage extends NativeImage {
}
}

object `scala3-graal-processor` extends ScalaModule {
def scalaVersion = Versions.scala
def mainClass = Some("scala.cli.graal.CoursierCacheProcessor")
def ivyDeps = Agg(
ivy"org.virtuslab.scala-cli::scala3-graal:${Versions.scalaCli}"
trait JavaClassNameModule extends ScalaModule {
override def scalaVersion = Versions.scala
override def transitiveIvyDeps = T {
super.transitiveIvyDeps()
.map(_.exclude("org.jline" -> "jline-reader"))
.map(_.exclude("org.jline" -> "jline-terminal"))
.map(_.exclude("org.jline" -> "jline-terminal-jna"))
}
def jlineDeps = Agg(
ivy"org.jline:jline-reader:${Versions.jline}",
ivy"org.jline:jline-terminal:${Versions.jline}",
ivy"org.jline:jline-terminal-jna:${Versions.jline}"
)
override def ivyDeps = super.ivyDeps() ++ jlineDeps
}

object `java-class-name` extends ScalaModule with JavaMainClassNativeImage with JavaClassNamePublishModule {
def scalaVersion = Versions.scala
object `scala3-graal-processor` extends JavaClassNameModule {
override def mainClass = Some("scala.cli.graal.CoursierCacheProcessor")
override def ivyDeps = jlineDeps ++ Agg(
ivy"org.virtuslab.scala-cli::scala3-graal:${Versions.scalaCli}"
)
}

object `java-class-name` extends JavaClassNameModule with JavaMainClassNativeImage with JavaClassNamePublishModule {
def nativeImageClassPath = T {
// adapted from https://github.com/VirtusLab/scala-cli/blob/b19086697401827a6f8185040ceb248d8865bf21/build.sc#L732-L744

Expand All @@ -77,10 +91,10 @@ object `java-class-name` extends ScalaModule with JavaMainClassNativeImage with
System.err.println(s" $f")
cp.split(File.pathSeparator).toSeq.map(p => mill.PathRef(os.Path(p)))
}
def ivyDeps = super.ivyDeps() ++ Seq(
override def ivyDeps = super.ivyDeps() ++ jlineDeps ++ Agg(
ivy"org.scala-lang::scala3-compiler:${Versions.scala}"
)
def compileIvyDeps = super.compileIvyDeps() ++ Seq(
override def compileIvyDeps = super.compileIvyDeps() ++ Agg(
ivy"org.graalvm.nativeimage:svm:${Versions.graalVmVersion}"
)

Expand Down

0 comments on commit a685a10

Please sign in to comment.