mirror of https://github.com/sbt/sbt.git
Merge pull request #7994 from xuwei-k/unused-build-file
[2.x] remove unused code in build files
This commit is contained in:
commit
1a8e5fbd4d
11
build.sbt
11
build.sbt
|
|
@ -1294,17 +1294,6 @@ lazy val javafmtOnCompile = taskKey[Unit]("Formats java sources before compile")
|
||||||
lazy val scriptedProjects = ScopeFilter(inAnyProject)
|
lazy val scriptedProjects = ScopeFilter(inAnyProject)
|
||||||
|
|
||||||
def customCommands: Seq[Setting[_]] = Seq(
|
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 =>
|
commands += Command.command("publishLocalAllModule") { state =>
|
||||||
val extracted = Project.extract(state)
|
val extracted = Project.extract(state)
|
||||||
import extracted._
|
import extracted._
|
||||||
|
|
|
||||||
|
|
@ -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)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
import sbt._
|
import sbt._
|
||||||
import Keys._
|
import Keys._
|
||||||
import sbt.contraband.ContrabandPlugin.autoImport._
|
|
||||||
|
|
||||||
object Dependencies {
|
object Dependencies {
|
||||||
// WARNING: Please Scala update versions in PluginCross.scala too
|
// WARNING: Please Scala update versions in PluginCross.scala too
|
||||||
val scala212 = "2.12.20"
|
|
||||||
val scala213 = "2.13.15"
|
val scala213 = "2.13.15"
|
||||||
val scala3 = "3.6.2"
|
val scala3 = "3.6.2"
|
||||||
val checkPluginCross = settingKey[Unit]("Make sure scalaVersion match up")
|
val checkPluginCross = settingKey[Unit]("Make sure scalaVersion match up")
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,9 @@
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import java.nio.charset.StandardCharsets.UTF_8
|
|
||||||
import java.nio.file.{ FileAlreadyExistsException, Files }
|
import java.nio.file.{ FileAlreadyExistsException, Files }
|
||||||
|
|
||||||
import org.apache.ivy.core.module.id.ModuleRevisionId
|
|
||||||
import sbt.Keys._
|
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. */
|
/** This local plugin provides ways of publishing just the binary jar. */
|
||||||
object PublishBinPlugin extends AutoPlugin {
|
object PublishBinPlugin extends AutoPlugin {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue