mirror of https://github.com/sbt/sbt.git
Merge pull request #121 from alexarchambault/develop
Switch to coursier 2.0.0-RC3-3, add versionReconciliation key
This commit is contained in:
commit
6bc9c7c01b
|
|
@ -15,7 +15,7 @@ inThisBuild(List(
|
||||||
)
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
val coursierVersion0 = "2.0.0-RC3-2"
|
val coursierVersion0 = "2.0.0-RC3-3"
|
||||||
|
|
||||||
lazy val `lm-coursier` = project
|
lazy val `lm-coursier` = project
|
||||||
.enablePlugins(ContrabandPlugin)
|
.enablePlugins(ContrabandPlugin)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
package lmcoursier.definitions
|
|
||||||
@target(Scala)
|
|
||||||
|
|
||||||
enum Reconciliation {
|
|
||||||
Default
|
|
||||||
Relaxed
|
|
||||||
}
|
|
||||||
|
|
@ -38,11 +38,18 @@
|
||||||
"name": "include",
|
"name": "include",
|
||||||
"type": "Set[lmcoursier.definitions.Module]",
|
"type": "Set[lmcoursier.definitions.Module]",
|
||||||
"doc": "Use \"*\" in either organization or name to match any."
|
"doc": "Use \"*\" in either organization or name to match any."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "includeByDefault",
|
||||||
|
"type": "Boolean",
|
||||||
|
"default": "true",
|
||||||
|
"since": "2.0.0-RC4"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"extraCompanion": [
|
"extraCompanion": [
|
||||||
"/** ModuleMatchers that matches to any modules. */",
|
"/** ModuleMatchers that matches to any modules. */",
|
||||||
"def all: ModuleMatchers = ModuleMatchers(Set.empty, Set.empty)"
|
"def all: ModuleMatchers = ModuleMatchers(Set.empty, Set.empty)",
|
||||||
|
"def only(mod: Module): ModuleMatchers = ModuleMatchers(Set.empty, Set(mod), includeByDefault = false)"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,10 @@ package lmcoursier
|
||||||
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
import _root_.coursier.{Artifact, Organization, Resolution, organizationString}
|
import coursier.{Organization, Resolution, organizationString}
|
||||||
import _root_.coursier.core.{Classifier, Configuration}
|
import coursier.core.{Classifier, Configuration}
|
||||||
import coursier.cache.CacheDefaults
|
import coursier.cache.CacheDefaults
|
||||||
|
import coursier.util.Artifact
|
||||||
import coursier.internal.Typelevel
|
import coursier.internal.Typelevel
|
||||||
import lmcoursier.definitions.ToCoursier
|
import lmcoursier.definitions.ToCoursier
|
||||||
import lmcoursier.internal.{ArtifactsParams, ArtifactsRun, CoursierModuleDescriptor, InterProjectRepository, ResolutionParams, ResolutionRun, Resolvers, SbtBootJars, UpdateParams, UpdateRun}
|
import lmcoursier.internal.{ArtifactsParams, ArtifactsRun, CoursierModuleDescriptor, InterProjectRepository, ResolutionParams, ResolutionRun, Resolvers, SbtBootJars, UpdateParams, UpdateRun}
|
||||||
|
|
|
||||||
|
|
@ -10,22 +10,23 @@ package lmcoursier.definitions
|
||||||
*/
|
*/
|
||||||
final class ModuleMatchers private (
|
final class ModuleMatchers private (
|
||||||
val exclude: Set[lmcoursier.definitions.Module],
|
val exclude: Set[lmcoursier.definitions.Module],
|
||||||
val include: Set[lmcoursier.definitions.Module]) extends Serializable {
|
val include: Set[lmcoursier.definitions.Module],
|
||||||
|
val includeByDefault: Boolean) extends Serializable {
|
||||||
|
|
||||||
|
private def this(exclude: Set[lmcoursier.definitions.Module], include: Set[lmcoursier.definitions.Module]) = this(exclude, include, true)
|
||||||
|
|
||||||
override def equals(o: Any): Boolean = o match {
|
override def equals(o: Any): Boolean = o match {
|
||||||
case x: ModuleMatchers => (this.exclude == x.exclude) && (this.include == x.include)
|
case x: ModuleMatchers => (this.exclude == x.exclude) && (this.include == x.include) && (this.includeByDefault == x.includeByDefault)
|
||||||
case _ => false
|
case _ => false
|
||||||
}
|
}
|
||||||
override def hashCode: Int = {
|
override def hashCode: Int = {
|
||||||
37 * (37 * (37 * (17 + "lmcoursier.definitions.ModuleMatchers".##) + exclude.##) + include.##)
|
37 * (37 * (37 * (37 * (17 + "lmcoursier.definitions.ModuleMatchers".##) + exclude.##) + include.##) + includeByDefault.##)
|
||||||
}
|
}
|
||||||
override def toString: String = {
|
override def toString: String = {
|
||||||
"ModuleMatchers(" + exclude + ", " + include + ")"
|
"ModuleMatchers(" + exclude + ", " + include + ", " + includeByDefault + ")"
|
||||||
}
|
}
|
||||||
private[this] def copy(exclude: Set[lmcoursier.definitions.Module] = exclude, include: Set[lmcoursier.definitions.Module] = include): ModuleMatchers = {
|
private[this] def copy(exclude: Set[lmcoursier.definitions.Module] = exclude, include: Set[lmcoursier.definitions.Module] = include, includeByDefault: Boolean = includeByDefault): ModuleMatchers = {
|
||||||
new ModuleMatchers(exclude, include)
|
new ModuleMatchers(exclude, include, includeByDefault)
|
||||||
}
|
}
|
||||||
def withExclude(exclude: Set[lmcoursier.definitions.Module]): ModuleMatchers = {
|
def withExclude(exclude: Set[lmcoursier.definitions.Module]): ModuleMatchers = {
|
||||||
copy(exclude = exclude)
|
copy(exclude = exclude)
|
||||||
|
|
@ -33,9 +34,14 @@ final class ModuleMatchers private (
|
||||||
def withInclude(include: Set[lmcoursier.definitions.Module]): ModuleMatchers = {
|
def withInclude(include: Set[lmcoursier.definitions.Module]): ModuleMatchers = {
|
||||||
copy(include = include)
|
copy(include = include)
|
||||||
}
|
}
|
||||||
|
def withIncludeByDefault(includeByDefault: Boolean): ModuleMatchers = {
|
||||||
|
copy(includeByDefault = includeByDefault)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
object ModuleMatchers {
|
object ModuleMatchers {
|
||||||
/** ModuleMatchers that matches to any modules. */
|
/** ModuleMatchers that matches to any modules. */
|
||||||
def all: ModuleMatchers = ModuleMatchers(Set.empty, Set.empty)
|
def all: ModuleMatchers = ModuleMatchers(Set.empty, Set.empty)
|
||||||
|
def only(mod: Module): ModuleMatchers = ModuleMatchers(Set.empty, Set(mod), includeByDefault = false)
|
||||||
def apply(exclude: Set[lmcoursier.definitions.Module], include: Set[lmcoursier.definitions.Module]): ModuleMatchers = new ModuleMatchers(exclude, include)
|
def apply(exclude: Set[lmcoursier.definitions.Module], include: Set[lmcoursier.definitions.Module]): ModuleMatchers = new ModuleMatchers(exclude, include)
|
||||||
|
def apply(exclude: Set[lmcoursier.definitions.Module], include: Set[lmcoursier.definitions.Module], includeByDefault: Boolean): ModuleMatchers = new ModuleMatchers(exclude, include, includeByDefault)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,15 @@
|
||||||
/**
|
|
||||||
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
|
|
||||||
*/
|
|
||||||
|
|
||||||
// DO NOT EDIT MANUALLY
|
|
||||||
package lmcoursier.definitions
|
package lmcoursier.definitions
|
||||||
sealed abstract class Reconciliation extends Serializable
|
sealed abstract class Reconciliation extends Serializable
|
||||||
object Reconciliation {
|
object Reconciliation {
|
||||||
|
|
||||||
|
|
||||||
case object Default extends Reconciliation
|
case object Default extends Reconciliation
|
||||||
case object Relaxed extends Reconciliation
|
case object Relaxed extends Reconciliation
|
||||||
|
case object Strict extends Reconciliation
|
||||||
|
|
||||||
|
def apply(input: String): Option[Reconciliation] =
|
||||||
|
input match {
|
||||||
|
case "default" => Some(Default)
|
||||||
|
case "relaxed" => Some(Relaxed)
|
||||||
|
case "strict" => Some(Strict)
|
||||||
|
case _ => None
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ object ToCoursier {
|
||||||
r match {
|
r match {
|
||||||
case Reconciliation.Default => coursier.core.Reconciliation.Default
|
case Reconciliation.Default => coursier.core.Reconciliation.Default
|
||||||
case Reconciliation.Relaxed => coursier.core.Reconciliation.Relaxed
|
case Reconciliation.Relaxed => coursier.core.Reconciliation.Relaxed
|
||||||
|
case Reconciliation.Strict => coursier.core.Reconciliation.Strict
|
||||||
}
|
}
|
||||||
|
|
||||||
def reconciliation(rs: Vector[(ModuleMatchers, Reconciliation)]):
|
def reconciliation(rs: Vector[(ModuleMatchers, Reconciliation)]):
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@ package lmcoursier.internal
|
||||||
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
import coursier.Artifact
|
|
||||||
import coursier.cache.internal.ThreadUtil
|
import coursier.cache.internal.ThreadUtil
|
||||||
import coursier.cache.loggers.{FallbackRefreshDisplay, ProgressBarRefreshDisplay, RefreshLogger}
|
import coursier.cache.loggers.{FallbackRefreshDisplay, ProgressBarRefreshDisplay, RefreshLogger}
|
||||||
import coursier.core.Type
|
import coursier.core.Type
|
||||||
|
import coursier.util.Artifact
|
||||||
import sbt.util.Logger
|
import sbt.util.Logger
|
||||||
|
|
||||||
// private[coursier]
|
// private[coursier]
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ final case class InterProjectRepository(projects: Seq[Project]) extends Reposito
|
||||||
fetch: Repository.Fetch[F]
|
fetch: Repository.Fetch[F]
|
||||||
)(implicit
|
)(implicit
|
||||||
F: Monad[F]
|
F: Monad[F]
|
||||||
): EitherT[F, String, (Artifact.Source, Project)] = {
|
): EitherT[F, String, (ArtifactSource, Project)] = {
|
||||||
|
|
||||||
val res = map
|
val res = map
|
||||||
.get((module, version))
|
.get((module, version))
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,10 @@ import java.net.URL
|
||||||
import java.util.GregorianCalendar
|
import java.util.GregorianCalendar
|
||||||
import java.util.concurrent.ConcurrentHashMap
|
import java.util.concurrent.ConcurrentHashMap
|
||||||
|
|
||||||
import coursier.{Artifact, Attributes, Dependency, Module, Project, Resolution}
|
import coursier.{Attributes, Dependency, Module, Project, Resolution}
|
||||||
import coursier.core.{Classifier, Configuration, Extension, Publication, Type}
|
import coursier.core.{Classifier, Configuration, Extension, Publication, Type}
|
||||||
import coursier.maven.MavenAttributes
|
import coursier.maven.MavenAttributes
|
||||||
|
import coursier.util.Artifact
|
||||||
import sbt.librarymanagement.{Artifact => _, Configuration => _, _}
|
import sbt.librarymanagement.{Artifact => _, Configuration => _, _}
|
||||||
import sbt.util.Logger
|
import sbt.util.Logger
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import java.net.{HttpURLConnection, URL, URLConnection}
|
||||||
|
|
||||||
import coursier.cache.{CacheUrl, FileCache}
|
import coursier.cache.{CacheUrl, FileCache}
|
||||||
import coursier.core._
|
import coursier.core._
|
||||||
import coursier.util.{EitherT, Monad}
|
import coursier.util.{Artifact, EitherT, Monad}
|
||||||
|
|
||||||
import scala.util.Try
|
import scala.util.Try
|
||||||
|
|
||||||
|
|
@ -142,11 +142,11 @@ final class TemporaryInMemoryRepository private(
|
||||||
fetch: Repository.Fetch[F]
|
fetch: Repository.Fetch[F]
|
||||||
)(implicit
|
)(implicit
|
||||||
F: Monad[F]
|
F: Monad[F]
|
||||||
): EitherT[F, String, (Artifact.Source, Project)] = {
|
): EitherT[F, String, (ArtifactSource, Project)] = {
|
||||||
|
|
||||||
def res = fallbacks
|
def res = fallbacks
|
||||||
.get((module, version))
|
.get((module, version))
|
||||||
.fold[Either[String, (Artifact.Source, Project)]](Left("No fallback URL found")) {
|
.fold[Either[String, (ArtifactSource, Project)]](Left("No fallback URL found")) {
|
||||||
case (url, _) =>
|
case (url, _) =>
|
||||||
|
|
||||||
val urlStr = url.toExternalForm
|
val urlStr = url.toExternalForm
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package lmcoursier.internal
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
import coursier.core._
|
import coursier.core._
|
||||||
|
import coursier.util.Artifact
|
||||||
|
|
||||||
// private[coursier]
|
// private[coursier]
|
||||||
final case class UpdateParams(
|
final case class UpdateParams(
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,8 @@ import lmcoursier.definitions.{CacheLogger, Configuration, Project, Publication}
|
||||||
import lmcoursier.internal.SbtCoursierCache
|
import lmcoursier.internal.SbtCoursierCache
|
||||||
import sbt.{AutoPlugin, Classpaths, Compile, Setting, TaskKey, Test, settingKey, taskKey}
|
import sbt.{AutoPlugin, Classpaths, Compile, Setting, TaskKey, Test, settingKey, taskKey}
|
||||||
import sbt.Keys._
|
import sbt.Keys._
|
||||||
import sbt.librarymanagement.{Resolver, URLRepository}
|
import sbt.librarymanagement.DependencyBuilders.OrganizationArtifactName
|
||||||
|
import sbt.librarymanagement.{ModuleID, Resolver, URLRepository}
|
||||||
|
|
||||||
object SbtCoursierShared extends AutoPlugin {
|
object SbtCoursierShared extends AutoPlugin {
|
||||||
|
|
||||||
|
|
@ -35,6 +36,7 @@ object SbtCoursierShared extends AutoPlugin {
|
||||||
val coursierFallbackDependencies = taskKey[Seq[FallbackDependency]]("")
|
val coursierFallbackDependencies = taskKey[Seq[FallbackDependency]]("")
|
||||||
|
|
||||||
val mavenProfiles = settingKey[Set[String]]("")
|
val mavenProfiles = settingKey[Set[String]]("")
|
||||||
|
val versionReconciliation = taskKey[Seq[ModuleID]]("")
|
||||||
|
|
||||||
val coursierUseSbtCredentials = settingKey[Boolean]("")
|
val coursierUseSbtCredentials = settingKey[Boolean]("")
|
||||||
@deprecated("Use coursierExtraCredentials rather than coursierCredentials", "1.1.0-M14")
|
@deprecated("Use coursierExtraCredentials rather than coursierCredentials", "1.1.0-M14")
|
||||||
|
|
@ -166,7 +168,8 @@ object SbtCoursierShared extends AutoPlugin {
|
||||||
|
|
||||||
confs ++ extraSources.toSeq ++ extraDocs.toSeq
|
confs ++ extraSources.toSeq ++ extraDocs.toSeq
|
||||||
},
|
},
|
||||||
mavenProfiles := Set.empty
|
mavenProfiles := Set.empty,
|
||||||
|
versionReconciliation := Seq.empty
|
||||||
) ++ {
|
) ++ {
|
||||||
if (pubSettings)
|
if (pubSettings)
|
||||||
IvyXml.generateIvyXmlSettings()
|
IvyXml.generateIvyXmlSettings()
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@ package coursier.sbtcoursier
|
||||||
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
import coursier.Artifact
|
|
||||||
import coursier.cache.FileCache
|
import coursier.cache.FileCache
|
||||||
import coursier.core._
|
import coursier.core._
|
||||||
|
import coursier.util.Artifact
|
||||||
import lmcoursier.internal.{ArtifactsParams, ArtifactsRun}
|
import lmcoursier.internal.{ArtifactsParams, ArtifactsRun}
|
||||||
import coursier.sbtcoursier.Keys._
|
import coursier.sbtcoursier.Keys._
|
||||||
import coursier.sbtcoursiershared.InputsTasks.credentialsTask
|
import coursier.sbtcoursiershared.InputsTasks.credentialsTask
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import java.io.File
|
||||||
import coursier.cache.CachePolicy
|
import coursier.cache.CachePolicy
|
||||||
import coursier.ProjectCache
|
import coursier.ProjectCache
|
||||||
import coursier.core._
|
import coursier.core._
|
||||||
|
import coursier.util.Artifact
|
||||||
import sbt.librarymanagement.{GetClassifiersModule, Resolver}
|
import sbt.librarymanagement.{GetClassifiersModule, Resolver}
|
||||||
import sbt.{InputKey, SettingKey, TaskKey}
|
import sbt.{InputKey, SettingKey, TaskKey}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import lmcoursier.internal.{InterProjectRepository, ResolutionParams, Resolution
|
||||||
import coursier.sbtcoursier.Keys._
|
import coursier.sbtcoursier.Keys._
|
||||||
import coursier.sbtcoursiershared.InputsTasks.{credentialsTask, strictTask}
|
import coursier.sbtcoursiershared.InputsTasks.{credentialsTask, strictTask}
|
||||||
import coursier.sbtcoursiershared.SbtCoursierShared.autoImport._
|
import coursier.sbtcoursiershared.SbtCoursierShared.autoImport._
|
||||||
|
import coursier.util.{ModuleMatcher, ModuleMatchers}
|
||||||
import sbt.Def
|
import sbt.Def
|
||||||
import sbt.Keys._
|
import sbt.Keys._
|
||||||
|
|
||||||
|
|
@ -75,6 +76,16 @@ object ResolutionTasks {
|
||||||
val verbosityLevel = coursierVerbosity.value
|
val verbosityLevel = coursierVerbosity.value
|
||||||
|
|
||||||
val userEnabledProfiles = mavenProfiles.value
|
val userEnabledProfiles = mavenProfiles.value
|
||||||
|
val versionReconciliations0 = versionReconciliation.value.map { mod =>
|
||||||
|
Reconciliation(mod.revision) match {
|
||||||
|
case Some(rec) =>
|
||||||
|
val (mod0, _) = FromSbt.moduleVersion(mod, sv, sbv)
|
||||||
|
val matcher = ModuleMatchers.only(Organization(mod0.organization.value), ModuleName(mod0.name.value))
|
||||||
|
matcher -> rec
|
||||||
|
case None =>
|
||||||
|
throw new Exception(s"Unrecognized reconciliation: '${mod.revision}'")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val typelevel = Organization(scalaOrganization.value) == Typelevel.typelevelOrg
|
val typelevel = Organization(scalaOrganization.value) == Typelevel.typelevelOrg
|
||||||
|
|
||||||
|
|
@ -141,7 +152,8 @@ object ResolutionTasks {
|
||||||
.withMaxIterations(maxIterations)
|
.withMaxIterations(maxIterations)
|
||||||
.withProfiles(userEnabledProfiles)
|
.withProfiles(userEnabledProfiles)
|
||||||
.withForceVersion(userForceVersions.map { case (k, v) => (ToCoursier.module(k), v) }.toMap)
|
.withForceVersion(userForceVersions.map { case (k, v) => (ToCoursier.module(k), v) }.toMap)
|
||||||
.withTypelevel(typelevel),
|
.withTypelevel(typelevel)
|
||||||
|
.addReconciliation(versionReconciliations0: _*),
|
||||||
strictOpt = strictOpt
|
strictOpt = strictOpt
|
||||||
),
|
),
|
||||||
verbosityLevel,
|
verbosityLevel,
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,2 @@
|
||||||
-> a/update
|
-> a/update
|
||||||
# enable once when we bump the coursier version
|
> b/update
|
||||||
# > b/update
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
|
||||||
|
lazy val shared = Seq(
|
||||||
|
scalaVersion := "2.12.8",
|
||||||
|
libraryDependencies ++= Seq(
|
||||||
|
"com.github.alexarchambault" %% "argonaut-shapeless_6.2" % "1.2.0-M4",
|
||||||
|
"com.chuusai" %% "shapeless" % "2.3.3"
|
||||||
|
),
|
||||||
|
versionReconciliation += "*" % "*" % "strict"
|
||||||
|
)
|
||||||
|
|
||||||
|
lazy val a = project
|
||||||
|
.settings(shared)
|
||||||
|
|
||||||
|
lazy val b = project
|
||||||
|
.settings(shared)
|
||||||
|
.settings(
|
||||||
|
// strict cm should be fine if we force the conflicting module version
|
||||||
|
dependencyOverrides += "com.chuusai" %% "shapeless" % "2.3.3"
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
addSbtPlugin {
|
||||||
|
|
||||||
|
val name = sys.props.getOrElse(
|
||||||
|
"plugin.name",
|
||||||
|
sys.error("plugin.name Java property not set")
|
||||||
|
)
|
||||||
|
val version = sys.props.getOrElse(
|
||||||
|
"plugin.version",
|
||||||
|
sys.error("plugin.version Java property not set")
|
||||||
|
)
|
||||||
|
|
||||||
|
"io.get-coursier" % name % version
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
-> a/update
|
||||||
|
> b/update
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package coursier.sbtlmcoursier
|
package coursier.sbtlmcoursier
|
||||||
|
|
||||||
import lmcoursier.definitions.Authentication
|
import lmcoursier.definitions.{Authentication, ModuleMatchers, Reconciliation}
|
||||||
import lmcoursier.{CoursierConfiguration, CoursierDependencyResolution, Inputs}
|
import lmcoursier.{CoursierConfiguration, CoursierDependencyResolution, Inputs}
|
||||||
import coursier.sbtcoursiershared.InputsTasks.{credentialsTask, strictTask}
|
import coursier.sbtcoursiershared.InputsTasks.{credentialsTask, strictTask}
|
||||||
import coursier.sbtcoursiershared.{InputsTasks, SbtCoursierShared}
|
import coursier.sbtcoursiershared.{InputsTasks, SbtCoursierShared}
|
||||||
|
|
@ -95,6 +95,16 @@ object LmCoursierPlugin extends AutoPlugin {
|
||||||
val fallbackDeps = coursierFallbackDependencies.value
|
val fallbackDeps = coursierFallbackDependencies.value
|
||||||
val autoScalaLib = autoScalaLibrary.value && scalaModuleInfo.value.forall(_.overrideScalaVersion)
|
val autoScalaLib = autoScalaLibrary.value && scalaModuleInfo.value.forall(_.overrideScalaVersion)
|
||||||
val profiles = mavenProfiles.value
|
val profiles = mavenProfiles.value
|
||||||
|
val versionReconciliations0 = versionReconciliation.value.map { mod =>
|
||||||
|
Reconciliation(mod.revision) match {
|
||||||
|
case Some(rec) =>
|
||||||
|
val (mod0, _) = lmcoursier.FromSbt.moduleVersion(mod, scalaVer, sbv)
|
||||||
|
val matcher = ModuleMatchers.only(mod0)
|
||||||
|
matcher -> rec
|
||||||
|
case None =>
|
||||||
|
throw new Exception(s"Unrecognized reconciliation: '${mod.revision}'")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
val userForceVersions = Inputs.forceVersions(dependencyOverrides.value, scalaVer, sbv)
|
val userForceVersions = Inputs.forceVersions(dependencyOverrides.value, scalaVer, sbv)
|
||||||
|
|
@ -138,6 +148,7 @@ object LmCoursierPlugin extends AutoPlugin {
|
||||||
.withClassifiers(classifiers.toVector.flatten)
|
.withClassifiers(classifiers.toVector.flatten)
|
||||||
.withHasClassifiers(classifiers.nonEmpty)
|
.withHasClassifiers(classifiers.nonEmpty)
|
||||||
.withMavenProfiles(profiles.toVector.sorted)
|
.withMavenProfiles(profiles.toVector.sorted)
|
||||||
|
.withReconciliation(versionReconciliations0.toVector)
|
||||||
.withScalaOrganization(scalaOrg)
|
.withScalaOrganization(scalaOrg)
|
||||||
.withScalaVersion(scalaVer)
|
.withScalaVersion(scalaVer)
|
||||||
.withAuthenticationByRepositoryId(authenticationByRepositoryId.toVector.sortBy(_._1))
|
.withAuthenticationByRepositoryId(authenticationByRepositoryId.toVector.sortBy(_._1))
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import java.util.jar.JarInputStream
|
||||||
import java.util.zip.{ZipEntry, ZipInputStream}
|
import java.util.zip.{ZipEntry, ZipInputStream}
|
||||||
|
|
||||||
import coursier.core.{Configuration, Orders}
|
import coursier.core.{Configuration, Orders}
|
||||||
|
import coursier.util.Artifact
|
||||||
import org.pantsbuild.jarjar._
|
import org.pantsbuild.jarjar._
|
||||||
import org.pantsbuild.jarjar.util.CoursierJarProcessor
|
import org.pantsbuild.jarjar.util.CoursierJarProcessor
|
||||||
|
|
||||||
|
|
@ -202,7 +203,7 @@ object Shading {
|
||||||
rename(cls, shadingNamespace + ".@0")
|
rename(cls, shadingNamespace + ".@0")
|
||||||
}
|
}
|
||||||
|
|
||||||
val processor = JJProcessor(nsRules ++ clsRules, verbose = true, skipManifest = false)
|
val processor = JJProcessor(nsRules ++ clsRules, verbose = false, skipManifest = false)
|
||||||
CoursierJarProcessor.run((baseJar +: toShadeJars).toArray, outputJar, processor.proc, true)
|
CoursierJarProcessor.run((baseJar +: toShadeJars).toArray, outputJar, processor.proc, true)
|
||||||
|
|
||||||
outputJar
|
outputJar
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue