From bed3a573dce432e07cc6b14aa27313fd0e59194b Mon Sep 17 00:00:00 2001 From: Michael Bryzek Date: Fri, 10 Jul 2026 08:42:39 -0400 Subject: [PATCH] Upgrade scala3 to 3.8.4, sbt to 1.12.11, commons-compress to 1.28.0 Scala 3.8.4 fatal-warnings fallout: - Replace deprecated new URL(String) with new URI(String).toURL - Replace deprecated -Xfatal-warnings alias with -Werror Co-Authored-By: Claude Fable 5 --- build.sbt | 6 +++--- project/build.properties | 2 +- .../scala/io/apibuilder/validation/util/UrlDownloader.scala | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.sbt b/build.sbt index 8e9c302..c1c6034 100644 --- a/build.sbt +++ b/build.sbt @@ -1,5 +1,5 @@ lazy val scala2 = "2.13.16" -lazy val scala3 = "3.4.2" +lazy val scala3 = "3.8.4" lazy val supportedScalaVersions = List(scala2, scala3) name := "apibuilder-validation" @@ -10,7 +10,7 @@ ThisBuild / scalaVersion := scala3 lazy val allScalacOptions = Seq( "-feature", - "-Xfatal-warnings", + "-Werror", "-Wconf:src=generated/.*:silent", "-deprecation" ) @@ -29,7 +29,7 @@ lazy val root = project "com.github.apicollective" % "apibuilder-commons" % (if (scalaVersion.value.startsWith("3")) "0.1.0" else "0.0.6"), "com.typesafe.play" %% "play-json" % (if (scalaVersion.value.startsWith("3")) "2.10.6" else "2.9.4"), "com.typesafe.play" %% "play-json-joda" % (if (scalaVersion.value.startsWith("3")) "2.10.6" else "2.9.4"), - "org.apache.commons" % "commons-compress" % "1.26.2", + "org.apache.commons" % "commons-compress" % "1.28.0", "org.typelevel" %% "cats-core" % "2.12.0", "org.scalatest" %% "scalatest" % "3.2.19" % Test, ), diff --git a/project/build.properties b/project/build.properties index 8fdecc2..7ed9916 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1,3 +1,3 @@ -sbt.version=1.10.0 +sbt.version=1.12.11 diff --git a/src/main/scala/io/apibuilder/validation/util/UrlDownloader.scala b/src/main/scala/io/apibuilder/validation/util/UrlDownloader.scala index 86b7ec0..82dd94b 100644 --- a/src/main/scala/io/apibuilder/validation/util/UrlDownloader.scala +++ b/src/main/scala/io/apibuilder/validation/util/UrlDownloader.scala @@ -1,7 +1,7 @@ package io.apibuilder.validation.util import java.io.{BufferedInputStream, InputStream} -import java.net.URL +import java.net.{URI, URL} import cats.data.ValidatedNec import cats.implicits._ @@ -11,7 +11,7 @@ import scala.util.{Failure, Success, Try} object ValidatedUrlDownloader { def validateUrl(url: String): ValidatedNec[String, URL] = { Try { - new URL(url) + new URI(url).toURL } match { case Success(u) => u.validNec case Failure(ex) => s"Invalid URL: ${ex.getMessage}".invalidNec