mirror of https://github.com/sbt/sbt.git
Fix compilation in lm-core, lm-ivy
This commit is contained in:
parent
6a14704640
commit
11002de212
|
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
package sbt.librarymanagement
|
||||
|
||||
import scala.annotation.{ nowarn, tailrec }
|
||||
import scala.annotation.nowarn
|
||||
import scala.quoted.*
|
||||
|
||||
object Configurations {
|
||||
|
|
|
|||
|
|
@ -161,33 +161,32 @@ class DependencyResolution private[sbt] (lmEngine: DependencyResolutionInterface
|
|||
artifacts: Vector[(String, ModuleID, Artifact, File)],
|
||||
log: Logger
|
||||
): Either[UnresolvedWarning, UpdateReport] = {
|
||||
import config.{ updateConfiguration => c, module => mod, _ }
|
||||
import mod.{ configurations => confs, _ }
|
||||
val artifactFilter = getArtifactTypeFilter(c.artifactFilter)
|
||||
import config.module._
|
||||
val artifactFilter = getArtifactTypeFilter(config.updateConfiguration.artifactFilter)
|
||||
assert(classifiers.nonEmpty, "classifiers cannot be empty")
|
||||
assert(artifactFilter.types.nonEmpty, "UpdateConfiguration must filter on some types")
|
||||
val baseModules = dependencies map { m =>
|
||||
restrictedCopy(m, true)
|
||||
}
|
||||
// Adding list of explicit artifacts here.
|
||||
val exls = Map(excludes map { case (k, v) => (k, v.toSet) }: _*)
|
||||
val exls = Map(config.excludes map { case (k, v) => (k, v.toSet) }: _*)
|
||||
val deps = baseModules.distinct flatMap classifiedArtifacts(classifiers, exls, artifacts)
|
||||
val base = restrictedCopy(id, true).withName(id.name + classifiers.mkString("$", "_", ""))
|
||||
val moduleSetting = ModuleDescriptorConfiguration(base, ModuleInfo(base.name))
|
||||
.withScalaModuleInfo(scalaModuleInfo)
|
||||
.withDependencies(deps)
|
||||
.withConfigurations(confs)
|
||||
.withConfigurations(configurations)
|
||||
val module = moduleDescriptor(moduleSetting)
|
||||
|
||||
// c.copy ensures c.types is preserved too
|
||||
val upConf = c.withMissingOk(true)
|
||||
val upConf = config.updateConfiguration.withMissingOk(true)
|
||||
update(module, upConf, uwconfig, log) match {
|
||||
case Right(r) =>
|
||||
// The artifacts that came from Ivy don't have their classifier set, let's set it according to
|
||||
// FIXME: this is only done because IDE plugins depend on `classifier` to determine type. They
|
||||
val typeClassifierMap: Map[String, String] =
|
||||
((sourceArtifactTypes.toSeq map (_ -> Artifact.SourceClassifier))
|
||||
:: (docArtifactTypes.toSeq map (_ -> Artifact.DocClassifier)) :: Nil).flatten.toMap
|
||||
((config.sourceArtifactTypes.toSeq map (_ -> Artifact.SourceClassifier))
|
||||
:: (config.docArtifactTypes.toSeq map (_ -> Artifact.DocClassifier)) :: Nil).flatten.toMap
|
||||
Right(r.substitute { (conf, mid, artFileSeq) =>
|
||||
artFileSeq map { case (art, f) =>
|
||||
// Deduce the classifier from the type if no classifier is present already
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import scala.xml.XML
|
|||
import org.xml.sax.SAXParseException
|
||||
import sbt.util.Logger
|
||||
|
||||
import java.net.URI
|
||||
import scala.util.matching.Regex
|
||||
|
||||
final class RawRepository(val resolver: AnyRef, name: String) extends Resolver(name) {
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ object PomExtraDependencyAttributes {
|
|||
if (filteredExtra.isEmpty)
|
||||
Nil
|
||||
else {
|
||||
import scala.collection.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
val revId0 = ModuleRevisionId.newInstance(
|
||||
revId.getOrganisation,
|
||||
revId.getName,
|
||||
|
|
|
|||
|
|
@ -1,12 +1,5 @@
|
|||
package sbt.internal.librarymanagement
|
||||
|
||||
import java.io.File
|
||||
import java.util.concurrent.Callable
|
||||
import sbt.io.IO.withTemporaryDirectory
|
||||
import sbt.io.IO
|
||||
import org.apache.ivy.util.ChecksumHelper
|
||||
import IfMissing.Fail
|
||||
import xsbti.ComponentProvider
|
||||
import verify.BasicTestSuite
|
||||
|
||||
// TODO - We need to re-enable this test. Right now, we dont' have a "stub" launcher for this.
|
||||
|
|
|
|||
|
|
@ -1,14 +1,11 @@
|
|||
package sbt.internal.librarymanagement
|
||||
|
||||
import sbt.util.ShowLines
|
||||
import sbt.librarymanagement.*
|
||||
import sbt.librarymanagement.syntax.*
|
||||
import sbt.librarymanagement.Platform.*
|
||||
|
||||
object PlatformResolutionSpec extends BaseIvySpecification {
|
||||
|
||||
import TestShowLines.*
|
||||
|
||||
test("None platform resolves %% as JVM") {
|
||||
cleanCache()
|
||||
val m = exampleAutoModule(platform = None)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package sbt.internal.librarymanagement
|
||||
|
||||
import org.scalatest.LoneElement._
|
||||
import sbt.util.ShowLines
|
||||
import sbt.librarymanagement._
|
||||
import sbt.librarymanagement.syntax._
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
package sbt.internal.librarymanagement
|
||||
|
||||
import org.apache.ivy.core.module.id.ModuleRevisionId
|
||||
import org.apache.ivy.core.module.descriptor.DefaultDependencyDescriptor
|
||||
// import org.apache.ivy.core.module.id.ModuleRevisionId
|
||||
// import org.apache.ivy.core.module.descriptor.DefaultDependencyDescriptor
|
||||
|
||||
import sbt.internal.librarymanagement.IvyScalaUtil.OverrideScalaMediator
|
||||
import sbt.librarymanagement._
|
||||
import sbt.librarymanagement.ScalaArtifacts._
|
||||
// import sbt.internal.librarymanagement.IvyScalaUtil.OverrideScalaMediator
|
||||
// import sbt.librarymanagement._
|
||||
// import sbt.librarymanagement.ScalaArtifacts._
|
||||
import verify.BasicTestSuite
|
||||
|
||||
object ScalaOverrideTest extends BasicTestSuite {
|
||||
|
|
|
|||
|
|
@ -3305,11 +3305,11 @@ object Classpaths {
|
|||
projectInfo := ModuleInfo(
|
||||
name.value,
|
||||
description.value,
|
||||
homepage.value,
|
||||
homepage.value.map(_.toURI),
|
||||
startYear.value,
|
||||
licenses.value.toVector,
|
||||
licenses.value.map((name, url) => (name, url.toURI)).toVector,
|
||||
organizationName.value,
|
||||
organizationHomepage.value,
|
||||
organizationHomepage.value.map(_.toURI),
|
||||
scmInfo.value,
|
||||
developers.value.toVector
|
||||
),
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ package internal
|
|||
package inc
|
||||
|
||||
import sbt.internal.inc.classpath.ClasspathUtil
|
||||
import sbt.internal.librarymanagement._
|
||||
import sbt.internal.librarymanagement.JsonUtil
|
||||
import sbt.internal.util.{ BufferedLogger, FullLogger }
|
||||
import sbt.io.IO
|
||||
import sbt.librarymanagement._
|
||||
|
|
|
|||
Loading…
Reference in New Issue