Permalink
Browse files

Fix deprecation warnings

  • Loading branch information...
alexarchambault committed Mar 12, 2018
1 parent b1fde72 commit 6f8a9d295f0880109ae4a72337ed8f74ba4a80af
Showing with 44 additions and 31 deletions.
  1. +5 −4 extra/src/main/scala-2.12/coursier/extra/Native.scala
  2. +14 −6 sbt-coursier/src/main/scala/coursier/CoursierPlugin.scala
  3. +1 −1 sbt-coursier/src/test/scala/coursier/IvyXmlTests.scala
  4. +4 −0 sbt-shared/src/main/scala-2.10/coursier/SbtCompatibility.scala
  5. +1 −1 tests/js/src/test/scala/coursier/test/JsTests.scala
  6. +1 −1 tests/jvm/src/it/scala/coursier/test/DirectoryListingTests.scala
  7. +1 −1 tests/jvm/src/it/scala/coursier/test/HttpAuthenticationTests.scala
  8. +1 −1 tests/jvm/src/test/scala/coursier/test/CacheFetchTests.scala
  9. +1 −1 tests/jvm/src/test/scala/coursier/test/ChecksumTests.scala
  10. +1 −1 tests/jvm/src/test/scala/coursier/test/IvyTests.scala
  11. +1 −1 tests/jvm/src/test/scala/coursier/test/MavenTests.scala
  12. +1 −1 tests/jvm/src/test/scala/coursier/test/PropertiesTests.scala
  13. +1 −1 tests/jvm/src/test/scala/coursier/test/ResolutionProcessTests.scala
  14. +1 −1 tests/shared/src/test/scala/coursier/test/ActivationTests.scala
  15. +1 −1 tests/shared/src/test/scala/coursier/test/CentralTests.scala
  16. +1 −1 tests/shared/src/test/scala/coursier/test/ExclusionsTests.scala
  17. +1 −1 tests/shared/src/test/scala/coursier/test/IvyPatternParserTests.scala
  18. +1 −1 tests/shared/src/test/scala/coursier/test/ParseTests.scala
  19. +1 −1 tests/shared/src/test/scala/coursier/test/PomParsingTests.scala
  20. +1 −1 tests/shared/src/test/scala/coursier/test/ResolutionTests.scala
  21. +1 −1 tests/shared/src/test/scala/coursier/test/VersionConstraintTests.scala
  22. +1 −1 tests/shared/src/test/scala/coursier/test/VersionTests.scala
  23. +1 −1 tests/shared/src/test/scala/coursier/util/PrintTests.scala
  24. +1 −1 tests/shared/src/test/scala/coursier/util/TreeTests.scala
