mirror of
https://github.com/sbt/sbt.git
synced 2026-09-06 17:40:06 +02:00
Merge pull request #4744 from eed3si9n/wip/bumpcoursier
lm-coursier-shaded 1.1.0-M14-3
This commit is contained in:
@@ -12,9 +12,11 @@ import java.net.{ URI, URL, URLClassLoader }
|
||||
import java.util.Optional
|
||||
import java.util.concurrent.{ Callable, TimeUnit }
|
||||
|
||||
import lmcoursier.CoursierDependencyResolution
|
||||
import lmcoursier.definitions.{ Configuration => CConfiguration }
|
||||
import org.apache.ivy.core.module.descriptor.ModuleDescriptor
|
||||
import org.apache.ivy.core.module.id.ModuleRevisionId
|
||||
import sbt.coursierint._
|
||||
import sbt.Def.{ Initialize, ScopedKey, Setting, SettingsDefinition }
|
||||
import sbt.Keys._
|
||||
import sbt.Project.{
|
||||
@@ -1910,6 +1912,19 @@ object Defaults extends BuildCommon {
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
def dependencyResolutionTask: Def.Initialize[Task[DependencyResolution]] =
|
||||
Def.taskDyn {
|
||||
if (useCoursier.value) {
|
||||
Def.task { CoursierDependencyResolution(csrConfiguration.value) }
|
||||
} else
|
||||
Def.task {
|
||||
IvyDependencyResolution(
|
||||
ivyConfiguration.value,
|
||||
CustomHttp.okhttpClient.value
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
object Classpaths {
|
||||
import Defaults._
|
||||
@@ -2232,7 +2247,7 @@ object Classpaths {
|
||||
)
|
||||
else None
|
||||
},
|
||||
dependencyResolution := LibraryManagement.dependencyResolutionTask.value,
|
||||
dependencyResolution := dependencyResolutionTask.value,
|
||||
publisher := IvyPublisher(ivyConfiguration.value, CustomHttp.okhttpClient.value),
|
||||
ivyConfiguration := mkIvyConfiguration.value,
|
||||
ivyConfigurations := {
|
||||
@@ -2399,7 +2414,7 @@ object Classpaths {
|
||||
transitiveClassifiers.value.toVector
|
||||
)
|
||||
},
|
||||
dependencyResolution := LibraryManagement.dependencyResolutionTask.value,
|
||||
dependencyResolution := dependencyResolutionTask.value,
|
||||
csrConfiguration := LMCoursier.updateClassifierConfigurationTask.value,
|
||||
updateClassifiers in TaskGlobal := (Def.task {
|
||||
val s = streams.value
|
||||
@@ -2602,7 +2617,7 @@ object Classpaths {
|
||||
).withScalaOrganization(scalaOrganization.value)
|
||||
)
|
||||
},
|
||||
dependencyResolution := LibraryManagement.dependencyResolutionTask.value,
|
||||
dependencyResolution := dependencyResolutionTask.value,
|
||||
csrConfiguration := LMCoursier.updateSbtClassifierConfigurationTask.value,
|
||||
updateSbtClassifiers in TaskGlobal := (Def.task {
|
||||
val lm = dependencyResolution.value
|
||||
@@ -2645,7 +2660,7 @@ object Classpaths {
|
||||
) ++
|
||||
inTask(scalaCompilerBridgeScope)(
|
||||
Seq(
|
||||
dependencyResolution := LibraryManagement.dependencyResolutionTask.value,
|
||||
dependencyResolution := dependencyResolutionTask.value,
|
||||
csrConfiguration := LMCoursier.scalaCompilerBridgeConfigurationTask.value,
|
||||
csrResolvers := CoursierRepositoriesTasks.coursierResolversTask.value,
|
||||
externalResolvers := scalaCompilerBridgeResolvers.value,
|
||||
|
||||
+1
-2
@@ -6,8 +6,7 @@
|
||||
*/
|
||||
|
||||
package sbt
|
||||
package internal
|
||||
package librarymanagement
|
||||
package coursierint
|
||||
|
||||
import lmcoursier.definitions.{
|
||||
Classifier => CClassifier,
|
||||
+8
-11
@@ -6,8 +6,7 @@
|
||||
*/
|
||||
|
||||
package sbt
|
||||
package internal
|
||||
package librarymanagement
|
||||
package coursierint
|
||||
|
||||
import java.net.URL
|
||||
import sbt.librarymanagement._
|
||||
@@ -35,7 +34,7 @@ import sbt.librarymanagement.ivy.{
|
||||
import sbt.ScopeFilter.Make._
|
||||
import scala.collection.JavaConverters._
|
||||
|
||||
private[sbt] object CoursierInputsTasks {
|
||||
object CoursierInputsTasks {
|
||||
private def coursierProject0(
|
||||
projId: ModuleID,
|
||||
dependencies: Seq[ModuleID],
|
||||
@@ -58,21 +57,19 @@ private[sbt] object CoursierInputsTasks {
|
||||
sv,
|
||||
sbv
|
||||
)
|
||||
val proj1 = proj0.copy(
|
||||
dependencies = proj0.dependencies.map {
|
||||
case (config, dep) =>
|
||||
(config, dep.copy(exclusions = dep.exclusions ++ exclusions0))
|
||||
}
|
||||
)
|
||||
val proj1 = proj0.withDependencies(proj0.dependencies.map {
|
||||
case (config, dep) =>
|
||||
(config, dep.withExclusions(dep.exclusions ++ exclusions0))
|
||||
})
|
||||
auOpt match {
|
||||
case Some(au) =>
|
||||
val props = proj1.properties :+ ("info.apiURL" -> au.toString)
|
||||
proj1.copy(properties = props)
|
||||
proj1.withProperties(props)
|
||||
case _ => proj1
|
||||
}
|
||||
}
|
||||
|
||||
private[sbt] def coursierProjectTask: Def.Initialize[sbt.Task[CProject]] =
|
||||
def coursierProjectTask: Def.Initialize[sbt.Task[CProject]] =
|
||||
Def.task {
|
||||
coursierProject0(
|
||||
projectID.value,
|
||||
+2
-3
@@ -6,15 +6,14 @@
|
||||
*/
|
||||
|
||||
package sbt
|
||||
package internal
|
||||
package librarymanagement
|
||||
package coursierint
|
||||
|
||||
import sbt.librarymanagement._
|
||||
import sbt.Keys._
|
||||
import sbt.ScopeFilter.Make._
|
||||
import sbt.io.IO
|
||||
|
||||
private[sbt] object CoursierRepositoriesTasks {
|
||||
object CoursierRepositoriesTasks {
|
||||
private object CResolvers {
|
||||
private val slowReposBase = Seq(
|
||||
"https://repo.typesafe.com/",
|
||||
+2
-3
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
package sbt
|
||||
package internal
|
||||
package coursierint
|
||||
|
||||
import java.io.File
|
||||
import lmcoursier.definitions.{
|
||||
@@ -16,10 +16,9 @@ import lmcoursier.definitions.{
|
||||
Project => CProject
|
||||
}
|
||||
import lmcoursier._
|
||||
import sbt.librarymanagement._
|
||||
import lmcoursier.credentials.Credentials
|
||||
import Keys._
|
||||
import sbt.internal.librarymanagement.{ CoursierArtifactsTasks, CoursierInputsTasks }
|
||||
import sbt.librarymanagement._
|
||||
import sbt.util.Logger
|
||||
import sbt.io.syntax._
|
||||
import xsbti.AppConfiguration
|
||||
@@ -8,12 +8,10 @@
|
||||
package sbt
|
||||
package internal
|
||||
|
||||
import lmcoursier.CoursierDependencyResolution
|
||||
import java.io.File
|
||||
import sbt.internal.librarymanagement._
|
||||
import sbt.internal.util.{ ConsoleAppender, LogOption }
|
||||
import sbt.librarymanagement._
|
||||
import sbt.librarymanagement.ivy.IvyDependencyResolution
|
||||
import sbt.librarymanagement.syntax._
|
||||
import sbt.util.{ CacheStore, CacheStoreFactory, Logger, Tracked }
|
||||
import sbt.io.IO
|
||||
@@ -47,19 +45,6 @@ private[sbt] object LibraryManagement {
|
||||
coursierOpt.orElse(notIvyOpt).getOrElse(true)
|
||||
}
|
||||
|
||||
def dependencyResolutionTask: Def.Initialize[Task[DependencyResolution]] =
|
||||
Def.taskDyn {
|
||||
if (Keys.useCoursier.value) {
|
||||
Def.task { CoursierDependencyResolution(Keys.csrConfiguration.value) }
|
||||
} else
|
||||
Def.task {
|
||||
IvyDependencyResolution(
|
||||
Keys.ivyConfiguration.value,
|
||||
CustomHttp.okhttpClient.value
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
def cachedUpdate(
|
||||
lm: DependencyResolution,
|
||||
module: ModuleDescriptor,
|
||||
|
||||
@@ -85,11 +85,9 @@ object IvyXml {
|
||||
.collect { case (conf, dep) if conf.value == shadedConfig.value => dep }
|
||||
}
|
||||
|
||||
val project: Project = project0.copy(
|
||||
dependencies = project0.dependencies.collect {
|
||||
case p @ (_, dep) if !filterOutDependencies(dep) => p
|
||||
}
|
||||
)
|
||||
val project: Project = project0.withDependencies(project0.dependencies.collect {
|
||||
case p @ (_, dep) if !filterOutDependencies(dep) => p
|
||||
})
|
||||
|
||||
val infoAttrs =
|
||||
(project.module.attributes.toSeq ++ project.properties).foldLeft[xml.MetaData](xml.Null) {
|
||||
@@ -186,7 +184,7 @@ object IvyXml {
|
||||
val currentProject = {
|
||||
val proj = csrProject.value
|
||||
val publications = csrPublications.value
|
||||
proj.copy(publications = publications)
|
||||
proj.withPublications(publications)
|
||||
}
|
||||
IvyXml.writeFiles(
|
||||
currentProject,
|
||||
|
||||
@@ -112,7 +112,7 @@ object Dependencies {
|
||||
def addSbtZincCompileCore(p: Project): Project =
|
||||
addSbtModule(p, sbtZincPath, "zincCompileCore", zincCompileCore)
|
||||
|
||||
val lmCoursierVersion = "1.1.0-M14-3"
|
||||
val lmCoursierVersion = "1.1.0-M14-4"
|
||||
val lmCoursierShaded = "io.get-coursier" %% "lm-coursier-shaded" % lmCoursierVersion
|
||||
|
||||
val sjsonNewScalaJson = Def.setting {
|
||||
|
||||
Reference in New Issue
Block a user