From 9a73be7955c37aec7d568937143bac17c02b15dc Mon Sep 17 00:00:00 2001 From: friendseeker <66892505+Friendseeker@users.noreply.github.com> Date: Fri, 18 Oct 2024 00:18:28 -0700 Subject: [PATCH] Remove compilerVersionDependentScalacOptions --- build.sbt | 67 +++++-------------------------------------------------- 1 file changed, 6 insertions(+), 61 deletions(-) diff --git a/build.sbt b/build.sbt index 476898113..e93a834e4 100644 --- a/build.sbt +++ b/build.sbt @@ -87,15 +87,7 @@ def baseSettings: Seq[Setting[?]] = Seq( testFrameworks += new TestFramework("verify.runner.Framework"), compile / javacOptions ++= Seq("-Xlint", "-Xlint:-serial"), Test / publishArtifact := false, - scalacOptions ++= Seq("-YdisableFlatCpCaching"), - scalacOptions += { - scalaBinaryVersion.value match { - case "2.10" | "2.11" => - "-target:jvm-1.8" - case _ => - "-release:8" - } - }, + scalacOptions ++= Seq("-release:8"), semanticdbCompilerPlugin := { ("org.scalameta" % "semanticdb-scalac" % semanticdbVersion.value) .cross(CrossVersion.full) @@ -103,27 +95,6 @@ def baseSettings: Seq[Setting[?]] = Seq( ideSkipProject := scalaVersion.value != defaultScalaVersion, ) -def compilerVersionDependentScalacOptions: Seq[Setting[?]] = Seq( - scalacOptions := { - scalaBinaryVersion.value match { - case "2.12" | "2.13" => - scalacOptions.value ++ List( - "-opt-inline-from:", - "-opt:l:inline", - "-Yopt-inline-heuristics:at-inline-annotated" - ) - case _ => - scalacOptions.value.filterNot( - Set( - "-Xfatal-warnings", - "-deprecation", - "-YdisableFlatCpCaching", - ) - ) - } - } -) - def addBaseSettingsAndTestDeps(p: Project): Project = p.settings(baseSettings).configure(addTestDependencies) @@ -262,20 +233,8 @@ lazy val zincPersist = (projectMatrix in internalPath / "zinc-persist") .settings( name := "zinc Persist", libraryDependencies += sbinary, - libraryDependencies ++= { - scalaPartialVersion.value match { - case Some((major, minor)) if major == 3 || minor >= 13 => - List("org.scala-lang.modules" %% "scala-parallel-collections" % "1.0.4") - case _ => - List() - } - }, compileOrder := sbt.CompileOrder.Mixed, - Compile / scalacOptions ++= (scalaVersion.value match { - case VersionNumber(Seq(2, 12, _*), _, _) => - List("-Ywarn-unused:-imports,-locals,-implicits,-explicits,-privates") - case _ => Nil - }), + libraryDependencies ++= List("org.scala-lang.modules" %% "scala-parallel-collections" % "1.0.4"), Test / classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.Flat, mimaSettings, mimaBinaryIssueFilters ++= ZincBuildUtil.excludeInternalProblems, @@ -319,17 +278,10 @@ lazy val zincCore = (projectMatrix in internalPath / "zinc-core") exclude[ReversedMissingMethodProblem]("xsbti.*"), exclude[MissingClassProblem]("xsbti.*"), ), - libraryDependencies ++= { - scalaPartialVersion.value match { - case Some((major, minor)) if major == 3 || minor >= 13 => - List( - "org.scala-lang" % "scala-reflect" % scala213, - "org.scala-lang.modules" %% "scala-parallel-collections" % "1.0.4" - ) - case _ => - List() - } - }, + libraryDependencies ++= List( + "org.scala-lang" % "scala-reflect" % scala213, + "org.scala-lang.modules" %% "scala-parallel-collections" % "1.0.4" + ), ) .jvmPlatform(scalaVersions = scala3_only) .configure(addBaseSettingsAndTestDeps, addSbtIO, addSbtUtilLogging, addSbtUtilRelation) @@ -397,8 +349,6 @@ lazy val compilerInterface = (projectMatrix in internalPath / "compiler-interfac baseSettings, name := "Compiler Interface", scalaVersion := scala3, - crossScalaVersions := Seq(scala3), - compilerVersionDependentScalacOptions, libraryDependencies ++= Seq(scalatest % Test), exportJars := true, Compile / resourceGenerators += Def.task { @@ -466,7 +416,6 @@ lazy val compilerBridge = (projectMatrix in internalPath / "compiler-bridge") semanticdbEnabled.value && !scalaVersion.value.startsWith("2.10") }, baseSettings, - compilerVersionDependentScalacOptions, // We need this for import Compat._ Compile / scalacOptions --= Seq("-Ywarn-unused-import", "-Xfatal-warnings"), Compile / scalacOptions ++= (scalaVersion.value match { @@ -520,7 +469,6 @@ lazy val compilerBridgeTest = (projectMatrix in internalPath / "compiler-bridge- name := "Compiler Bridge Test", baseSettings, scalaVersion := scala3, - compilerVersionDependentScalacOptions, // we need to fork because in unit tests we set usejavacp = true which means // we are expecting all of our dependencies to be on classpath so Scala compiler // can use them while constructing its own classpath for compilation @@ -547,7 +495,6 @@ lazy val zincApiInfo = (projectMatrix in internalPath / "zinc-apiinfo") ) .settings( name := "zinc ApiInfo", - compilerVersionDependentScalacOptions, mimaSettings, mimaBinaryIssueFilters ++= Seq( exclude[IncompatibleMethTypeProblem]("xsbt.api.HashAPI.hashTypeParameters"), @@ -581,7 +528,6 @@ lazy val zincClasspath = (projectMatrix in internalPath / "zinc-classpath") .dependsOn(compilerInterface) .settings( name := "zinc Classpath", - compilerVersionDependentScalacOptions, libraryDependencies ++= Seq( // scalaCompiler.value, launcherInterface @@ -614,7 +560,6 @@ lazy val zincClassfile = (projectMatrix in internalPath / "zinc-classfile") .dependsOn(compilerInterface, zincTesting % Test) .settings( name := "zinc Classfile", - compilerVersionDependentScalacOptions, Compile / headerSources ~= { xs => val excluded = Set("ZipCentralDir.java", "ZipConstants.java", "ZipUtils.java") xs filter { x =>