Address compilation warnings

This commit is contained in:
Alexandre Archambault 2020-05-19 14:50:06 +02:00
parent c82ab8850d
commit 33cfaf3df6
8 changed files with 15 additions and 10 deletions

View File

@ -1,6 +1,5 @@
package lmcoursier
import lmcoursier.Inputs
import lmcoursier.definitions.{Configuration, Project}
import scala.xml.{Node, PrefixedAttribute}

View File

@ -1,9 +1,10 @@
package lmcoursier
import lmcoursier.definitions.{Configuration, Info, Module, ModuleName, Organization, Project}
import org.scalatest.{Matchers, PropSpec}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
object IvyXmlTests extends PropSpec with Matchers {
object IvyXmlTests extends AnyPropSpec with Matchers {
property("no truncation") {
val project = Project(

View File

@ -1,6 +1,7 @@
package lmcoursier
import org.scalatest.{Matchers, PropSpec}
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import sbt.internal.librarymanagement.cross.CrossVersionUtil
import sbt.internal.util.ConsoleLogger
import sbt.librarymanagement._
@ -9,7 +10,7 @@ import sbt.librarymanagement.Resolver.{DefaultMavenRepository, JCenterRepository
import sbt.librarymanagement.{Resolver, UnresolvedWarningConfiguration, UpdateConfiguration}
import sbt.librarymanagement.syntax._
final class ResolutionSpec extends PropSpec with Matchers {
final class ResolutionSpec extends AnyPropSpec with Matchers {
lazy val log = ConsoleLogger()

View File

@ -5,7 +5,7 @@ import java.util.Properties
import lmcoursier.definitions.Authentication
@deprecated("Use coursierExtraCredentials rather than coursierCredentials", "1.1.0-M14")
// actually deprecated (all public ways of creating that are)
sealed abstract class Credentials extends Product with Serializable {
def user: String
def password: String

View File

@ -40,9 +40,11 @@ object SbtCoursierShared extends AutoPlugin {
val mavenProfiles = settingKey[Set[String]]("")
val versionReconciliation = taskKey[Seq[ModuleID]]("")
private[coursier] val actualCoursierCredentials = TaskKey[Map[String, LegacyCredentials]]("coursierCredentials", "")
val coursierUseSbtCredentials = settingKey[Boolean]("")
@deprecated("Use coursierExtraCredentials rather than coursierCredentials", "1.1.0-M14")
val coursierCredentials = taskKey[Map[String, LegacyCredentials]]("")
val coursierCredentials = actualCoursierCredentials
val coursierExtraCredentials = taskKey[Seq[Credentials]]("")
val coursierLogger = taskKey[Option[CacheLogger]]("")
@ -60,7 +62,7 @@ object SbtCoursierShared extends AutoPlugin {
override def globalSettings: Seq[Setting[_]] =
Seq(
coursierUseSbtCredentials := true,
coursierCredentials := Map.empty,
actualCoursierCredentials := Map.empty,
coursierExtraCredentials := Nil
)

View File

@ -95,7 +95,7 @@ object ResolutionTasks {
val ivyProperties = ResolutionParams.defaultIvyProperties(ivyPaths.value.ivyHome)
val authenticationByRepositoryId = coursierCredentials.value.mapValues(_.authentication)
val authenticationByRepositoryId = actualCoursierCredentials.value.mapValues(_.authentication)
val (currentProject, fallbackDependencies, orderedConfigs) = currentProjectTask.value

View File

@ -134,7 +134,7 @@ object LmCoursierPlugin extends AutoPlugin {
val userForceVersions = Inputs.forceVersions(dependencyOverrides.value, scalaVer, sbv)
val authenticationByRepositoryId = coursierCredentials.value.mapValues { c =>
val authenticationByRepositoryId = actualCoursierCredentials.value.mapValues { c =>
val a = c.authentication
Authentication(a.user, a.password, a.optional, a.realmOpt)
}

View File

@ -5,6 +5,8 @@ import sbt.Keys._
import sbt.internal.LibraryManagement
import sbt.librarymanagement.DependencyResolution
import scala.language.reflectiveCalls
object Foo {
// same implementation as update in sbt, except DependencyResolution is passed as argument