Skip to content

Commit

Permalink
improvement: Add flags to release for JDK 8
Browse files Browse the repository at this point in the history
  • Loading branch information
tgodzik committed Jan 16, 2025
1 parent 9561e03 commit 2305a76
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
9 changes: 7 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@ lazy val interfaces = crossProject(JVMPlatform, NativePlatform)
IO.write(props, "scalafmt properties", out)
List(out)
},
).jvmSettings(crossVersion := CrossVersion.disabled, autoScalaLibrary := false)
).jvmSettings(
javacOptions ++= Seq("-source", "8", "-target", "8"),
Compile / doc / javacOptions := Seq(),
crossVersion := CrossVersion.disabled,
autoScalaLibrary := false,
)

lazy val sysops = crossProject(JVMPlatform, NativePlatform)
.withoutSuffixFor(JVMPlatform).in(file("scalafmt-sysops")).settings(
Expand Down Expand Up @@ -175,7 +180,7 @@ val scalacJvmOptions = Def.setting {
val unused = Seq("imports", "privates", "locals", "patvars", "implicits")
.map(x => s"-Ywarn-unused:$x")

cross ++ unused
cross ++ unused ++ Seq("-target:8", "-release:8")
}

lazy val cli = crossProject(JVMPlatform, NativePlatform)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ object TestHelpers {
val out1 = x1.formattedCode
val lines2 = x1.formattedCode.count(_ == '\n')
val (duration2, result2) = formatCode(out1)
def saveFormatted(): Unit = Files.writeString(
def saveFormatted(): Unit = Files.write(
Paths.get(absPathString + s".formatted.$styleName"),
out1,
out1.getBytes(),
StandardOpenOption.CREATE,
StandardOpenOption.TRUNCATE_EXISTING,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ trait FormatAssertions {
" " * e.pos.startColumn + "^", // arrow
linesAfterCaret.mkString("\n"),
"====== full result: ======",
obtained.stripTrailing(),
obtained.trim(),
).filter(_.nonEmpty).mkString("", "\n", "\n")
}
}

0 comments on commit 2305a76

Please sign in to comment.