This is a port of https://github.com/sbt/sbt/pull/2992.
Original description of the feature:
```
Ivy downloads have traditionally been single-threaded.
Parallel downloads are a must for a modern build tool. This commit
builds upon the work done by Josh Suereth in the branch
sbt/ivy-parallel-download-artifact.
To avoid adding external dependencies, it uses the Scala parallel
collections. If maintainers consider that is worth it to use a more
modern and appropriate approach, like Task, I'm happy to reimplement
the features with it.
```
This commit does not preserve Josh's metadata in the commit since the
whole design of the repository has changed and I did not know how to
import a commit from sbt/sbt. However, it does apply several changes to
the original PR.
Co-authored-by: Josh Suereth <joshua.suereth@gmail.com>
The following PR does two things:
* Removes the unnecessary `SbtExclusionRule` that was introduced to
exclude artifacts at the project level (and not the dependency level).
This change was done in an independent class to avoid breaking
bincompat in 0.13.x series.
* Handle exclusion rules correctly, propagating the cross version to the
exclusions of the dependencies.
To fixsbt/sbt#1518, this PR takes the avenue taken in
`SbtExclusionRule`, it accepts `GroupArtifactID` which should be the
preferred way to specify dependencies from now on. Unlike
`SbtExclusionRule`, it also supports `ModuleID` for those that want to
exclude a concrete dependency.
`InclExcl` did not have any tests. The following commit also adds a
testing suite for it, showing how the issue it's fixed and how you
should use `exclude` if you're calling directly `ExclusionRule` instead
of passing in `GroupArtifactID` and `ModuleID`.
I'm now going to use `CacheStore.apply` in `JsonUtil` (used by cached resolution). This gets rid of `fileToStore` parameter from a bunch of classes and simplifies the setup around librarymanagement.
Previously, when the dependency resolver (Ivy) encountered a Maven version range such as `[1.3.0,)`
it would go out to the Internet to find the latest version.
This would result to a surprising behavior where the eventual version keeps changing over time
*even when there's a version of the library that satisfies the range condition*.
This changes to some Maven version ranges would be replaced with its lower bound
so that when a satisfactory version is found in the dependency graph it will be used.
You can disable this behavior using the JVM flag `-Dsbt.modversionrange=false`.
Fixes#2954
Ref #2291 / #2953
Dotty nightly builds are published to maven, so they end up in
configuration "default", not "compile". We still need to look into
"compile" when dotty is published locally.
You can test this using https://github.com/smarter/dotty-example-project
by updating the sbt version used in project/build.properties and by
replacing "0.1.1-SNAPSHOT" by a nightly version like
"0.1.1-20170109-be64643-NIGHTLY" in build.sbt
The old way to customize CrossVersion results was a `String => String`
function called 'remapVersion', removed in
301ec787f2.
That was removed because it's not possible to serialise Function1s, and
we want to serialise CrossVersion (and therefore ModuleID, etc) to be
able to transfer them in sbt server.
This commit reintroduces a less-powerful way to vary the results of
apply CrossVersion, but just providing the opportunity to define a
suffix. From looking at the users of CrossVersion (Scala.js'
sbt-scalajs-plugin & Scala Native's sbt-crossproject) this looks to be
sufficient.
Fixes#1466 Ref #2786
Even after fixing the mediator issue, we still have spurious binary
version conflict warning that does not account for sandbox
configurations.
This change follows the scalaVersionConfigs work.
Fixes#2786. Ref #2634.
sbt 0.13.12 added Ivy mediator that enforces scalaOrganization and
scalaVersion for Scala toolchain artifacts.
This turns out to be a bit too aggressive because Ivy configurations
can be used as an independent dependency graph that does not rely on
the scalaVersion used by Compile configuration. By enforcing
scalaVersion in those graph causes runtime failure.
This change checks if the configuration extends Default, Compile,
Provided, or Optional before enforcing scalaVersion.