Skip to content

Commit

Permalink
Bump scalafmt to 3.8.4 (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gedochao authored Jan 21, 2025
1 parent 0b37629 commit ce1e52b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import mill._
import mill.scalalib._

object Versions {
def scalafmtVersion = "3.8.3"
def scalafmtVersion = "3.8.4"

def scalaVersion = "2.13.16"

Expand Down Expand Up @@ -47,8 +47,8 @@ trait ScalafmtNativeImage extends ScalafmtNativeImageModule with NativeImage {
origCp.map { p =>
val path = p.path
val name = path.last
// stripping the "--verbose" option from the native-image.properties in the scalafmt-cli JAR,
// as GraalVM 22.2 doesn't accept this option in properties files anymore
// stripping the "--verbose" and other options from the native-image.properties in the scalafmt-cli JAR,
// as GraalVM 22.2 doesn't accept these options in properties files anymore
if (name.startsWith("scalafmt-cli_2.13-") && name.endsWith(".jar")) {
import java.io.{ByteArrayOutputStream, FileOutputStream, InputStream}
import java.util.zip.{ZipEntry, ZipFile, ZipOutputStream}
Expand Down Expand Up @@ -83,7 +83,13 @@ trait ScalafmtNativeImage extends ScalafmtNativeImageModule with NativeImage {
baos.write(buf, 0, read)
}
val content = new String(baos.toByteArray, "UTF-8")
val updatedContent = content.replace("--verbose \\\n", "")
val updatedContent =
content
.replace("--verbose \\\n", "")
.replace("--strict-image-heap \\\n", "")
.replace("-march=native \\\n", "")
.replace("-H:+UnlockExperimentalVMOptions \\\n", "")
.replace("-H:-UnlockExperimentalVMOptions", "")
zos.write(updatedContent.getBytes("UTF-8"))
}
else {
Expand Down

0 comments on commit ce1e52b

Please sign in to comment.