Merge pull request #7994 from xuwei-k/unused-build-file

[2.x] remove unused code in build files
This commit is contained in:
eugene yokota 2025-01-01 14:30:12 -05:00 committed by GitHub
commit 1a8e5fbd4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 1 additions and 42 deletions

View File

@ -1294,17 +1294,6 @@ lazy val javafmtOnCompile = taskKey[Unit]("Formats java sources before compile")
lazy val scriptedProjects = ScopeFilter(inAnyProject)
def customCommands: Seq[Setting[_]] = Seq(
commands += Command.command("setupBuildScala212") { state =>
s"""set scalaVersion in ThisBuild := "$scala212" """ ::
state
},
commands += Command.command("release-sbt-local") { state =>
"clean" ::
"so compile" ::
"so publishLocal" ::
"reload" ::
state
},
commands += Command.command("publishLocalAllModule") { state =>
val extracted = Project.extract(state)
import extracted._

View File

@ -1,26 +0,0 @@
import java.io.File
import java.util.zip.ZipFile
import scala.collection.JavaConverters._
object Check {
def onlyNamespace(ns: String, jar: File, ignoreFiles: Set[String] = Set.empty): Unit = {
val zf = new ZipFile(jar)
val unrecognized = zf
.entries()
.asScala
.map(_.getName)
.filter { n =>
!n.startsWith("META-INF/") && !n.startsWith(ns + "/") &&
n != "reflect.properties" && // scala-reflect adds that
!ignoreFiles(n)
}
.toVector
.sorted
for (u <- unrecognized)
System.err.println(s"Unrecognized: $u")
assert(unrecognized.isEmpty)
}
}

View File

@ -1,10 +1,8 @@
import sbt._
import Keys._
import sbt.contraband.ContrabandPlugin.autoImport._
object Dependencies {
// WARNING: Please Scala update versions in PluginCross.scala too
val scala212 = "2.12.20"
val scala213 = "2.13.15"
val scala3 = "3.6.2"
val checkPluginCross = settingKey[Unit]("Make sure scalaVersion match up")

View File

@ -1,11 +1,9 @@
package sbt
import java.nio.charset.StandardCharsets.UTF_8
import java.nio.file.{ FileAlreadyExistsException, Files }
import org.apache.ivy.core.module.id.ModuleRevisionId
import sbt.Keys._
import sbt.internal.librarymanagement.{ IvySbt, IvyXml }
import sbt.internal.librarymanagement.IvyXml
/** This local plugin provides ways of publishing just the binary jar. */
object PublishBinPlugin extends AutoPlugin {