Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API to list versions #1439

Merged
merged 3 commits into from
Nov 21, 2019

Conversation

alexarchambault
Copy link
Member

Use like

import scala.concurrent.ExecutionContext.Implicits.global
import coursier._
val availableVersions = Versions()
  .withModule(mod"org.scala-lang:scala-library")
  .versions()
  .unsafeRun()
  .available // Seq[String]

@alexarchambault alexarchambault merged commit 8d767bf into coursier:master Nov 21, 2019
@alexarchambault alexarchambault deleted the list-versions-api branch November 21, 2019 00:15
@fthomas
Copy link
Contributor

fthomas commented Dec 4, 2019

Wow, this looks like it could be used in Scala Steward to find new versions instead of going through sbt and sbt-updates. This has the potential to make Scala Steward a lot faster.

Thanks @alexarchambault!

@alexarchambault
Copy link
Member Author

@fthomas But don't you need to start sbt anyway to know about the dependencies themselves (before checking for possible updates)?

@alexarchambault
Copy link
Member Author

FYI, I have a project in the work, that aims to list dependencies outside of sbt itself, like this. With those files, it should be possible to e.g. have a single JVM checking for updates for as many projects as necessary. (My goal was to ping you about it as a I'll publicly announce it :)

@fthomas
Copy link
Contributor

fthomas commented Dec 4, 2019

You're right. Not all invocations of sbt can be eliminated only those that check for updates of all known dependencies.

deps looks cool. Finally a principled way to organize dependencies where it is totally clear where version numbers are defined! It should be easy for Scala Steward to also update deps.json files. Even if a project does not use sbt. This is exciting!

@fthomas
Copy link
Contributor

fthomas commented Jan 6, 2020

@alexarchambault I'm now using Coursier exclusively to find new updates (scala-steward-org/scala-steward#1209) and it is working great so far. Going through all repos now takes 30-40 minutes instead of 5-6 hours. It is so fast now that it had been blacklisted by Maven Central a few times and I had to add a rate limiter to slow it down. :-)

Thanks again for this great addition to Coursier!

@alexarchambault
Copy link
Member Author

Thanks for the feedback, @fthomas!

@fthomas
Copy link
Contributor

fthomas commented Jan 23, 2020

@alexarchambault I was wondering if Versions does take mirrors into account? My current understanding of the code is that it does not, but I'm not sure.

I'm still having issues with Maven Central so I tried using a mirror but that didn't help for getting versions. WDYT, should support for mirrors be added to Versions?

@fthomas
Copy link
Contributor

fthomas commented Jan 23, 2020

I added minimal support for mirrors (by copying code from Resolve) here and it works for me locally: master...fthomas:topic/use-mirrors-in-versions

Should I extend that and also add mirrorConfFiles and mirrors fields to Version so that mirrors can also be set via the API and then open a PR with these changes?

@fthomas
Copy link
Contributor

fthomas commented Jan 24, 2020

PR for mirrors support: #1515

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants