From 590dbbacb87d5d8ecaf6a9458fe182a575726b11 Mon Sep 17 00:00:00 2001 From: kenji yoshida <6b656e6a69@gmail.com> Date: Mon, 4 May 2026 01:40:00 +0900 Subject: [PATCH] Avoid infix syntax in build files (#9175) --- build.sbt | 4 ++-- launcher-package/build.sbt | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build.sbt b/build.sbt index 127b8af63..5d9df8924 100644 --- a/build.sbt +++ b/build.sbt @@ -143,7 +143,7 @@ def mimaSettingsSince(versions: Seq[String]): Seq[Def.Setting[?]] = Def.settings ) .toSet } else { - versions.map(v => organization.value % moduleName.value % v cross crossVersion).toSet + versions.map(v => (organization.value % moduleName.value % v).cross(crossVersion)).toSet } }, mimaBinaryIssueFilters ++= Seq( @@ -622,7 +622,7 @@ lazy val commandProj = (project in file("main-command")) Compile / headerCreate / unmanagedSources := { val old = (Compile / headerCreate / unmanagedSources).value old filterNot { x => - (x.getName startsWith "NG") || (x.getName == "ReferenceCountedFileDescriptor.java") + x.getName.startsWith("NG") || (x.getName == "ReferenceCountedFileDescriptor.java") } }, ) diff --git a/launcher-package/build.sbt b/launcher-package/build.sbt index 73c1f35f8..493b46fa3 100755 --- a/launcher-package/build.sbt +++ b/launcher-package/build.sbt @@ -35,7 +35,7 @@ lazy val sbtVersionToRelease = sys.props lazy val scala210 = "2.10.7" lazy val scala210Jline = "org.scala-lang" % "jline" % scala210 lazy val jansi = { - if (sbtVersionToRelease startsWith "1.") "org.fusesource.jansi" % "jansi" % "1.12" + if (sbtVersionToRelease.startsWith("1.")) "org.fusesource.jansi" % "jansi" % "1.12" else "org.fusesource.jansi" % "jansi" % "1.4" } lazy val scala212Compiler = "org.scala-lang" % "scala-compiler" % scala212 @@ -45,13 +45,13 @@ lazy val scala212Xml = "org.scala-lang.modules" % "scala-xml_2.12" % "2.3.0" lazy val sbtActual = "org.scala-sbt" % "sbt" % sbtVersionToRelease lazy val sbt013ExtraDeps = { - if (sbtVersionToRelease startsWith "0.13.") Seq(scala210Jline) + if (sbtVersionToRelease.startsWith("0.13.")) Seq(scala210Jline) else Seq() } lazy val isWindows: Boolean = sys.props("os.name").toLowerCase(java.util.Locale.ENGLISH).contains("windows") -lazy val isExperimental = (sbtVersionToRelease contains "RC") || (sbtVersionToRelease contains "M") +lazy val isExperimental = sbtVersionToRelease.contains("RC") || sbtVersionToRelease.contains("M") val sbtLaunchJarUrl = SettingKey[String]("sbt-launch-jar-url") val sbtLaunchJarLocation = SettingKey[File]("sbt-launch-jar-location") val sbtLaunchJar = TaskKey[File]("sbt-launch-jar", "Resolves SBT launch jar") @@ -245,7 +245,7 @@ val launcherPackage = (project in file(".")) val links = linuxPackageSymlinks.value for { link <- links - if !(link.destination endsWith "sbt-launch.jar") + if !link.destination.endsWith("sbt-launch.jar") } yield link }, @@ -277,11 +277,11 @@ val launcherPackage = (project in file(".")) // RPM SPECIFIC rpmRelease := debianBuildId.value.toString, Rpm / version := { - val stable0 = (sbtVersionToRelease split "[^\\d]" filterNot (_.isEmpty) mkString ".") + val stable0 = (sbtVersionToRelease.split("[^\\d]") filterNot (_.isEmpty) mkString ".") val stable = if (rpmRelease.value == "0") stable0 else stable0 + "." + rpmRelease.value - if (isExperimental) ((sbtVersionToRelease split "[^\\d]" filterNot (_.isEmpty)).toList match { + if (isExperimental) (sbtVersionToRelease.split("[^\\d]").filterNot(_.isEmpty).toList match { case List(_, _, c, d) => List(0, 99, c, d).mkString(".") }) else stable @@ -311,7 +311,7 @@ val launcherPackage = (project in file(".")) Windows / version := { val bid = windowsBuildId.value val sv = sbtVersionToRelease - (sv split "[^\\d]" filterNot (_.isEmpty)) match { + sv.split("[^\\d]").filterNot(_.isEmpty) match { case Array(major, minor, bugfix, _*) if bid == 0 => Seq(major, minor, bugfix) mkString "." case Array(major, minor, bugfix, _*) => Seq(major, minor, bugfix, bid.toString) mkString "." case Array(major, minor) => Seq(major, minor, "0", bid.toString) mkString "." @@ -394,7 +394,7 @@ val launcherPackage = (project in file(".")) }).value, Universal / mappings ++= { val base = baseDirectory.value - if (sbtVersionToRelease startsWith "0.13.") Nil + if (sbtVersionToRelease.startsWith("0.13.")) Nil else Seq[(File, String)]( base.getParentFile / "LICENSE" -> "LICENSE", @@ -429,7 +429,7 @@ def downloadUrlForVersion(v: String) = "https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/" + v + "/sbt-launch.jar" case Array(0, y, _*) if y >= 12 => "https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/" + v + "/sbt-launch.jar" - case Array(1, _, _*) if v contains ("-20") => + case Array(1, _, _*) if v.contains("-20") => "https://repo.scala-sbt.org/scalasbt/maven-snapshots/org/scala-sbt/sbt-launch/" + v + "/sbt-launch.jar" case _ => "https://repo1.maven.org/maven2/org/scala-sbt/sbt-launch/" + v + "/sbt-launch-" + v + ".jar" @@ -489,7 +489,7 @@ lazy val dist = (project in file("dist")) .settings( name := "dist", scalaVersion := { - if (sbtVersionToRelease startsWith "0.13.") scala210 + if (sbtVersionToRelease.startsWith("0.13.")) scala210 else scala212 }, libraryDependencies ++= Seq(