Skip to content

Commit 6d5a36f

Browse files
Ensure config module is compatible with Java 8
1 parent 1a03df3 commit 6d5a36f

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

build.sc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,12 +445,15 @@ class Config(val crossScalaVersion: String) extends ScalaCliCrossSbtModule
445445
if (crossScalaVersion.startsWith("2.12.")) Seq(Deps.collectionCompat)
446446
else Nil
447447
super.ivyDeps() ++ maybeCollectionCompat ++ Agg(
448-
Deps.jsoniterCore
448+
Deps.jsoniterCoreJava8
449449
)
450450
}
451451
def compileIvyDeps = super.compileIvyDeps() ++ Agg(
452-
Deps.jsoniterMacros
452+
Deps.jsoniterMacrosJava8
453453
)
454+
def scalacOptions = T {
455+
super.scalacOptions() ++ Seq("-release", "8")
456+
}
454457

455458
// Disabling Scalafix in 2.13 and 3, so that it doesn't remove
456459
// some compatibility-related imports, that are actually only used

modules/config/src/main/scala/scala/cli/config/PasswordOption.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ object PasswordOption extends LowPriorityPasswordOption {
6060
}
6161
final case class File(path: Path) extends PasswordOption {
6262
def get(): Secret[String] = {
63-
val value = Files.readString(path) // trim that?
63+
val value = new String(Files.readAllBytes(path), StandardCharsets.UTF_8) // trim that?
6464
Secret(value)
6565
}
6666
override def getBytes(): Secret[Array[Byte]] = {

project/deps.sc

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,14 @@ object InternalDeps {
5858
object Deps {
5959
object Versions {
6060
// jni-utils version may need to be sync-ed when bumping the coursier version
61-
def coursier = "2.1.0-M6-53-gb4f448130"
62-
def coursierCli = "2.1.0-M5-18-gfebf9838c"
63-
def jsoniterScala = "2.17.3"
64-
def scalaMeta = "4.5.13"
65-
def scalaNative = "0.4.7"
66-
def scalaPackager = "0.1.28"
67-
def signingCli = "0.1.9"
61+
def coursier = "2.1.0-M6-53-gb4f448130"
62+
def coursierCli = "2.1.0-M5-18-gfebf9838c"
63+
def jsoniterScala = "2.17.3"
64+
def jsoniterScalaJava8 = "2.13.5"
65+
def scalaMeta = "4.5.13"
66+
def scalaNative = "0.4.7"
67+
def scalaPackager = "0.1.28"
68+
def signingCli = "0.1.9"
6869
}
6970
// DO NOT hardcode a Scala version in this dependency string
7071
// This dependency is used to ensure that Ammonite is available for Scala versions
@@ -95,8 +96,12 @@ object Deps {
9596
ivy"com.github.plokhotnyuk.jsoniter-scala:jsoniter-scala-core_2.13:${Versions.jsoniterScala}"
9697
def jsoniterCore =
9798
ivy"com.github.plokhotnyuk.jsoniter-scala::jsoniter-scala-core:${Versions.jsoniterScala}"
99+
def jsoniterCoreJava8 =
100+
ivy"com.github.plokhotnyuk.jsoniter-scala::jsoniter-scala-core:${Versions.jsoniterScalaJava8}"
98101
def jsoniterMacros =
99102
ivy"com.github.plokhotnyuk.jsoniter-scala::jsoniter-scala-macros:${Versions.jsoniterScala}"
103+
def jsoniterMacrosJava8 =
104+
ivy"com.github.plokhotnyuk.jsoniter-scala::jsoniter-scala-macros:${Versions.jsoniterScalaJava8}"
100105
def libdaemonjvm = ivy"io.github.alexarchambault.libdaemon::libdaemon:0.0.10"
101106
def libsodiumjni = ivy"io.github.alexarchambault.tmp.libsodiumjni:libsodiumjni:0.0.3"
102107
def macroParadise = ivy"org.scalamacros:::paradise:2.1.1"

0 commit comments

Comments
 (0)