mirror of https://github.com/sbt/sbt.git
Only take inter projects into account in compile config (#136)
This commit is contained in:
parent
ea54d912bc
commit
737a767516
|
|
@ -44,11 +44,6 @@ final case class ResolutionParams(
|
|||
)
|
||||
}
|
||||
|
||||
val repositories =
|
||||
internalRepositories ++
|
||||
mainRepositories ++
|
||||
fallbackDependenciesRepositories
|
||||
|
||||
lazy val resolutionKey = {
|
||||
val cleanCache = cache
|
||||
.withPool(null)
|
||||
|
|
@ -56,7 +51,9 @@ final case class ResolutionParams(
|
|||
.withSync[Task](null)
|
||||
SbtCoursierCache.ResolutionKey(
|
||||
dependencies,
|
||||
repositories,
|
||||
internalRepositories,
|
||||
mainRepositories,
|
||||
fallbackDependenciesRepositories,
|
||||
copy(
|
||||
parentProjectCache = Map.empty,
|
||||
loggerOpt = None,
|
||||
|
|
|
|||
|
|
@ -19,11 +19,18 @@ object ResolutionRun {
|
|||
configs: Set[Configuration]
|
||||
): Either[coursier.error.ResolutionError, Resolution] = {
|
||||
|
||||
val rules = params.strictOpt.map(s => Seq((s, RuleResolution.Fail))).getOrElse(Nil)
|
||||
|
||||
val isCompileConfig =
|
||||
configs(Configuration.compile)
|
||||
val isCompileOrScalaToolConfig =
|
||||
configs(Configuration.compile) || configs(Configuration("scala-tool"))
|
||||
|
||||
val repositories =
|
||||
params.internalRepositories.drop(if (isCompileConfig) 0 else 1) ++
|
||||
params.mainRepositories ++
|
||||
params.fallbackDependenciesRepositories
|
||||
|
||||
val rules = params.strictOpt.map(s => Seq((s, RuleResolution.Fail))).getOrElse(Nil)
|
||||
|
||||
val printOptionalMessage = verbosityLevel >= 0 && verbosityLevel <= 1
|
||||
|
||||
def depsRepr(deps: Seq[(Configuration, Dependency)]) =
|
||||
|
|
@ -46,7 +53,7 @@ object ResolutionRun {
|
|||
).flatten.mkString("\n")
|
||||
|
||||
if (verbosityLevel >= 2) {
|
||||
val repoReprs = params.repositories.map {
|
||||
val repoReprs = repositories.map {
|
||||
case r: IvyRepository =>
|
||||
s"ivy:${r.pattern}"
|
||||
case _: InterProjectRepository =>
|
||||
|
|
@ -76,14 +83,14 @@ object ResolutionRun {
|
|||
dep
|
||||
}
|
||||
)
|
||||
.withRepositories(params.repositories)
|
||||
.withRepositories(repositories)
|
||||
.withResolutionParams(
|
||||
params
|
||||
.params
|
||||
.addForceVersion(params.interProjectDependencies.map(_.moduleVersion): _*)
|
||||
.withForceScalaVersion(isCompileConfig && params.autoScalaLibOpt.nonEmpty)
|
||||
.addForceVersion((if (isCompileConfig) params.interProjectDependencies.map(_.moduleVersion) else Nil): _*)
|
||||
.withForceScalaVersion(isCompileOrScalaToolConfig && params.autoScalaLibOpt.nonEmpty)
|
||||
.withScalaVersion(params.autoScalaLibOpt.map(_._2))
|
||||
.withTypelevel(params.params.typelevel && isCompileConfig)
|
||||
.withTypelevel(params.params.typelevel && isCompileOrScalaToolConfig)
|
||||
.withRules(rules)
|
||||
)
|
||||
.withCache(
|
||||
|
|
|
|||
|
|
@ -41,7 +41,9 @@ object SbtCoursierCache {
|
|||
|
||||
final case class ResolutionKey(
|
||||
dependencies: Seq[(Configuration, Dependency)],
|
||||
repositories: Seq[Repository],
|
||||
internalRepositories: Seq[Repository],
|
||||
mainRepositories: Seq[Repository],
|
||||
fallbackRepositories: Seq[Repository],
|
||||
params: ResolutionParams,
|
||||
tmpCacheKey: Object, // temporary, until we can use https://github.com/coursier/coursier/pull/1090
|
||||
sbtClassifiers: Boolean
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
scalaVersion := "2.12.9"
|
||||
crossScalaVersions := Seq("2.12.8", "2.12.9") // shouldn't be the same version as coursier - putting two versions here to be sure one of them isn't
|
||||
organization := "org.scala-lang.modules"
|
||||
name := "scala-xml"
|
||||
version := "2.0.0-SNAPSHOT"
|
||||
|
|
@ -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,13 @@
|
|||
import java.io.File
|
||||
import java.nio.file.Files
|
||||
|
||||
|
||||
/**
|
||||
* Azertyuiopqsdfghjklmwxcvbn
|
||||
*
|
||||
* @author A
|
||||
* @param may not be `'''null'''`!!!
|
||||
*/
|
||||
object Main extends App {
|
||||
Files.write(new File("output").toPath, "OK".getBytes("UTF-8"))
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
> +doc
|
||||
Loading…
Reference in New Issue