Skip to content

Commit

Permalink
Drop externalIvyFile
Browse files Browse the repository at this point in the history
  • Loading branch information
eed3si9n committed Oct 2, 2024
1 parent debf314 commit 968bd9c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 77 deletions.
77 changes: 1 addition & 76 deletions main/src/main/scala/sbt/Defaults.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
package sbt

import java.io.{ File, PrintWriter }
import java.net.{ URI, URL }
import java.net.URL
import java.nio.file.{ Files, Paths, Path => NioPath }
import java.util.Optional
import java.util.concurrent.TimeUnit
Expand Down Expand Up @@ -719,8 +719,6 @@ object Defaults extends BuildCommon {
},
crossSbtVersions := Vector((pluginCrossBuild / sbtVersion).value),
crossTarget := target.value,
cleanIvy := IvyActions.cleanCachedResolutionCache(ivyModule.value, streams.value.log),
clean := clean.dependsOnTask(cleanIvy).value,
scalaCompilerBridgeBinaryJar := Def.settingDyn {
val sv = scalaVersion.value
val managed = managedScalaInstance.value
Expand Down Expand Up @@ -4873,79 +4871,6 @@ trait BuildExtra extends BuildCommon with DefExtra {
Seq(artLocal := artifact.value, taskLocal := taskDef.value, art, pkgd)
}

def externalIvySettings(
file: Initialize[File] = inBase("ivysettings.xml"),
addMultiResolver: Boolean = true
): Setting[Task[IvyConfiguration]] =
externalIvySettingsURI(file(_.toURI), addMultiResolver)

def externalIvySettingsURL(
url: URL,
addMultiResolver: Boolean = true
): Setting[Task[IvyConfiguration]] =
externalIvySettingsURI(Def.value(url.toURI), addMultiResolver)

def externalIvySettingsURI(
uri: Initialize[URI],
addMultiResolver: Boolean = true
): Setting[Task[IvyConfiguration]] = {
val other = Def.task {
(
baseDirectory.value,
appConfiguration.value,
projectResolver.value,
updateOptions.value,
streams.value
)
}
ivyConfiguration := ((uri zipWith other) { case (u, otherTask) =>
otherTask map { case (base, app, pr, uo, s) =>
val extraResolvers = if (addMultiResolver) Vector(pr) else Vector.empty
ExternalIvyConfiguration()
.withLock(lock(app))
.withBaseDirectory(base)
.withLog(s.log)
.withUpdateOptions(uo)
.withUri(u)
.withExtraResolvers(extraResolvers)
}
}).value
}

private[this] def inBase(name: String): Initialize[File] = Def.setting {
baseDirectory.value / name
}

@deprecated(
"externalIvyFile is not supported by Coursier, and will be removed in the future",
since = "1.5.0"
)
def externalIvyFile(
file: Initialize[File] = inBase("ivy.xml"),
iScala: Initialize[Option[ScalaModuleInfo]] = scalaModuleInfo
): Setting[Task[ModuleSettings]] =
moduleSettings := IvyFileConfiguration(
ivyValidate.value,
iScala.value,
file.value,
managedScalaInstance.value
)

@deprecated(
"externalPom is not supported by Coursier, and will be removed in the future",
since = "1.5.0"
)
def externalPom(
file: Initialize[File] = inBase("pom.xml"),
iScala: Initialize[Option[ScalaModuleInfo]] = scalaModuleInfo,
): Setting[Task[ModuleSettings]] =
moduleSettings := PomConfiguration(
ivyValidate.value,
iScala.value,
file.value,
managedScalaInstance.value,
)

def runInputTask(
config: Configuration,
mainClass: String,
Expand Down
1 change: 0 additions & 1 deletion main/src/main/scala/sbt/Keys.scala
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ object Keys {
val semanticdbOptions = settingKey[Seq[String]]("The Scalac options introduced for SemanticDB").withRank(CSetting)

val clean = taskKey[Unit]("Deletes files produced by the build, such as generated sources, compiled classes, and task caches.").withRank(APlusTask)
private[sbt] val cleanIvy = taskKey[Unit]("Deletes the ivy cached resolution")
val console = taskKey[Unit]("Starts the Scala interpreter with the project classes on the classpath.").withRank(APlusTask)
val consoleQuick = TaskKey[Unit]("consoleQuick", "Starts the Scala interpreter with the project dependencies on the classpath.", ATask, console)
val consoleProject = taskKey[Unit]("Starts the Scala interpreter with the sbt and the build definition on the classpath and useful imports.").withRank(AMinusTask)
Expand Down

0 comments on commit 968bd9c

Please sign in to comment.