This splits the core of LM and Ivy-based implementation.
- InlineConfiguration is renamed to ModuleConfiguration
- IvyScala is renamed to ScalaModuleInfo
- UpdateConfiguration, RetrieveConfiguration, PublishConfiguration are refactored to use builder pattern.
- Adds ConfigRef for referencing Configuration
- Moves syntax related things into `sbt.librarymagement.syntax`
This code originates from a PR against sbt 0.13:
https://github.com/sbt/sbt/pull/2576
The sbt/librarymanagement part was forward-ported to
sbt/librarymanagement and merged, while the sbt/sbt part wasn't.
So let's get rid of this so we can drop the dependency on
util-completion.
To ease migrating code from sbt 0.13 to sbt 1 this introduces val and
type aliases to CrossVersion's companion object (via
CrossVersionFunctions).
In addition, for consistency, it introduces CrossVersion.disabled.
sbt 1 removes CrossVersion.binaryMapped which was used in the sbt-dotty
plugin to provide a way to depend on Scala 2.x artifacts in a project
that cross-compiles between Scala 2.x and Dotty (see `withDottyCompat()` in
https://github.com/lampepfl/dotty/blob/master/sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala).
Using `binaryWith` is not enough because it only allows the user to
specify a prefix and a suffix for the binary version which will always
be set to `scalaBinaryVersion`. This commit introduces a new `Constant`
kind of CrossVersion which allows the user to specify any string he
wants as a cross-version, thus making it possible to port
`withDottyCompat()` to sbt 1.
Fixessbt/sbt#2699
Before:
[warn] There may be incompatibilities among your library dependencies.
[warn] Here are some of the libraries that were evicted:
[warn] * com.google.code.findbugs:jsr305:2.0.1 -> 3.0.0
[warn] Run 'evicted' to see detailed eviction warnings
After:
[warn] Found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
[warn]
[warn] * com.typesafe.akka:akka-actor_2.12:2.5.0 is selected over 2.4.17
[warn] +- de.heikoseeberger:akka-log4j_2.12:1.4.0 (depends on 2.5.0)
[warn] +- com.typesafe.akka:akka-parsing_2.12:10.0.6 (depends on 2.4.17)
[warn] +- com.typesafe.akka:akka-stream_2.12:2.4.17 () (depends on 2.4.17)
[warn]
[warn] Run 'evicted' to see detailed eviction warnings
Dotty is versioned as 0.*, but `CrossVersionUtil#binaryScalaVersion`
will return the full version instead of just `major.minor` for all
compiler versions < 2.10, add a special case for Dotty to avoid this.