@@ -32,7 +32,8 @@ object Native {
Seq(s"$binaryName$major$minor", s"$binaryName-$major.$minor")
} :+ binaryName
Process("which" +: binaryNames).lines_!
Process("which" +: binaryNames)
.lineStream_!
.map(new File(_))
.headOption
.getOrElse {
@@ -325,7 +326,7 @@ object Native {
val compileOpts = {
val includes = {
val includedir =
Try(Process("llvm-config --includedir").lines_!)
Try(Process("llvm-config --includedir").lineStream_!)
.getOrElse(Seq.empty)
("/usr/local/include" +: includedir).map(s => s"-I$s")
}
@@ -392,7 +393,7 @@ object Native {
val nativeCompileOptions = {
val includes = {
val includedir =
Try(Process("llvm-config --includedir").lines_!)
Try(Process("llvm-config --includedir").lineStream_!)
.getOrElse(Seq.empty)
("/usr/local/include" +: includedir).map(s => s"-I$s")
}
@@ -444,7 +445,7 @@ object Native {
val nativeLinkingOptions = {
val libs = {
val libdir =
Try(Process("llvm-config --libdir").lines_!)
Try(Process("llvm-config --libdir").lineStream_!)
.getOrElse(Seq.empty)
("/usr/local/lib" +: libdir).map(s => s"-L$s")
}
@@ -81,7 +81,7 @@ object CoursierPlugin extends AutoPlugin {
IvyXml.writeFiles(currentProject, shadedConfigOpt, ivySbt.value, streams.value.log)
}).value
private val pluginIvySnapshotsBase = Resolver.SbtPluginRepositoryRoot.stripSuffix("/") + "/ivy-snapshots"
private val pluginIvySnapshotsBase = Resolver.SbtRepositoryRoot.stripSuffix("/") + "/ivy-snapshots"
// allows to get the actual repo list when sbt starts up
private val hackHack = Seq(
@@ -93,25 +93,33 @@ object CoursierPlugin extends AutoPlugin {
// hack to trigger https://github.com/sbt/sbt/blob/v1.0.1/main/src/main/scala/sbt/Defaults.scala#L2856,
// to have the third case be used instead of the second one, at https://github.com/sbt/sbt/blob/v1.0.1/main/src/main/scala/sbt/Defaults.scala#L2069
// 😃🔫
new xsbti.AppConfiguration {
def provider() = {
import scala.language.reflectiveCalls
val prov = app.provider()
val noWarningForDeprecatedStuffProv = prov.asInstanceOf[{
def mainClass(): Class[_ <: xsbti.AppMain]
}]
new xsbti.AppProvider {
def newMain() = prov.newMain()
def components() = prov.components()
def mainClass() = prov.mainClass()
def mainClass() = noWarningForDeprecatedStuffProv.mainClass()
def mainClasspath() = prov.mainClasspath()
def loader() = prov.loader()
def scalaProvider() = {
val scalaProv = prov.scalaProvider()
val noWarningForDeprecatedStuffScalaProv = scalaProv.asInstanceOf[{
def libraryJar(): File
def compilerJar(): File
}]
new xsbti.ScalaProvider {
def app(id: xsbti.ApplicationID) = scalaProv.app(id)
def loader() = scalaProv.loader()
def jars() = scalaProv.jars()
def libraryJar() = scalaProv.libraryJar()
def libraryJar() = noWarningForDeprecatedStuffScalaProv.libraryJar()
def version() = scalaProv.version()
def compilerJar() = scalaProv.compilerJar()
def compilerJar() = noWarningForDeprecatedStuffScalaProv.compilerJar()
def launcher() = {
val launch = scalaProv.launcher()
new xsbti.Launcher {
@@ -152,7 +160,7 @@ object CoursierPlugin extends AutoPlugin {
packageConfigs: Seq[(Configuration, String)]
) = hackHack ++ Seq(
clean := {
clean.value
val noWarningPlz = clean.value
Tasks.resolutionsCache.clear()
Tasks.reportsCache.clear()
},
@@ -4,7 +4,7 @@ import utest._
object IvyXmlTests extends TestSuite {
val tests = TestSuite {
val tests = Tests {
"no truncation" - {
val project = Project(
@@ -3,4 +3,8 @@ package coursier
object SbtCompatibility {
def needsIvyXmlLocal = List(sbt.Keys.deliverLocalConfiguration)
def needsIvyXml = List(sbt.Keys.deliverConfiguration)
implicit class ResolverCompationExtraOps(val res: sbt.Resolver.type) {
def SbtRepositoryRoot = res.SbtPluginRepositoryRoot
}
}
@@ -9,7 +9,7 @@ import scala.concurrent.{ Future, Promise }
object JsTests extends TestSuite {
val tests = TestSuite {
val tests = Tests {
'promise{
val p = Promise[Unit]()
Future(p.success(()))
@@ -22,7 +22,7 @@ object DirectoryListingTests extends TestSuite {
val module = Module("com.abc", "test")
val version = "0.1"
val tests = TestSuite {
val tests = Tests {
'withListing - {
'jar - CentralTests.withArtifacts(
module,
@@ -7,7 +7,7 @@ import coursier.maven.MavenRepository
object HttpAuthenticationTests extends TestSuite {
val tests = TestSuite {
val tests = Tests {
'httpAuthentication - {
// requires an authenticated HTTP server to be running on localhost:8080 with user 'user'
// and password 'pass'
@@ -66,7 +66,7 @@ object CacheFetchTests extends TestSuite {
assert(errors.isEmpty)
}
val tests = TestSuite {
val tests = Tests {
// using scala-test would allow to put the below comments in the test names...
@@ -11,7 +11,7 @@ import scala.concurrent.{ExecutionContext, Future}
object ChecksumTests extends TestSuite {
val tests = TestSuite {
val tests = Tests {
'parse - {
@@ -18,7 +18,7 @@ object IvyTests extends TestSuite {
throw new Exception("Cannot happen")
)
val tests = TestSuite {
val tests = Tests {
'dropInfoAttributes - {
CentralTests.resolutionCheck(
module = Module(
@@ -9,7 +9,7 @@ object MavenTests extends TestSuite {
// only tested on the JVM for lack of support of XML attributes in the platform-dependent XML stubs
val tests = TestSuite {
val tests = Tests {
'testSnapshotNoVersioning - {
val dep = Dependency(
@@ -5,7 +5,7 @@ import utest._
object PropertiesTests extends TestSuite {
val tests = TestSuite {
val tests = Tests {
'version - {
assert(Properties.version.nonEmpty)
@@ -13,7 +13,7 @@ import scalaz.concurrent.Task
object ResolutionProcessTests extends TestSuite {
val tests = TestSuite {
val tests = Tests {
'fetchAll - {
@@ -22,7 +22,7 @@ object ActivationTests extends TestSuite {
// - condition on OS or JDK, but no OS or JDK info provided (-> no match)
// - negated OS infos (starting with "!") - not implemented yet
val tests = TestSuite {
val tests = Tests {
'OS - {
'fromProperties - {
'MacOSX - {
@@ -214,7 +214,7 @@ abstract class CentralTests extends TestSuite {
assert(artifact.url.endsWith("." + extension))
}
val tests = TestSuite {
val tests = Tests {
'logback - {
async {
@@ -8,7 +8,7 @@ object ExclusionsTests extends TestSuite {
def exclusionsAdd(e1: Set[(String, String)], e2: Set[(String, String)]) =
core.Exclusions.minimize(e1 ++ e2)
val tests = TestSuite {
val tests = Tests {
val e1 = Set(("org1", "name1"))
val e2 = Set(("org2", "name2"))
@@ -8,7 +8,7 @@ import utest._
object IvyPatternParserTests extends TestSuite {
val tests = TestSuite {
val tests = Tests {
'plugin - {
val strPattern = "[organization]/[module](/scala_[scalaVersion])(/sbt_[sbtVersion])/[revision]/resolved.xml.[ext]"
@@ -22,7 +22,7 @@ object ParseTests extends TestSuite {
val url = "file%3A%2F%2Fsome%2Fencoded%2Furl"
val tests = TestSuite {
val tests = Tests {
"bintray-ivy:" - {
val obtained = Parse.repository("bintray-ivy:scalameta/maven")
assert(obtained.right.exists(isIvyRepo))
@@ -8,7 +8,7 @@ import utest._
object PomParsingTests extends TestSuite {
val tests = TestSuite {
val tests = Tests {
'readClassifier{
val depNode ="""
<dependency>
@@ -206,7 +206,7 @@ object ResolutionTests extends TestSuite {
testRepository
)
val tests = TestSuite {
val tests = Tests {
'empty{
async{
val res = await(resolve0(
@@ -6,7 +6,7 @@ import utest._
object VersionConstraintTests extends TestSuite {
val tests = TestSuite {
val tests = Tests {
'parse{
'empty{
val c0 = Parse.versionConstraint("")
@@ -14,7 +14,7 @@ object VersionTests extends TestSuite {
versions.iterator.sliding(2).withPartial(false).forall{case Seq(a, b) => compare(a, b) < 0 }
val tests = TestSuite {
val tests = Tests {
'stackOverflow - {
val s = "." * 100000
@@ -6,7 +6,7 @@ import utest._
object PrintTests extends TestSuite {
val tests = TestSuite {
val tests = Tests {
'ignoreAttributes - {
val dep = Dependency(
Module("org", "name"),
@@ -54,7 +54,7 @@ object TreeTests extends TestSuite {
e.addChild(f)
val tests = TestSuite {
val tests = Tests {
'basic {
val str = Tree[Node](roots)(_.children, _.label)
assert(str ==

0 comments on commit 6f8a9d2

Please sign in to comment.