mirror of https://github.com/sbt/sbt.git
commit
740f4b8e60
10
build.sbt
10
build.sbt
|
|
@ -16,7 +16,7 @@ inThisBuild(List(
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
semanticdbEnabled := true,
|
semanticdbEnabled := true,
|
||||||
semanticdbVersion := "4.8.14",
|
semanticdbVersion := "4.9.8",
|
||||||
scalafixDependencies += "net.hamnaberg" %% "dataclass-scalafix" % dataclassScalafixV,
|
scalafixDependencies += "net.hamnaberg" %% "dataclass-scalafix" % dataclassScalafixV,
|
||||||
version := "2.0.0-alpha8-SNAPSHOT",
|
version := "2.0.0-alpha8-SNAPSHOT",
|
||||||
scalaVersion := scala3,
|
scalaVersion := scala3,
|
||||||
|
|
@ -43,7 +43,7 @@ ThisBuild / assemblyMergeStrategy := {
|
||||||
oldStrategy(x)
|
oldStrategy(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
val coursierVersion0 = "2.1.9"
|
val coursierVersion0 = "2.1.13"
|
||||||
val lmVersion = "1.3.4"
|
val lmVersion = "1.3.4"
|
||||||
val lm2_13Version = "1.5.0-M3"
|
val lm2_13Version = "1.5.0-M3"
|
||||||
val lm3Version = "2.0.0-M1"
|
val lm3Version = "2.0.0-M1"
|
||||||
|
|
@ -143,7 +143,7 @@ lazy val `lm-coursier` = project
|
||||||
// IvySbt#Module (seems DependencyResolutionInterface.moduleDescriptor
|
// IvySbt#Module (seems DependencyResolutionInterface.moduleDescriptor
|
||||||
// is ignored).
|
// is ignored).
|
||||||
lmIvy.value,
|
lmIvy.value,
|
||||||
"org.scalatest" %% "scalatest" % "3.2.18" % Test,
|
"org.scalatest" %% "scalatest" % "3.2.19" % Test
|
||||||
),
|
),
|
||||||
excludeDependencies ++= excludedDependencies,
|
excludeDependencies ++= excludedDependencies,
|
||||||
Test / exportedProducts := {
|
Test / exportedProducts := {
|
||||||
|
|
@ -222,7 +222,7 @@ lazy val `lm-coursier-shaded` = project
|
||||||
"io.get-coursier.jniutils" % "windows-jni-utils-lmcoursier" % jniUtilsVersion,
|
"io.get-coursier.jniutils" % "windows-jni-utils-lmcoursier" % jniUtilsVersion,
|
||||||
"net.hamnaberg" %% "dataclass-annotation" % dataclassScalafixV % Provided,
|
"net.hamnaberg" %% "dataclass-annotation" % dataclassScalafixV % Provided,
|
||||||
lmIvy.value % Provided,
|
lmIvy.value % Provided,
|
||||||
"org.scalatest" %% "scalatest" % "3.2.18" % Test,
|
"org.scalatest" %% "scalatest" % "3.2.19" % Test,
|
||||||
),
|
),
|
||||||
excludeDependencies ++= excludedDependencies,
|
excludeDependencies ++= excludedDependencies,
|
||||||
conflictWarning := ConflictWarning.disable,
|
conflictWarning := ConflictWarning.disable,
|
||||||
|
|
@ -236,7 +236,7 @@ lazy val `sbt-coursier-shared` = project
|
||||||
.settings(
|
.settings(
|
||||||
plugin,
|
plugin,
|
||||||
generatePropertyFile,
|
generatePropertyFile,
|
||||||
libraryDependencies += "com.lihaoyi" %% "utest" % "0.8.3" % Test,
|
libraryDependencies += "com.lihaoyi" %% "utest" % "0.8.4" % Test,
|
||||||
testFrameworks += new TestFramework("utest.runner.Framework")
|
testFrameworks += new TestFramework("utest.runner.Framework")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,15 +4,16 @@ import java.io.File
|
||||||
import java.net.URL
|
import java.net.URL
|
||||||
import java.util.GregorianCalendar
|
import java.util.GregorianCalendar
|
||||||
import java.util.concurrent.ConcurrentHashMap
|
import java.util.concurrent.ConcurrentHashMap
|
||||||
|
|
||||||
import coursier.cache.CacheUrl
|
import coursier.cache.CacheUrl
|
||||||
import coursier.{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, Info, Publication, Type}
|
||||||
import coursier.maven.MavenAttributes
|
import coursier.maven.MavenAttributes
|
||||||
import coursier.util.Artifact
|
import coursier.util.Artifact
|
||||||
import sbt.librarymanagement.{Artifact => _, Configuration => _, _}
|
import sbt.librarymanagement.{Artifact => _, Configuration => _, _}
|
||||||
import sbt.util.Logger
|
import sbt.util.Logger
|
||||||
|
|
||||||
|
import scala.annotation.tailrec
|
||||||
|
|
||||||
private[internal] object SbtUpdateReport {
|
private[internal] object SbtUpdateReport {
|
||||||
|
|
||||||
private def caching[K, V](f: K => V): K => V = {
|
private def caching[K, V](f: K => V): K => V = {
|
||||||
|
|
@ -226,6 +227,26 @@ private[internal] object SbtUpdateReport {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Assemble the project info, resolving inherited fields. Only implements resolving
|
||||||
|
* the fields that are relevant for moduleReport
|
||||||
|
*
|
||||||
|
* @see https://maven.apache.org/pom.html#Inheritance
|
||||||
|
* @see https://maven.apache.org/ref/3-LATEST/maven-model-builder/index.html#Inheritance_Assembly
|
||||||
|
*/
|
||||||
|
def assemble(project: Project): Project = {
|
||||||
|
@tailrec
|
||||||
|
def licenseInfo(project: Project): Seq[Info.License] = {
|
||||||
|
if (project.info.licenseInfo.nonEmpty || project.parent.isEmpty)
|
||||||
|
project.info.licenseInfo
|
||||||
|
else
|
||||||
|
licenseInfo(lookupProject(project.parent.get).get)
|
||||||
|
}
|
||||||
|
project.withInfo(
|
||||||
|
project.info.withLicenseInfo(licenseInfo(project))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
val m = Dependency(thisModule._1, "")
|
val m = Dependency(thisModule._1, "")
|
||||||
val directReverseDependencies = res.rootDependencies.toSet.map(clean).map(_.withVersion(""))
|
val directReverseDependencies = res.rootDependencies.toSet.map(clean).map(_.withVersion(""))
|
||||||
.map(
|
.map(
|
||||||
|
|
@ -252,6 +273,7 @@ private[internal] object SbtUpdateReport {
|
||||||
groupedDepArtifacts.toVector.map {
|
groupedDepArtifacts.toVector.map {
|
||||||
case (dep, artifacts) =>
|
case (dep, artifacts) =>
|
||||||
val proj = lookupProject(dep.moduleVersion).get
|
val proj = lookupProject(dep.moduleVersion).get
|
||||||
|
val assembledProject = assemble(proj)
|
||||||
|
|
||||||
// FIXME Likely flaky...
|
// FIXME Likely flaky...
|
||||||
val dependees = reverseDependencies
|
val dependees = reverseDependencies
|
||||||
|
|
@ -280,7 +302,7 @@ private[internal] object SbtUpdateReport {
|
||||||
moduleReport((
|
moduleReport((
|
||||||
dep,
|
dep,
|
||||||
dependees,
|
dependees,
|
||||||
proj,
|
assembledProject,
|
||||||
filesOpt,
|
filesOpt,
|
||||||
classLoaders,
|
classLoaders,
|
||||||
))
|
))
|
||||||
|
|
|
||||||
|
|
@ -235,4 +235,17 @@ final class ResolutionSpec extends AnyPropSpec with Matchers {
|
||||||
|
|
||||||
assert(resolution.isRight)
|
assert(resolution.isRight)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
property("resolve licenses from parent poms") {
|
||||||
|
val dependencies =
|
||||||
|
Vector(("org.apache.commons" % "commons-compress" % "1.26.2"))
|
||||||
|
val coursierModule = module(lmEngine, stubModule, dependencies, Some("2.12.4"))
|
||||||
|
val resolution =
|
||||||
|
lmEngine.update(coursierModule, UpdateConfiguration(), UnresolvedWarningConfiguration(), log)
|
||||||
|
|
||||||
|
assert(resolution.isRight)
|
||||||
|
val componentConfig = resolution.right.get.configurations.find(_.configuration == Compile.toConfigRef).get
|
||||||
|
val compress = componentConfig.modules.find(_.module.name == "commons-compress").get
|
||||||
|
compress.licenses should have size 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,9 @@ import com.jsuereth.sbtpgp._
|
||||||
|
|
||||||
object Settings {
|
object Settings {
|
||||||
|
|
||||||
def scala212 = "2.12.17"
|
def scala212 = "2.12.20"
|
||||||
def scala213 = "2.13.10"
|
def scala213 = "2.13.15"
|
||||||
def scala3 = "3.3.1"
|
def scala3 = "3.3.4"
|
||||||
|
|
||||||
def targetSbtVersion = "1.2.8"
|
def targetSbtVersion = "1.2.8"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
sbt.version=1.9.7
|
sbt.version=1.10.2
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
semanticdbEnabled := false
|
semanticdbEnabled := false
|
||||||
|
|
||||||
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
|
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.6.1")
|
||||||
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.3")
|
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.4")
|
||||||
// addSbtPlugin("io.get-coursier" % "sbt-shading" % "2.1.5")
|
// addSbtPlugin("io.get-coursier" % "sbt-shading" % "2.1.5")
|
||||||
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.0.0-RC1")
|
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.0.0-RC1")
|
||||||
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1")
|
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.13.0")
|
||||||
|
|
||||||
libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value
|
libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue