scaladex cli api change & use scalaVersion from options

* Scaladex was updated to allow developers to specify cli artifact. It
  will only return projects and artifacts with cli enable
This commit is contained in:
Guillaume Massé 2016-11-13 11:24:11 +01:00 committed by Alexandre Archambault
parent e8af9e7aba
commit c332d4f46e
2 changed files with 3 additions and 4 deletions

View File

@ -191,7 +191,7 @@ class Helper(
val res = Nondeterminism[Task].gather(scaladexRawDependencies.map { s =>
val deps = scaladex.dependencies(
s,
"2.11",
scalaVersion,
if (verbosityLevel >= 2) Console.err.println(_) else _ => ()
)

View File

@ -74,7 +74,7 @@ case class Scaladex[F[_]](fetch: String => EitherT[F, String, String], F: Nondet
val s = fetch(
// FIXME Escaping
s"https://index.scala-lang.org/api/scastie/search?q=$name&target=$target&scalaVersion=$scalaVersion"
s"https://index.scala-lang.org/api/search?q=$name&target=$target&scalaVersion=$scalaVersion&cli=true"
)
s.flatMap(s => EitherT.fromDisjunction[F](s.decodeEither[List[Scaladex.SearchResult]].disjunction))
@ -91,7 +91,7 @@ case class Scaladex[F[_]](fetch: String => EitherT[F, String, String], F: Nondet
val s = fetch(
// FIXME Escaping
s"https://index.scala-lang.org/api/scastie/project?organization=$organization&repository=$repository&artifact=$artifactName"
s"https://index.scala-lang.org/api/project?organization=$organization&repository=$repository&artifact=$artifactName"
)
s.flatMap(s => EitherT.fromDisjunction[F](s.decodeEither[Scaladex.ArtifactInfos].disjunction))
@ -122,7 +122,6 @@ case class Scaladex[F[_]](fetch: String => EitherT[F, String, String], F: Nondet
* Latest version only.
*/
def dependencies(name: String, scalaVersion: String, logger: String => Unit): EitherT[F, String, Seq[(Module, String)]] = {
val idx = name.indexOf('/')
val orgNameOrError =
if (idx >= 0) {