mirror of https://github.com/sbt/sbt.git
Adapt to new library management API
This commit is contained in:
parent
3cc49e49f4
commit
347914191a
14
build.sbt
14
build.sbt
|
|
@ -241,11 +241,11 @@ lazy val actionsProj = (project in file("main-actions"))
|
|||
addSbtIO,
|
||||
addSbtUtilLogging,
|
||||
addSbtUtilRelation,
|
||||
addSbtUtilTracking,
|
||||
addSbtCompilerInterface,
|
||||
addSbtCompilerClasspath,
|
||||
addSbtCompilerApiInfo,
|
||||
addSbtUtilTracking,
|
||||
addSbtLm,
|
||||
addSbtLmCore,
|
||||
addSbtCompilerIvyIntegration,
|
||||
addSbtZinc
|
||||
)
|
||||
|
|
@ -281,7 +281,7 @@ lazy val commandProj = (project in file("main-command"))
|
|||
addSbtUtilLogging,
|
||||
addSbtCompilerInterface,
|
||||
addSbtCompilerClasspath,
|
||||
addSbtLm
|
||||
addSbtLmCore
|
||||
)
|
||||
|
||||
// The core macro project defines the main logic of the DSL, abstracted
|
||||
|
|
@ -329,7 +329,7 @@ lazy val mainSettingsProj = (project in file("main-settings"))
|
|||
addSbtUtilRelation,
|
||||
addSbtCompilerInterface,
|
||||
addSbtCompilerClasspath,
|
||||
addSbtLm
|
||||
addSbtLmCore
|
||||
)
|
||||
|
||||
// The main integration project for sbt. It brings all of the projects together, configures them, and provides for overriding conventions.
|
||||
|
|
@ -347,10 +347,10 @@ lazy val mainProj = (project in file("main"))
|
|||
.configure(
|
||||
addSbtIO,
|
||||
addSbtUtilLogging,
|
||||
addSbtLmCore,
|
||||
addSbtLmIvy,
|
||||
addSbtCompilerInterface,
|
||||
addSbtLm,
|
||||
addSbtZincCompile
|
||||
)
|
||||
addSbtZincCompile)
|
||||
|
||||
// Strictly for bringing implicits and aliases from subsystems into the top-level sbt namespace through a single package object
|
||||
// technically, we need a dependency on all of mainProj's dependencies, but we don't do that since this is strictly an integration project
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import sbt.util.CacheImplicits._
|
|||
import sbt.util.Tracked.inputChanged
|
||||
import sbt.util.{ CacheStoreFactory, FilesInfo, HashFileInfo, ModifiedFileInfo, PlainFileInfo }
|
||||
import sbt.internal.util.HNil
|
||||
import sbt.internal.util.HListFormats._
|
||||
import sbt.util.FileInfo.{ exists, hash, lastModified }
|
||||
import xsbti.compile.ClasspathOptions
|
||||
|
||||
|
|
|
|||
|
|
@ -46,14 +46,20 @@ class CacheIvyTest extends Properties("CacheIvy") {
|
|||
eq(out, m) :| s"Expected: ${str(m)}" :| s"Got: ${str(out)}"
|
||||
}
|
||||
|
||||
implicit val arbExclusionRule: Arbitrary[ExclusionRule] = Arbitrary(
|
||||
implicit val arbConfigRef: Arbitrary[ConfigRef] = Arbitrary(
|
||||
for {
|
||||
n <- Gen.alphaStr
|
||||
} yield ConfigRef(n)
|
||||
)
|
||||
|
||||
implicit val arbExclusionRule: Arbitrary[InclExclRule] = Arbitrary(
|
||||
for {
|
||||
o <- Gen.alphaStr
|
||||
n <- Gen.alphaStr
|
||||
a <- Gen.alphaStr
|
||||
v <- arbCrossVersion.arbitrary
|
||||
cs <- arbitrary[List[String]]
|
||||
} yield ExclusionRule(o, n, a, cs.toVector, v)
|
||||
cs <- arbitrary[List[ConfigRef]]
|
||||
} yield InclExclRule(o, n, a, cs.toVector, v)
|
||||
)
|
||||
|
||||
implicit val arbCrossVersion: Arbitrary[CrossVersion] = Arbitrary {
|
||||
|
|
@ -78,8 +84,8 @@ class CacheIvyTest extends Properties("CacheIvy") {
|
|||
isTransitive <- arbitrary[Boolean]
|
||||
isForce <- arbitrary[Boolean]
|
||||
explicitArtifacts <- Gen.listOf(arbitrary[Artifact])
|
||||
exclusions <- Gen.listOf(arbitrary[ExclusionRule])
|
||||
inclusions <- Gen.listOf(arbitrary[InclusionRule])
|
||||
exclusions <- Gen.listOf(arbitrary[InclExclRule])
|
||||
inclusions <- Gen.listOf(arbitrary[InclExclRule])
|
||||
extraAttributes <- Gen.mapOf(arbitrary[(String, String)])
|
||||
crossVersion <- arbitrary[CrossVersion]
|
||||
} yield
|
||||
|
|
|
|||
|
|
@ -56,6 +56,14 @@ object Append {
|
|||
})
|
||||
def appendValue(a: List[T], b: V): List[T] = a :+ (b: T)
|
||||
}
|
||||
implicit def appendVectorImplicit[T, V](implicit ev: V => T): Sequence[Vector[T], Seq[V], V] =
|
||||
new Sequence[Vector[T], Seq[V], V] {
|
||||
def appendValues(a: Vector[T], b: Seq[V]): Vector[T] =
|
||||
a ++ (b map { x =>
|
||||
(x: T)
|
||||
})
|
||||
def appendValue(a: Vector[T], b: V): Vector[T] = a :+ (b: T)
|
||||
}
|
||||
implicit def appendString: Value[String, String] = new Value[String, String] {
|
||||
def appendValue(a: String, b: String) = a + b
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,8 +48,7 @@ import sbt.io.{
|
|||
PathFinder,
|
||||
SimpleFileFilter,
|
||||
DirectoryFilter,
|
||||
Hash,
|
||||
WatchService
|
||||
Hash
|
||||
}, Path._
|
||||
import sbt.librarymanagement.Artifact.{ DocClassifier, SourceClassifier }
|
||||
import sbt.librarymanagement.Configurations.{
|
||||
|
|
@ -62,7 +61,8 @@ import sbt.librarymanagement.Configurations.{
|
|||
Test
|
||||
}
|
||||
import sbt.librarymanagement.CrossVersion.{ binarySbtVersion, binaryScalaVersion, partialVersion }
|
||||
import sbt.librarymanagement.{ `package` => _, _ }
|
||||
import sbt.librarymanagement._
|
||||
import sbt.librarymanagement.ivy._
|
||||
import sbt.librarymanagement.syntax._
|
||||
import sbt.util.InterfaceUtil.{ toJavaFunction => f1 }
|
||||
import sbt.util._
|
||||
|
|
@ -470,7 +470,7 @@ object Defaults extends BuildCommon {
|
|||
globalLock = launcher.globalLock,
|
||||
componentProvider = app.provider.components,
|
||||
secondaryCacheDir = Option(zincDir),
|
||||
ivyConfiguration = bootIvyConfiguration.value,
|
||||
dependencyResolution = dependencyResolution.value,
|
||||
compilerBridgeSource = scalaCompilerBridgeSource.value,
|
||||
scalaJarsTarget = zincDir,
|
||||
log = streams.value.log
|
||||
|
|
@ -625,7 +625,7 @@ object Defaults extends BuildCommon {
|
|||
}
|
||||
|
||||
def scalaInstanceFromUpdate: Initialize[Task[ScalaInstance]] = Def.task {
|
||||
val toolReport = update.value.configuration(Configurations.ScalaTool.name) getOrElse
|
||||
val toolReport = update.value.configuration(Configurations.ScalaTool) getOrElse
|
||||
sys.error(noToolConfiguration(managedScalaInstance.value))
|
||||
def files(id: String) =
|
||||
for {
|
||||
|
|
@ -1065,12 +1065,13 @@ object Defaults extends BuildCommon {
|
|||
case c => Some(c.name)
|
||||
}
|
||||
val combined = cPart.toList ++ classifier.toList
|
||||
if (combined.isEmpty) a.withClassifier(None).withConfigurations(cOpt.toVector)
|
||||
val configurations = cOpt.map(c => ConfigRef(c.name)).toVector
|
||||
if (combined.isEmpty) a.withClassifier(None).withConfigurations(configurations)
|
||||
else {
|
||||
val classifierString = combined mkString "-"
|
||||
a.withClassifier(Some(classifierString))
|
||||
.withType(Artifact.classifierType(classifierString))
|
||||
.withConfigurations(cOpt.toVector)
|
||||
.withConfigurations(configurations)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1667,7 +1668,9 @@ object Classpaths {
|
|||
def notFound =
|
||||
sys.error(
|
||||
"Configuration to use for managed classpath must be explicitly defined when default configurations are not present.")
|
||||
search find { defined contains _.name } getOrElse notFound
|
||||
search find { c =>
|
||||
defined contains ConfigRef(c.name)
|
||||
} getOrElse notFound
|
||||
}
|
||||
|
||||
def packaged(pkgTasks: Seq[TaskKey[File]]): Initialize[Task[Map[Artifact, File]]] =
|
||||
|
|
@ -1703,12 +1706,14 @@ object Classpaths {
|
|||
packagedArtifacts :== Map.empty,
|
||||
crossTarget := target.value,
|
||||
makePom := {
|
||||
val config = makePomConfiguration.value;
|
||||
IvyActions.makePom(ivyModule.value, config, streams.value.log); config.file
|
||||
val config = makePomConfiguration.value
|
||||
val publisher = Keys.publisher.value
|
||||
publisher.makePomFile(ivyModule.value, config, streams.value.log)
|
||||
config.file
|
||||
},
|
||||
packagedArtifact in makePom := ((artifact in makePom).value -> makePom.value),
|
||||
deliver := deliverTask(deliverConfiguration).value,
|
||||
deliverLocal := deliverTask(deliverLocalConfiguration).value,
|
||||
deliver := deliverTask(publishConfiguration).value,
|
||||
deliverLocal := deliverTask(publishLocalConfiguration).value,
|
||||
publish := publishTask(publishConfiguration, deliver).value,
|
||||
publishLocal := publishTask(publishLocalConfiguration, deliverLocal).value,
|
||||
publishM2 := publishTask(publishM2Configuration, deliverLocal).value
|
||||
|
|
@ -1726,7 +1731,7 @@ object Classpaths {
|
|||
scmInfo :== None,
|
||||
offline :== false,
|
||||
defaultConfiguration :== Some(Configurations.Compile),
|
||||
dependencyOverrides :== Set.empty,
|
||||
dependencyOverrides :== Vector.empty,
|
||||
libraryDependencies :== Nil,
|
||||
excludeDependencies :== Nil,
|
||||
ivyLoggingLevel :== {
|
||||
|
|
@ -1739,12 +1744,12 @@ object Classpaths {
|
|||
ivyValidate :== false,
|
||||
moduleConfigurations :== Nil,
|
||||
publishTo :== None,
|
||||
resolvers :== Nil,
|
||||
resolvers :== Vector.empty,
|
||||
useJCenter :== false,
|
||||
retrievePattern :== Resolver.defaultRetrievePattern,
|
||||
transitiveClassifiers :== Seq(SourceClassifier, DocClassifier),
|
||||
sourceArtifactTypes :== Artifact.DefaultSourceTypes,
|
||||
docArtifactTypes :== Artifact.DefaultDocTypes,
|
||||
sourceArtifactTypes :== Artifact.DefaultSourceTypes.toVector,
|
||||
docArtifactTypes :== Artifact.DefaultDocTypes.toVector,
|
||||
sbtDependency := {
|
||||
val app = appConfiguration.value
|
||||
val id = app.provider.id
|
||||
|
|
@ -1788,13 +1793,13 @@ object Classpaths {
|
|||
useJCenter.value) match {
|
||||
case (Some(delegated), Seq(), _, _) => delegated
|
||||
case (_, rs, Some(ars), uj) => ars ++ rs
|
||||
case (_, rs, _, uj) => Resolver.withDefaultResolvers(rs, uj, mavenCentral = true)
|
||||
case (_, rs, _, uj) => Resolver.combineDefaultResolvers(rs, uj, mavenCentral = true)
|
||||
}),
|
||||
appResolvers := {
|
||||
val ac = appConfiguration.value
|
||||
val uj = useJCenter.value
|
||||
appRepositories(ac) map { ars =>
|
||||
val useMavenCentral = ars contains DefaultMavenRepository
|
||||
val useMavenCentral = ars contains Resolver.DefaultMavenRepository
|
||||
Resolver.reorganizeAppResolvers(ars, uj, useMavenCentral)
|
||||
}
|
||||
},
|
||||
|
|
@ -1817,7 +1822,7 @@ object Classpaths {
|
|||
val st = state.value
|
||||
BuildPaths.getDependencyDirectory(st, BuildPaths.getGlobalBase(st))
|
||||
},
|
||||
otherResolvers := Resolver.publishMavenLocal :: publishTo.value.toList,
|
||||
otherResolvers := Resolver.publishMavenLocal +: publishTo.value.toVector,
|
||||
projectResolver := projectResolverTask.value,
|
||||
projectDependencies := projectDependenciesTask.value,
|
||||
// TODO - Is this the appropriate split? Ivy defines this simply as
|
||||
|
|
@ -1826,10 +1831,10 @@ object Classpaths {
|
|||
allDependencies := {
|
||||
projectDependencies.value ++ libraryDependencies.value
|
||||
},
|
||||
ivyScala := (ivyScala or (
|
||||
scalaModuleInfo := (scalaModuleInfo or (
|
||||
Def.setting {
|
||||
Option(
|
||||
IvyScala(
|
||||
ScalaModuleInfo(
|
||||
(scalaVersion in update).value,
|
||||
(scalaBinaryVersion in update).value,
|
||||
Vector.empty,
|
||||
|
|
@ -1848,26 +1853,27 @@ object Classpaths {
|
|||
projectDescriptors := depMap.value,
|
||||
updateConfiguration := {
|
||||
// Tell the UpdateConfiguration which artifact types are special (for sources and javadocs)
|
||||
val specialArtifactTypes = sourceArtifactTypes.value union docArtifactTypes.value
|
||||
val specialArtifactTypes = sourceArtifactTypes.value.toSet union docArtifactTypes.value.toSet
|
||||
// By default, to retrieve all types *but* these (it's assumed that everything else is binary/resource)
|
||||
UpdateConfiguration(
|
||||
retrieve = retrieveConfiguration.value,
|
||||
missingOk = false,
|
||||
logging = ivyLoggingLevel.value,
|
||||
artifactFilter = ArtifactTypeFilter.forbid(specialArtifactTypes),
|
||||
offline = offline.value,
|
||||
frozen = false
|
||||
)
|
||||
UpdateConfiguration()
|
||||
.withRetrieveManaged(retrieveConfiguration.value)
|
||||
.withLogging(ivyLoggingLevel.value)
|
||||
.withArtifactFilter(ArtifactTypeFilter.forbid(specialArtifactTypes))
|
||||
.withOffline(offline.value)
|
||||
},
|
||||
retrieveConfiguration := {
|
||||
if (retrieveManaged.value)
|
||||
Some(
|
||||
RetrieveConfiguration(managedDirectory.value,
|
||||
retrievePattern.value,
|
||||
retrieveManagedSync.value,
|
||||
configurationsToRetrieve.value))
|
||||
RetrieveConfiguration(
|
||||
managedDirectory.value,
|
||||
retrievePattern.value,
|
||||
retrieveManagedSync.value,
|
||||
configurationsToRetrieve.value.getOrElse(Vector.empty).map(c => ConfigRef(c.name))
|
||||
))
|
||||
else None
|
||||
},
|
||||
dependencyResolution := IvyDependencyResolution(ivyConfiguration.value),
|
||||
publisher := IvyPublisher(ivyConfiguration.value),
|
||||
ivyConfiguration := mkIvyConfiguration.value,
|
||||
ivyConfigurations := {
|
||||
val confs = thisProject.value.configurations
|
||||
|
|
@ -1888,36 +1894,37 @@ object Classpaths {
|
|||
pomPostProcess.value,
|
||||
pomIncludeRepository.value,
|
||||
pomAllRepositories.value),
|
||||
deliverLocalConfiguration := deliverConfig(crossTarget.value,
|
||||
status =
|
||||
if (isSnapshot.value) "integration"
|
||||
else "release",
|
||||
logging = ivyLoggingLevel.value),
|
||||
deliverConfiguration := deliverLocalConfiguration.value,
|
||||
publishConfiguration := {
|
||||
// TODO(jvican): I think this is a bug.
|
||||
val delivered = deliver.value
|
||||
publishConfig(
|
||||
packagedArtifacts.in(publish).value,
|
||||
if (publishMavenStyle.value) None else Some(delivered),
|
||||
resolverName = getPublishTo(publishTo.value).name,
|
||||
checksums = checksums.in(publish).value,
|
||||
logging = ivyLoggingLevel.value,
|
||||
overwrite = isSnapshot.value
|
||||
publishMavenStyle.value,
|
||||
deliverPattern(crossTarget.value),
|
||||
if (isSnapshot.value) "integration" else "release",
|
||||
ivyConfigurations.value.map(c => ConfigRef(c.name)).toVector,
|
||||
packagedArtifacts.in(publish).value.toVector,
|
||||
checksums.in(publish).value,
|
||||
getPublishTo(publishTo.value).name,
|
||||
ivyLoggingLevel.value,
|
||||
isSnapshot.value
|
||||
)
|
||||
},
|
||||
publishLocalConfiguration := publishConfig(
|
||||
packagedArtifacts.in(publishLocal).value,
|
||||
Some(deliverLocal.value),
|
||||
false, //publishMavenStyle.value,
|
||||
deliverPattern(crossTarget.value),
|
||||
if (isSnapshot.value) "integration" else "release",
|
||||
ivyConfigurations.value.map(c => ConfigRef(c.name)).toVector,
|
||||
packagedArtifacts.in(publishLocal).value.toVector,
|
||||
checksums.in(publishLocal).value,
|
||||
logging = ivyLoggingLevel.value,
|
||||
overwrite = isSnapshot.value
|
||||
),
|
||||
publishM2Configuration := publishConfig(
|
||||
packagedArtifacts.in(publishM2).value,
|
||||
None,
|
||||
resolverName = Resolver.publishMavenLocal.name,
|
||||
true,
|
||||
deliverPattern(crossTarget.value),
|
||||
if (isSnapshot.value) "integration" else "release",
|
||||
ivyConfigurations.value.map(c => ConfigRef(c.name)).toVector,
|
||||
packagedArtifacts.in(publishM2).value.toVector,
|
||||
checksums = checksums.in(publishM2).value,
|
||||
resolverName = Resolver.publishMavenLocal.name,
|
||||
logging = ivyLoggingLevel.value,
|
||||
overwrite = isSnapshot.value
|
||||
),
|
||||
|
|
@ -1955,14 +1962,18 @@ object Classpaths {
|
|||
implicit val key = (m: ModuleID) => (m.organization, m.name, m.revision)
|
||||
val projectDeps = projectDependencies.value.iterator.map(key).toSet
|
||||
val externalModules = update.value.allModules.filterNot(m => projectDeps contains key(m))
|
||||
GetClassifiersModule(projectID.value,
|
||||
externalModules,
|
||||
ivyConfigurations.in(updateClassifiers).value.toVector,
|
||||
transitiveClassifiers.in(updateClassifiers).value.toVector)
|
||||
GetClassifiersModule(
|
||||
projectID.value,
|
||||
None,
|
||||
externalModules,
|
||||
ivyConfigurations.in(updateClassifiers).value.toVector,
|
||||
transitiveClassifiers.in(updateClassifiers).value.toVector
|
||||
)
|
||||
},
|
||||
updateClassifiers := (Def.task {
|
||||
val s = streams.value
|
||||
val is = ivySbt.value
|
||||
val lm = new DependencyResolution(new IvyDependencyResolution(is))
|
||||
val mod = (classifiersModule in updateClassifiers).value
|
||||
val c = updateConfiguration.value
|
||||
val app = appConfiguration.value
|
||||
|
|
@ -1970,24 +1981,23 @@ object Classpaths {
|
|||
val docTypes = docArtifactTypes.value
|
||||
val out = is.withIvy(s.log)(_.getSettings.getDefaultIvyUserDir)
|
||||
val uwConfig = (unresolvedWarningConfiguration in update).value
|
||||
val depDir = dependencyCacheDirectory.value
|
||||
val ivy = ivyScala.value
|
||||
val st = state.value
|
||||
val scalaModule = scalaModuleInfo.value
|
||||
withExcludes(out, mod.classifiers, lock(app)) { excludes =>
|
||||
IvyActions.updateClassifiers(
|
||||
is,
|
||||
GetClassifiersConfiguration(mod,
|
||||
excludes,
|
||||
c.withArtifactFilter(c.artifactFilter.invert),
|
||||
ivy,
|
||||
srcTypes,
|
||||
docTypes),
|
||||
lm.updateClassifiers(
|
||||
GetClassifiersConfiguration(
|
||||
mod,
|
||||
excludes.toVector,
|
||||
c.withArtifactFilter(c.artifactFilter.map(af => af.withInverted(!af.inverted))),
|
||||
// scalaModule,
|
||||
srcTypes,
|
||||
docTypes),
|
||||
uwConfig,
|
||||
LogicalClock(st.hashCode),
|
||||
Some(depDir),
|
||||
Vector.empty,
|
||||
s.log
|
||||
)
|
||||
) match {
|
||||
case Left(_) => ???
|
||||
case Right(ur) => ur
|
||||
}
|
||||
}
|
||||
} tag (Tags.Update, Tags.Network)).value
|
||||
)
|
||||
|
|
@ -2010,7 +2020,7 @@ object Classpaths {
|
|||
else base
|
||||
val sbtOrg = scalaOrganization.value
|
||||
val version = scalaVersion.value
|
||||
if (scalaHome.value.isDefined || ivyScala.value.isEmpty || !managedScalaInstance.value)
|
||||
if (scalaHome.value.isDefined || scalaModuleInfo.value.isEmpty || !managedScalaInstance.value)
|
||||
pluginAdjust
|
||||
else {
|
||||
val isDotty = ScalaInstance.isDotty(version)
|
||||
|
|
@ -2050,9 +2060,9 @@ object Classpaths {
|
|||
new IvySbt(ivyConfiguration.value)
|
||||
}
|
||||
def moduleSettings0: Initialize[Task[ModuleSettings]] = Def.task {
|
||||
InlineConfiguration(
|
||||
ModuleDescriptorConfiguration(
|
||||
ivyValidate.value,
|
||||
ivyScala.value,
|
||||
scalaModuleInfo.value,
|
||||
projectID.value,
|
||||
projectInfo.value,
|
||||
allDependencies.value.toVector,
|
||||
|
|
@ -2083,7 +2093,7 @@ object Classpaths {
|
|||
.resolvers
|
||||
explicit orElse bootRepositories(appConfiguration.value) getOrElse externalResolvers.value
|
||||
},
|
||||
ivyConfiguration := new InlineIvyConfiguration(
|
||||
ivyConfiguration := InlineIvyConfiguration(
|
||||
paths = ivyPaths.value,
|
||||
resolvers = externalResolvers.value.toVector,
|
||||
otherResolvers = Vector.empty,
|
||||
|
|
@ -2101,16 +2111,18 @@ object Classpaths {
|
|||
// to fix https://github.com/sbt/sbt/issues/2686
|
||||
scalaVersion := appConfiguration.value.provider.scalaProvider.version,
|
||||
scalaBinaryVersion := binaryScalaVersion(scalaVersion.value),
|
||||
ivyScala := {
|
||||
scalaModuleInfo := {
|
||||
Some(
|
||||
IvyScala(scalaVersion.value,
|
||||
scalaBinaryVersion.value,
|
||||
Vector(),
|
||||
checkExplicit = false,
|
||||
filterImplicit = false,
|
||||
overrideScalaVersion = true).withScalaOrganization(scalaOrganization.value))
|
||||
ScalaModuleInfo(
|
||||
scalaVersion.value,
|
||||
scalaBinaryVersion.value,
|
||||
Vector(),
|
||||
checkExplicit = false,
|
||||
filterImplicit = false,
|
||||
overrideScalaVersion = true).withScalaOrganization(scalaOrganization.value))
|
||||
},
|
||||
updateSbtClassifiers in TaskGlobal := (Def.task {
|
||||
val lm = dependencyResolution.value
|
||||
val s = streams.value
|
||||
val is = ivySbt.value
|
||||
val mod = classifiersModule.value
|
||||
|
|
@ -2122,24 +2134,24 @@ object Classpaths {
|
|||
val out = is.withIvy(log)(_.getSettings.getDefaultIvyUserDir)
|
||||
val uwConfig = (unresolvedWarningConfiguration in update).value
|
||||
val depDir = dependencyCacheDirectory.value
|
||||
val ivy = ivyScala.value
|
||||
val ivy = scalaModuleInfo.value
|
||||
val st = state.value
|
||||
withExcludes(out, mod.classifiers, lock(app)) { excludes =>
|
||||
val noExplicitCheck = ivy.map(_.withCheckExplicit(false))
|
||||
IvyActions.transitiveScratch(
|
||||
is,
|
||||
// val noExplicitCheck = ivy.map(_.withCheckExplicit(false))
|
||||
lm.transitiveScratch(
|
||||
"sbt",
|
||||
GetClassifiersConfiguration(mod,
|
||||
excludes,
|
||||
c.withArtifactFilter(c.artifactFilter.invert),
|
||||
noExplicitCheck,
|
||||
srcTypes,
|
||||
docTypes),
|
||||
GetClassifiersConfiguration(
|
||||
mod,
|
||||
excludes.toVector,
|
||||
c.withArtifactFilter(c.artifactFilter.map(af => af.withInverted(!af.inverted))),
|
||||
srcTypes,
|
||||
docTypes),
|
||||
uwConfig,
|
||||
LogicalClock(st.hashCode),
|
||||
Some(depDir),
|
||||
log
|
||||
)
|
||||
) match {
|
||||
case Left(uw) => ???
|
||||
case Right(ur) => ur
|
||||
}
|
||||
}
|
||||
} tag (Tags.Update, Tags.Network)).value
|
||||
)) ++ Seq(bootIvyConfiguration := (ivyConfiguration in updateSbtClassifiers).value)
|
||||
|
|
@ -2151,12 +2163,16 @@ object Classpaths {
|
|||
val pluginClasspath = loadedBuild.value.units(ref.build).unit.plugins.fullClasspath.toVector
|
||||
val pluginJars = pluginClasspath.filter(_.data.isFile) // exclude directories: an approximation to whether they've been published
|
||||
val pluginIDs: Vector[ModuleID] = pluginJars.flatMap(_ get moduleID.key)
|
||||
GetClassifiersModule(projectID.value,
|
||||
sbtDependency.value +: pluginIDs,
|
||||
Vector(Configurations.Default),
|
||||
classifiers.toVector)
|
||||
GetClassifiersModule(
|
||||
projectID.value,
|
||||
// TODO: Should it be sbt's scalaModuleInfo?
|
||||
scalaModuleInfo.value,
|
||||
sbtDependency.value +: pluginIDs,
|
||||
Vector(Configurations.Default),
|
||||
classifiers.toVector
|
||||
)
|
||||
}
|
||||
def deliverTask(config: TaskKey[DeliverConfiguration]): Initialize[Task[File]] =
|
||||
def deliverTask(config: TaskKey[PublishConfiguration]): Initialize[Task[File]] =
|
||||
Def.task {
|
||||
val _ = update.value
|
||||
IvyActions.deliver(ivyModule.value, config.value, streams.value.log)
|
||||
|
|
@ -2178,7 +2194,7 @@ object Classpaths {
|
|||
}
|
||||
|
||||
def withExcludes(out: File, classifiers: Seq[String], lock: xsbti.GlobalLock)(
|
||||
f: Map[ModuleID, Set[String]] => UpdateReport): UpdateReport = {
|
||||
f: Map[ModuleID, Vector[ConfigRef]] => UpdateReport): UpdateReport = {
|
||||
import sbt.librarymanagement.LibraryManagementCodec._
|
||||
import sbt.util.FileBasedStore
|
||||
implicit val isoString: sjsonnew.IsoString[scalajson.ast.unsafe.JValue] =
|
||||
|
|
@ -2195,11 +2211,17 @@ object Classpaths {
|
|||
def call = {
|
||||
implicit val midJsonKeyFmt: sjsonnew.JsonKeyFormat[ModuleID] = moduleIdJsonKeyFormat
|
||||
val excludes =
|
||||
store.read[Map[ModuleID, Set[String]]](default = Map.empty[ModuleID, Set[String]])
|
||||
store
|
||||
.read[Map[ModuleID, Vector[ConfigRef]]](
|
||||
default = Map.empty[ModuleID, Vector[ConfigRef]])
|
||||
val report = f(excludes)
|
||||
val allExcludes = excludes ++ IvyActions.extractExcludes(report)
|
||||
val allExcludes: Map[ModuleID, Vector[ConfigRef]] = excludes ++ IvyActions
|
||||
.extractExcludes(report)
|
||||
.mapValues(cs => cs.map(c => ConfigRef(c)).toVector)
|
||||
store.write(allExcludes)
|
||||
IvyActions.addExcluded(report, classifiers.toVector, allExcludes)
|
||||
IvyActions.addExcluded(report,
|
||||
classifiers.toVector,
|
||||
allExcludes.mapValues(_.map(_.name).toSet))
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
@ -2373,25 +2395,24 @@ object Classpaths {
|
|||
def getPublishTo(repo: Option[Resolver]): Resolver =
|
||||
repo getOrElse sys.error("Repository for publishing is not specified.")
|
||||
|
||||
def deliverConfig(outputDirectory: File,
|
||||
status: String = "release",
|
||||
logging: UpdateLogging = UpdateLogging.DownloadOnly) =
|
||||
new DeliverConfiguration(deliverPattern(outputDirectory), status, None, logging)
|
||||
|
||||
def publishConfig(
|
||||
artifacts: Map[Artifact, File],
|
||||
ivyFile: Option[File],
|
||||
checksums: Seq[String],
|
||||
resolverName: String = "local",
|
||||
logging: UpdateLogging = UpdateLogging.DownloadOnly,
|
||||
overwrite: Boolean = false
|
||||
) =
|
||||
new PublishConfiguration(ivyFile,
|
||||
resolverName,
|
||||
artifacts,
|
||||
checksums.toVector,
|
||||
logging,
|
||||
overwrite)
|
||||
def publishConfig(publishMavenStyle: Boolean,
|
||||
deliverIvyPattern: String,
|
||||
status: String,
|
||||
configurations: Vector[ConfigRef],
|
||||
artifacts: Vector[(Artifact, File)],
|
||||
checksums: Vector[String],
|
||||
resolverName: String = "local",
|
||||
logging: UpdateLogging = UpdateLogging.DownloadOnly,
|
||||
overwrite: Boolean = false) =
|
||||
PublishConfiguration(publishMavenStyle,
|
||||
deliverIvyPattern,
|
||||
status,
|
||||
configurations,
|
||||
resolverName,
|
||||
artifacts,
|
||||
checksums,
|
||||
logging,
|
||||
overwrite)
|
||||
|
||||
def deliverPattern(outputPath: File): String =
|
||||
(outputPath / "[artifact]-[revision](-[classifier]).[ext]").absolutePath
|
||||
|
|
@ -2426,7 +2447,8 @@ object Classpaths {
|
|||
|
||||
def projectResolverTask: Initialize[Task[Resolver]] =
|
||||
projectDescriptors map { m =>
|
||||
new RawRepository(new ProjectResolver(ProjectResolver.InterProject, m))
|
||||
val resolver = new ProjectResolver(ProjectResolver.InterProject, m)
|
||||
new RawRepository(resolver, resolver.getName)
|
||||
}
|
||||
|
||||
def analyzed[T](data: T, analysis: CompileAnalysis) =
|
||||
|
|
@ -2555,19 +2577,16 @@ object Classpaths {
|
|||
val (rs, other) = (fullResolvers.value.toVector, otherResolvers.value.toVector)
|
||||
val s = streams.value
|
||||
warnResolversConflict(rs ++: other, s.log)
|
||||
new InlineIvyConfiguration(
|
||||
paths = ivyPaths.value,
|
||||
resolvers = rs,
|
||||
otherResolvers = other,
|
||||
moduleConfigurations = moduleConfigurations.value.toVector,
|
||||
// offline.value,
|
||||
lock = Option(lock(appConfiguration.value)),
|
||||
checksums = (checksums in update).value.toVector,
|
||||
managedChecksums = false,
|
||||
resolutionCacheDir = Some(crossTarget.value / "resolution-cache"),
|
||||
updateOptions = updateOptions.value,
|
||||
log = s.log
|
||||
)
|
||||
InlineIvyConfiguration()
|
||||
.withPaths(ivyPaths.value)
|
||||
.withResolvers(rs)
|
||||
.withOtherResolvers(other)
|
||||
.withModuleConfigurations(moduleConfigurations.value.toVector)
|
||||
.withLock(lock(appConfiguration.value))
|
||||
.withChecksums((checksums in update).value)
|
||||
.withResolutionCacheDir(crossTarget.value / "resolution-cache")
|
||||
.withUpdateOptions(updateOptions.value)
|
||||
.withLog(s.log)
|
||||
}
|
||||
|
||||
import java.util.LinkedHashSet
|
||||
|
|
@ -2581,12 +2600,12 @@ object Classpaths {
|
|||
val applicableConfigs = allConfigs(c)
|
||||
for (ac <- applicableConfigs) // add all configurations in this project
|
||||
visited add (p -> ac.name)
|
||||
val masterConfs = names(getConfigurations(projectRef, data))
|
||||
val masterConfs = names(getConfigurations(projectRef, data).toVector)
|
||||
|
||||
for (ResolvedClasspathDependency(dep, confMapping) <- deps.classpath(p)) {
|
||||
val configurations = getConfigurations(dep, data)
|
||||
val mapping =
|
||||
mapped(confMapping, masterConfs, names(configurations), "compile", "*->compile")
|
||||
mapped(confMapping, masterConfs, names(configurations.toVector), "compile", "*->compile")
|
||||
// map master configuration 'c' and all extended configurations to the appropriate dependency configuration
|
||||
for (ac <- applicableConfigs; depConfName <- mapping(ac.name)) {
|
||||
for (depConf <- confOpt(configurations, depConfName))
|
||||
|
|
@ -2824,8 +2843,8 @@ object Classpaths {
|
|||
case _: NoSuchMethodError => None
|
||||
}
|
||||
|
||||
def bootChecksums(app: xsbti.AppConfiguration): Seq[String] =
|
||||
try { app.provider.scalaProvider.launcher.checksums.toSeq } catch {
|
||||
def bootChecksums(app: xsbti.AppConfiguration): Vector[String] =
|
||||
try { app.provider.scalaProvider.launcher.checksums.toVector } catch {
|
||||
case _: NoSuchMethodError => IvySbt.DefaultChecksums
|
||||
}
|
||||
|
||||
|
|
@ -2834,13 +2853,13 @@ object Classpaths {
|
|||
catch { case _: NoSuchMethodError => false }
|
||||
|
||||
/** Loads the `appRepositories` configured for this launcher, if supported. */
|
||||
def appRepositories(app: xsbti.AppConfiguration): Option[Seq[Resolver]] =
|
||||
try { Some(app.provider.scalaProvider.launcher.appRepositories.toSeq map bootRepository) } catch {
|
||||
def appRepositories(app: xsbti.AppConfiguration): Option[Vector[Resolver]] =
|
||||
try { Some(app.provider.scalaProvider.launcher.appRepositories.toVector map bootRepository) } catch {
|
||||
case _: NoSuchMethodError => None
|
||||
}
|
||||
|
||||
def bootRepositories(app: xsbti.AppConfiguration): Option[Seq[Resolver]] =
|
||||
try { Some(app.provider.scalaProvider.launcher.ivyRepositories.toSeq map bootRepository) } catch {
|
||||
def bootRepositories(app: xsbti.AppConfiguration): Option[Vector[Resolver]] =
|
||||
try { Some(app.provider.scalaProvider.launcher.ivyRepositories.toVector map bootRepository) } catch {
|
||||
case _: NoSuchMethodError => None
|
||||
}
|
||||
|
||||
|
|
@ -2874,7 +2893,7 @@ object Classpaths {
|
|||
p.id match {
|
||||
case Predefined.Local => Resolver.defaultLocal
|
||||
case Predefined.MavenLocal => Resolver.mavenLocal
|
||||
case Predefined.MavenCentral => DefaultMavenRepository
|
||||
case Predefined.MavenCentral => Resolver.DefaultMavenRepository
|
||||
case Predefined.ScalaToolsReleases => Resolver.ScalaToolsReleases
|
||||
case Predefined.ScalaToolsSnapshots => Resolver.ScalaToolsSnapshots
|
||||
case Predefined.SonatypeOSSReleases => Resolver.sonatypeRepo("releases")
|
||||
|
|
@ -2998,7 +3017,13 @@ trait BuildExtra extends BuildCommon with DefExtra {
|
|||
otherTask map {
|
||||
case (base, app, pr, uo, s) =>
|
||||
val extraResolvers = if (addMultiResolver) Vector(pr) else Vector.empty
|
||||
ExternalIvyConfiguration(Option(lock(app)), base, s.log, uo, u, extraResolvers)
|
||||
ExternalIvyConfiguration()
|
||||
.withLock(lock(app))
|
||||
.withBaseDirectory(base)
|
||||
.withLog(s.log)
|
||||
.withUpdateOptions(uo)
|
||||
.withUri(u)
|
||||
.withExtraResolvers(extraResolvers)
|
||||
}
|
||||
}).value
|
||||
}
|
||||
|
|
@ -3007,18 +3032,19 @@ trait BuildExtra extends BuildCommon with DefExtra {
|
|||
baseDirectory.value / name
|
||||
}
|
||||
|
||||
def externalIvyFile(
|
||||
file: Initialize[File] = inBase("ivy.xml"),
|
||||
iScala: Initialize[Option[IvyScala]] = ivyScala): Setting[Task[ModuleSettings]] =
|
||||
def externalIvyFile(file: Initialize[File] = inBase("ivy.xml"),
|
||||
iScala: Initialize[Option[ScalaModuleInfo]] = scalaModuleInfo)
|
||||
: Setting[Task[ModuleSettings]] =
|
||||
moduleSettings := IvyFileConfiguration(ivyValidate.value,
|
||||
iScala.value,
|
||||
file.value,
|
||||
managedScalaInstance.value)
|
||||
|
||||
def externalPom(file: Initialize[File] = inBase("pom.xml"),
|
||||
iScala: Initialize[Option[IvyScala]] = ivyScala): Setting[Task[ModuleSettings]] =
|
||||
iScala: Initialize[Option[ScalaModuleInfo]] = scalaModuleInfo)
|
||||
: Setting[Task[ModuleSettings]] =
|
||||
moduleSettings := PomConfiguration(ivyValidate.value,
|
||||
ivyScala.value,
|
||||
scalaModuleInfo.value,
|
||||
file.value,
|
||||
managedScalaInstance.value)
|
||||
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ object EvaluateTaskConfig {
|
|||
final case class PluginData(
|
||||
dependencyClasspath: Seq[Attributed[File]],
|
||||
definitionClasspath: Seq[Attributed[File]],
|
||||
resolvers: Option[Seq[Resolver]],
|
||||
resolvers: Option[Vector[Resolver]],
|
||||
report: Option[UpdateReport],
|
||||
scalacOptions: Seq[String]
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -42,44 +42,40 @@ import sbt.internal.util.{ AttributeKey, SourcePosition }
|
|||
|
||||
import sbt.librarymanagement.Configurations.CompilerPlugin
|
||||
import sbt.librarymanagement.LibraryManagementCodec._
|
||||
import sbt.librarymanagement.ivy.{ Credentials, UpdateOptions }
|
||||
import sbt.librarymanagement.{
|
||||
Artifact,
|
||||
Configuration,
|
||||
ConflictManager,
|
||||
ConflictWarning,
|
||||
Credentials,
|
||||
CrossVersion,
|
||||
Developer,
|
||||
DependencyResolution,
|
||||
EvictionWarning,
|
||||
EvictionWarningOptions,
|
||||
IvyScala,
|
||||
GetClassifiersModule,
|
||||
MakePomConfiguration,
|
||||
MavenRepository,
|
||||
ModuleConfiguration,
|
||||
ModuleID,
|
||||
ModuleInfo,
|
||||
ModuleSettings,
|
||||
PublishConfiguration,
|
||||
Publisher,
|
||||
Resolver,
|
||||
RetrieveConfiguration,
|
||||
ScalaModuleInfo,
|
||||
ScalaVersion,
|
||||
ScmInfo,
|
||||
TrackLevel,
|
||||
UnresolvedWarningConfiguration,
|
||||
UpdateConfiguration,
|
||||
UpdateOptions,
|
||||
UpdateLogging,
|
||||
UpdateReport
|
||||
}
|
||||
import sbt.librarymanagement.ExclusionRule
|
||||
import sbt.internal.librarymanagement.{
|
||||
CompatibilityWarningOptions,
|
||||
DeliverConfiguration,
|
||||
GetClassifiersModule,
|
||||
IvyConfiguration,
|
||||
IvyPaths,
|
||||
IvySbt,
|
||||
MakePomConfiguration,
|
||||
PublishConfiguration,
|
||||
RetrieveConfiguration,
|
||||
UnresolvedWarningConfiguration
|
||||
}
|
||||
import sbt.librarymanagement.InclExclRule
|
||||
import sbt.internal.librarymanagement.{ CompatibilityWarningOptions, IvySbt }
|
||||
import sbt.librarymanagement.ivy.{ IvyConfiguration, IvyPaths }
|
||||
import sbt.util.{ Level, Logger }
|
||||
import org.apache.logging.log4j.core.Appender
|
||||
import sbt.BuildSyntax._
|
||||
|
|
@ -344,6 +340,8 @@ object Keys {
|
|||
val updateOptions = SettingKey[UpdateOptions]("update-options", "Options for resolving managed dependencies.", DSetting)
|
||||
val unresolvedWarningConfiguration = TaskKey[UnresolvedWarningConfiguration]("unresolved-warning-configuration", "Configuration for unresolved dependency warning.", DTask)
|
||||
val dependencyPositions = TaskKey[Map[ModuleID, SourcePosition]]("dependency-positions", "Source positions where the dependencies are defined.", DTask)
|
||||
val dependencyResolution = TaskKey[DependencyResolution]("dependency-resolution", "Provides the sbt interface to dependency resolution.", CTask)
|
||||
val publisher = TaskKey[Publisher]("publisher", "Provides the sbt interface to publisher")
|
||||
val ivySbt = TaskKey[IvySbt]("ivy-sbt", "Provides the sbt interface to Ivy.", CTask)
|
||||
val ivyModule = TaskKey[IvySbt#Module]("ivy-module", "Provides the sbt interface to a configured Ivy module.", CTask)
|
||||
val updateCacheName = TaskKey[String]("updateCacheName", "Defines the directory name used to store the update cache files (inside the streams cacheDirectory).", DTask)
|
||||
|
|
@ -354,14 +352,12 @@ object Keys {
|
|||
val updateClassifiers = TaskKey[UpdateReport]("update-classifiers", "Resolves and optionally retrieves classified artifacts, such as javadocs and sources, for dependency definitions, transitively.", BPlusTask, update)
|
||||
val transitiveClassifiers = SettingKey[Seq[String]]("transitive-classifiers", "List of classifiers used for transitively obtaining extra artifacts for sbt or declared dependencies.", BSetting)
|
||||
val updateSbtClassifiers = TaskKey[UpdateReport]("update-sbt-classifiers", "Resolves and optionally retrieves classifiers, such as javadocs and sources, for sbt, transitively.", BPlusTask, updateClassifiers)
|
||||
val sourceArtifactTypes = SettingKey[Set[String]]("source-artifact-types", "Ivy artifact types that correspond to source artifacts. Used by IDEs to resolve these resources.", BSetting)
|
||||
val docArtifactTypes = SettingKey[Set[String]]("doc-artifact-types", "Ivy artifact types that correspond to javadoc artifacts. Used by IDEs to resolve these resources.", BSetting)
|
||||
val sourceArtifactTypes = SettingKey[Vector[String]]("source-artifact-types", "Ivy artifact types that correspond to source artifacts. Used by IDEs to resolve these resources.", BSetting)
|
||||
val docArtifactTypes = SettingKey[Vector[String]]("doc-artifact-types", "Ivy artifact types that correspond to javadoc artifacts. Used by IDEs to resolve these resources.", BSetting)
|
||||
|
||||
val publishConfiguration = TaskKey[PublishConfiguration]("publish-configuration", "Configuration for publishing to a repository.", DTask)
|
||||
val publishLocalConfiguration = TaskKey[PublishConfiguration]("publish-local-configuration", "Configuration for publishing to the local Ivy repository.", DTask)
|
||||
val publishM2Configuration = TaskKey[PublishConfiguration]("publish-m2-configuration", "Configuration for publishing to the local Maven repository.", DTask)
|
||||
val deliverConfiguration = TaskKey[DeliverConfiguration]("deliver-configuration", "Configuration for generating the finished Ivy file for publishing.", DTask)
|
||||
val deliverLocalConfiguration = TaskKey[DeliverConfiguration]("deliver-local-configuration", "Configuration for generating the finished Ivy file for local publishing.", DTask)
|
||||
val makePomConfiguration = SettingKey[MakePomConfiguration]("make-pom-configuration", "Configuration for generating a pom.", DSetting)
|
||||
val packagedArtifacts = TaskKey[Map[Artifact, File]]("packaged-artifacts", "Packages all artifacts for publishing and maps the Artifact definition to the generated file.", CTask)
|
||||
val publishMavenStyle = SettingKey[Boolean]("publish-maven-style", "Configures whether to generate and publish a pom (true) or Ivy file (false).", BSetting)
|
||||
|
|
@ -385,13 +381,13 @@ object Keys {
|
|||
val moduleID = SettingKey[ModuleID]("module-id", "A dependency management descriptor. This is currently used for associating a ModuleID with a classpath entry.", BPlusSetting)
|
||||
val projectID = SettingKey[ModuleID]("project-id", "The dependency management descriptor for the current module.", BMinusSetting)
|
||||
val overrideBuildResolvers = SettingKey[Boolean]("override-build-resolvers", "Whether or not all the build resolvers should be overridden with what's defined from the launcher.", BMinusSetting)
|
||||
val bootResolvers = TaskKey[Option[Seq[Resolver]]]("boot-resolvers", "The resolvers used by the sbt launcher.", BMinusSetting)
|
||||
val appResolvers = SettingKey[Option[Seq[Resolver]]]("app-resolvers", "The resolvers configured for this application by the sbt launcher.", BMinusSetting)
|
||||
val externalResolvers = TaskKey[Seq[Resolver]]("external-resolvers", "The external resolvers for automatically managed dependencies.", BMinusSetting)
|
||||
val resolvers = SettingKey[Seq[Resolver]]("resolvers", "The user-defined additional resolvers for automatically managed dependencies.", BMinusTask)
|
||||
val bootResolvers = TaskKey[Option[Vector[Resolver]]]("boot-resolvers", "The resolvers used by the sbt launcher.", BMinusSetting)
|
||||
val appResolvers = SettingKey[Option[Vector[Resolver]]]("app-resolvers", "The resolvers configured for this application by the sbt launcher.", BMinusSetting)
|
||||
val externalResolvers = TaskKey[Vector[Resolver]]("external-resolvers", "The external resolvers for automatically managed dependencies.", BMinusSetting)
|
||||
val resolvers = SettingKey[Vector[Resolver]]("resolvers", "The user-defined additional resolvers for automatically managed dependencies.", BMinusTask)
|
||||
val projectResolver = TaskKey[Resolver]("project-resolver", "Resolver that handles inter-project dependencies.", DTask)
|
||||
val fullResolvers = TaskKey[Seq[Resolver]]("full-resolvers", "Combines the project resolver, default resolvers, and user-defined resolvers.", CTask)
|
||||
val otherResolvers = TaskKey[Seq[Resolver]]("other-resolvers", "Resolvers not included in the main resolver chain, such as those in module configurations.", CSetting)
|
||||
val fullResolvers = TaskKey[Vector[Resolver]]("full-resolvers", "Combines the project resolver, default resolvers, and user-defined resolvers.", CTask)
|
||||
val otherResolvers = TaskKey[Vector[Resolver]]("other-resolvers", "Resolvers not included in the main resolver chain, such as those in module configurations.", CSetting)
|
||||
val useJCenter = SettingKey[Boolean]("use-jcenter", "Use JCenter as the default repository.", BSetting)
|
||||
val moduleConfigurations = SettingKey[Seq[ModuleConfiguration]]("module-configurations", "Defines module configurations, which override resolvers on a per-module basis.", BMinusSetting)
|
||||
val retrievePattern = SettingKey[String]("retrieve-pattern", "Pattern used to retrieve managed dependencies to the current build.", DSetting)
|
||||
|
|
@ -400,12 +396,12 @@ object Keys {
|
|||
val ivyPaths = SettingKey[IvyPaths]("ivy-paths", "Configures paths used by Ivy for dependency management.", DSetting)
|
||||
val dependencyCacheDirectory = TaskKey[File]("dependency-cache-directory", "The base directory for cached dependencies.", DTask)
|
||||
val libraryDependencies = SettingKey[Seq[ModuleID]]("library-dependencies", "Declares managed dependencies.", APlusSetting)
|
||||
val dependencyOverrides = SettingKey[Set[ModuleID]]("dependency-overrides", "Declares managed dependency overrides.", BSetting)
|
||||
val excludeDependencies = SettingKey[Seq[ExclusionRule]]("exclude-dependencies", "Declares managed dependency exclusions.", BSetting)
|
||||
val dependencyOverrides = SettingKey[Vector[ModuleID]]("dependency-overrides", "Declares managed dependency overrides.", BSetting)
|
||||
val excludeDependencies = SettingKey[Seq[InclExclRule]]("exclude-dependencies", "Declares managed dependency exclusions.", BSetting)
|
||||
val allDependencies = TaskKey[Seq[ModuleID]]("all-dependencies", "Inter-project and library dependencies.", CTask)
|
||||
val projectDependencies = TaskKey[Seq[ModuleID]]("project-dependencies", "Inter-project dependencies.", DTask)
|
||||
val ivyXML = SettingKey[NodeSeq]("ivy-xml", "Defines inline Ivy XML for configuring dependency management.", BSetting)
|
||||
val ivyScala = SettingKey[Option[IvyScala]]("ivy-scala", "Configures how Scala dependencies are checked, filtered, and injected.", CSetting)
|
||||
val scalaModuleInfo = SettingKey[Option[ScalaModuleInfo]]("scala-module-info", "Configures how Scala dependencies are checked, filtered, and injected.", CSetting)
|
||||
val ivyValidate = SettingKey[Boolean]("ivy-validate", "Enables/disables Ivy validation of module metadata.", BSetting)
|
||||
val ivyLoggingLevel = SettingKey[UpdateLogging]("ivy-logging-level", "The logging level for updating.", BSetting)
|
||||
val publishTo = TaskKey[Option[Resolver]]("publish-to", "The resolver to publish to.", ASetting)
|
||||
|
|
@ -414,12 +410,12 @@ object Keys {
|
|||
val autoUpdate = SettingKey[Boolean]("auto-update", "<unimplemented>", Invisible)
|
||||
val retrieveManaged = SettingKey[Boolean]("retrieve-managed", "If true, enables retrieving dependencies to the current build. Otherwise, dependencies are used directly from the cache.", BSetting)
|
||||
val retrieveManagedSync = SettingKey[Boolean]("retrieve-managed-sync", "If true, enables synchronizing the dependencies retrieved to the current build by removed unneeded files.", BSetting)
|
||||
val configurationsToRetrieve = SettingKey[Option[Set[Configuration]]]("configurations-to-retrieve", "An optional set of configurations from which to retrieve dependencies if retrieveManaged is set to true", BSetting)
|
||||
val configurationsToRetrieve = SettingKey[Option[Vector[Configuration]]]("configurations-to-retrieve", "An optional set of configurations from which to retrieve dependencies if retrieveManaged is set to true", BSetting)
|
||||
val managedDirectory = SettingKey[File]("managed-directory", "Directory to which managed dependencies are retrieved.", BSetting)
|
||||
val classpathTypes = SettingKey[Set[String]]("classpath-types", "Artifact types that are included on the classpath.", BSetting)
|
||||
val publishArtifact = SettingKey[Boolean]("publish-artifact", "Enables (true) or disables (false) publishing an artifact.", AMinusSetting)
|
||||
val packagedArtifact = TaskKey[(Artifact, File)]("packaged-artifact", "Generates a packaged artifact, returning the Artifact and the produced File.", CTask)
|
||||
val checksums = SettingKey[Seq[String]]("checksums", "The list of checksums to generate and to verify for dependencies.", BSetting)
|
||||
val checksums = SettingKey[Vector[String]]("checksums", "The list of checksums to generate and to verify for dependencies.", BSetting)
|
||||
val forceUpdatePeriod = SettingKey[Option[FiniteDuration]]("force-update-period", "Duration after which to force a full update to occur", CSetting)
|
||||
|
||||
val classifiersModule = TaskKey[GetClassifiersModule]("classifiers-module", rank = CTask)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
*/
|
||||
package sbt
|
||||
|
||||
import sbt.librarymanagement.{ Credentials, MavenRepository, Resolver }
|
||||
import sbt.librarymanagement.{ MavenRepository, Resolver }
|
||||
import sbt.librarymanagement.ivy.Credentials
|
||||
|
||||
import java.io.File
|
||||
import java.net.URL
|
||||
|
|
@ -62,11 +63,12 @@ object DefaultOptions {
|
|||
def scaladoc(name: String, version: String): Seq[String] =
|
||||
doc.title(name) ++ doc.version(version)
|
||||
|
||||
def resolvers(snapshot: Boolean): Seq[Resolver] = {
|
||||
if (snapshot) Seq(resolver.sbtSnapshots) else Nil
|
||||
def resolvers(snapshot: Boolean): Vector[Resolver] = {
|
||||
if (snapshot) Vector(resolver.sbtSnapshots) else Vector.empty
|
||||
}
|
||||
def pluginResolvers(plugin: Boolean, snapshot: Boolean): Seq[Resolver] = {
|
||||
if (plugin && snapshot) Seq(resolver.sbtSnapshots, resolver.sbtIvySnapshots) else Nil
|
||||
def pluginResolvers(plugin: Boolean, snapshot: Boolean): Vector[Resolver] = {
|
||||
if (plugin && snapshot) Vector(resolver.sbtSnapshots, resolver.sbtIvySnapshots)
|
||||
else Vector.empty
|
||||
}
|
||||
def addResolvers: Setting[_] = Keys.resolvers ++= { resolvers(Keys.isSnapshot.value) }
|
||||
def addPluginResolvers: Setting[_] =
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import sbt.util._
|
|||
import sbt.internal.util.complete.{ DefaultParsers, Parser }, DefaultParsers._
|
||||
import xsbti.AppConfiguration
|
||||
import sbt.librarymanagement._
|
||||
import sbt.internal.librarymanagement.IvyConfiguration
|
||||
import sbt.librarymanagement.ivy.{ IvyConfiguration, IvyDependencyResolution }
|
||||
import sbt.internal.inc.classpath.ClasspathUtilities
|
||||
import BasicCommandStrings._, BasicKeys._
|
||||
|
||||
|
|
@ -25,13 +25,13 @@ private[sbt] object TemplateCommandUtil {
|
|||
val extracted = (Project extract state)
|
||||
val (s2, ivyConf) = extracted.runTask(Keys.ivyConfiguration, state)
|
||||
val globalBase = BuildPaths.getGlobalBase(state)
|
||||
val ivyScala = extracted.get(Keys.ivyScala in Keys.updateSbtClassifiers)
|
||||
val scalaModuleInfo = extracted.get(Keys.scalaModuleInfo in Keys.updateSbtClassifiers)
|
||||
val arguments = inputArg.toList ++
|
||||
(state.remainingCommands match {
|
||||
case exec :: Nil if exec.commandLine == "shell" => Nil
|
||||
case xs => xs map (_.commandLine)
|
||||
})
|
||||
run(infos, arguments, state.configuration, ivyConf, globalBase, ivyScala, log)
|
||||
run(infos, arguments, state.configuration, ivyConf, globalBase, scalaModuleInfo, log)
|
||||
"exit" :: s2.copy(remainingCommands = Nil)
|
||||
}
|
||||
|
||||
|
|
@ -41,11 +41,11 @@ private[sbt] object TemplateCommandUtil {
|
|||
config: AppConfiguration,
|
||||
ivyConf: IvyConfiguration,
|
||||
globalBase: File,
|
||||
ivyScala: Option[IvyScala],
|
||||
scalaModuleInfo: Option[ScalaModuleInfo],
|
||||
log: Logger
|
||||
): Unit =
|
||||
infos find { info =>
|
||||
val loader = infoLoader(info, config, ivyConf, globalBase, ivyScala, log)
|
||||
val loader = infoLoader(info, config, ivyConf, globalBase, scalaModuleInfo, log)
|
||||
val hit = tryTemplate(info, arguments, loader)
|
||||
if (hit) {
|
||||
runTemplate(info, arguments, loader)
|
||||
|
|
@ -75,10 +75,10 @@ private[sbt] object TemplateCommandUtil {
|
|||
config: AppConfiguration,
|
||||
ivyConf: IvyConfiguration,
|
||||
globalBase: File,
|
||||
ivyScala: Option[IvyScala],
|
||||
scalaModuleInfo: Option[ScalaModuleInfo],
|
||||
log: Logger
|
||||
): ClassLoader = {
|
||||
val cp = classpathForInfo(info, ivyConf, globalBase, ivyScala, log)
|
||||
val cp = classpathForInfo(info, ivyConf, globalBase, scalaModuleInfo, log)
|
||||
ClasspathUtilities.toLoader(cp, config.provider.loader)
|
||||
}
|
||||
|
||||
|
|
@ -103,10 +103,10 @@ private[sbt] object TemplateCommandUtil {
|
|||
info: TemplateResolverInfo,
|
||||
ivyConf: IvyConfiguration,
|
||||
globalBase: File,
|
||||
ivyScala: Option[IvyScala],
|
||||
scalaModuleInfo: Option[ScalaModuleInfo],
|
||||
log: Logger
|
||||
): List[File] = {
|
||||
val lm = new DefaultLibraryManagement(ivyConf, log)
|
||||
val lm = IvyDependencyResolution(ivyConf)
|
||||
val templatesBaseDirectory = new File(globalBase, "templates")
|
||||
val templateId = s"${info.module.organization}_${info.module.name}_${info.module.revision}"
|
||||
val templateDirectory = new File(templatesBaseDirectory, templateId)
|
||||
|
|
@ -114,8 +114,13 @@ private[sbt] object TemplateCommandUtil {
|
|||
if (!(info.module.revision endsWith "-SNAPSHOT") && jars.nonEmpty) jars.toList
|
||||
else {
|
||||
IO.createDirectory(templateDirectory)
|
||||
val m = lm.getModule(info.module.withConfigurations(Some("component")), ivyScala)
|
||||
val xs = lm.update(m, templateDirectory)(_ => true).toList.flatten
|
||||
val m = lm.moduleDescriptor(info.module.withConfigurations(Some("component")),
|
||||
Vector.empty,
|
||||
scalaModuleInfo)
|
||||
val xs = lm.retrieve(m, templateDirectory, log) match {
|
||||
case Left(_) => ??? // FIXME
|
||||
case Right(files) => files.toList
|
||||
}
|
||||
xs
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,14 +3,14 @@ package sbt.internal
|
|||
import sbt.internal.librarymanagement._
|
||||
import sbt.internal.util.Types._
|
||||
import sbt.internal.util.{ HList, HNil }
|
||||
import sbt.internal.util.HListFormats._
|
||||
import sbt.io.{ Hash, IO }
|
||||
import sbt.io.Hash
|
||||
import sbt.librarymanagement._
|
||||
import sbt.util.CacheImplicits._
|
||||
import sbt.librarymanagement.ivy._
|
||||
import sbt.util._
|
||||
import sbt.internal.util.HListFormats._
|
||||
import sjsonnew.JsonFormat
|
||||
|
||||
object AltLibraryManagementCodec extends LibraryManagementCodec {
|
||||
object AltLibraryManagementCodec extends IvyLibraryManagementCodec {
|
||||
type In0 = ModuleSettings :+: UpdateConfiguration :+: HNil
|
||||
type In = IvyConfiguration :+: In0
|
||||
|
||||
|
|
@ -37,33 +37,31 @@ object AltLibraryManagementCodec extends LibraryManagementCodec {
|
|||
SftpRepository,
|
||||
RawRepository]
|
||||
|
||||
type InlineIvyHL = (IvyPaths :+: Vector[Resolver] :+: Vector[Resolver] :+: Vector[
|
||||
type InlineIvyHL = (Option[IvyPaths] :+: Vector[Resolver] :+: Vector[Resolver] :+: Vector[
|
||||
ModuleConfiguration] :+: Vector[String] :+: Boolean :+: HNil)
|
||||
def inlineIvyToHL(i: InlineIvyConfiguration): InlineIvyHL = (
|
||||
i.paths :+: i.resolvers :+: i.otherResolvers :+: i.moduleConfigurations :+:
|
||||
i.checksums :+: i.managedChecksums :+: HNil
|
||||
)
|
||||
|
||||
type ExternalIvyHL = PlainFileInfo :+: Array[Byte] :+: HNil
|
||||
type ExternalIvyHL = Option[PlainFileInfo] :+: Array[Byte] :+: HNil
|
||||
def externalIvyToHL(e: ExternalIvyConfiguration): ExternalIvyHL =
|
||||
FileInfo.exists(e.baseDirectory) :+: Hash.contentsIfLocal(e.uri) :+: HNil
|
||||
e.baseDirectory.map(FileInfo.exists.apply) :+: e.uri
|
||||
.map(Hash.contentsIfLocal)
|
||||
.getOrElse(Array.empty) :+: HNil
|
||||
|
||||
// Redefine to use a subset of properties, that are serialisable
|
||||
override lazy implicit val InlineIvyConfigurationFormat: JsonFormat[InlineIvyConfiguration] = {
|
||||
def hlToInlineIvy(i: InlineIvyHL): InlineIvyConfiguration = {
|
||||
val (paths :+: resolvers :+: otherResolvers :+: moduleConfigurations :+: localOnly
|
||||
:+: checksums :+: HNil) = i
|
||||
InlineIvyConfiguration(None,
|
||||
IO.createTemporaryDirectory,
|
||||
NullLogger,
|
||||
UpdateOptions(),
|
||||
paths,
|
||||
resolvers,
|
||||
otherResolvers,
|
||||
moduleConfigurations,
|
||||
localOnly,
|
||||
checksums,
|
||||
None)
|
||||
val (paths :+: resolvers :+: otherResolvers :+: moduleConfigurations :+: checksums
|
||||
:+: managedChecksums :+: HNil) = i
|
||||
InlineIvyConfiguration()
|
||||
.withPaths(paths)
|
||||
.withResolvers(resolvers)
|
||||
.withOtherResolvers(otherResolvers)
|
||||
.withModuleConfigurations(moduleConfigurations)
|
||||
.withManagedChecksums(managedChecksums)
|
||||
.withChecksums(checksums)
|
||||
}
|
||||
|
||||
projectFormat[InlineIvyConfiguration, InlineIvyHL](inlineIvyToHL, hlToInlineIvy)
|
||||
|
|
@ -76,11 +74,12 @@ object AltLibraryManagementCodec extends LibraryManagementCodec {
|
|||
val baseDirectory :+: _ /* uri */ :+: HNil = e
|
||||
ExternalIvyConfiguration(
|
||||
None,
|
||||
baseDirectory.file,
|
||||
NullLogger,
|
||||
Some(NullLogger),
|
||||
UpdateOptions(),
|
||||
IO.createTemporaryDirectory.toURI /* the original uri is destroyed.. */,
|
||||
Vector.empty)
|
||||
baseDirectory.map(_.file),
|
||||
None /* the original uri is destroyed.. */,
|
||||
Vector.empty
|
||||
)
|
||||
}
|
||||
|
||||
projectFormat[ExternalIvyConfiguration, ExternalIvyHL](externalIvyToHL, hlToExternalIvy)
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ object ConsoleProject {
|
|||
val cpImports = new Imports(extracted, state)
|
||||
val bindings = ("currentState" -> state) :: ("extracted" -> extracted) :: ("cpHelpers" -> cpImports) :: Nil
|
||||
val unit = extracted.currentUnit
|
||||
val (_, ivyConf) = extracted.runTask(Keys.ivyConfiguration, state)
|
||||
val (_, dependencyResolution) = extracted.runTask(Keys.dependencyResolution, state)
|
||||
val scalaInstance = {
|
||||
val scalaProvider = state.configuration.provider.scalaProvider
|
||||
ScalaInstance(scalaProvider.version, scalaProvider.launcher)
|
||||
|
|
@ -30,7 +30,7 @@ object ConsoleProject {
|
|||
globalLock = launcher.globalLock,
|
||||
componentProvider = app.provider.components,
|
||||
secondaryCacheDir = Option(zincDir),
|
||||
ivyConfiguration = ivyConf,
|
||||
dependencyResolution = dependencyResolution,
|
||||
compilerBridgeSource = extracted.get(Keys.scalaCompilerBridgeSource),
|
||||
scalaJarsTarget = zincDir,
|
||||
log = log
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ object GlobalPlugin {
|
|||
final case class GlobalPluginData(projectID: ModuleID,
|
||||
dependencies: Seq[ModuleID],
|
||||
descriptors: Map[ModuleRevisionId, ModuleDescriptor],
|
||||
resolvers: Seq[Resolver],
|
||||
resolvers: Vector[Resolver],
|
||||
fullClasspath: Classpath,
|
||||
internalClasspath: Classpath)(val updateReport: UpdateReport)
|
||||
final case class GlobalPlugin(data: GlobalPluginData,
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ object IvyConsole {
|
|||
|
||||
val depSettings: Seq[Setting[_]] = Seq(
|
||||
libraryDependencies ++= managed.reverse,
|
||||
resolvers ++= repos.reverse,
|
||||
resolvers ++= repos.reverse.toVector,
|
||||
unmanagedJars in Compile ++= Attributed blankSeq unmanaged.reverse,
|
||||
logLevel in Global := Level.Warn,
|
||||
showSuccess in Global := false
|
||||
|
|
|
|||
|
|
@ -7,8 +7,9 @@ import sbt.internal.util.HNil
|
|||
import sbt.internal.util.Types._
|
||||
import sbt.internal.util.HListFormats._
|
||||
import sbt.librarymanagement._
|
||||
import sbt.librarymanagement.ivy._
|
||||
import sbt.librarymanagement.syntax._
|
||||
import sbt.util.CacheImplicits._
|
||||
import sbt.internal.util.HListFormats._
|
||||
import sbt.util.{ CacheStore, CacheStoreFactory, Logger, Tracked }
|
||||
|
||||
object LibraryManagement {
|
||||
|
|
@ -40,7 +41,7 @@ object LibraryManagement {
|
|||
log.info(s"Updating $label...")
|
||||
val reportOrUnresolved: Either[UnresolvedWarning, UpdateReport] =
|
||||
//try {
|
||||
IvyActions.updateEither(module, updateConfig, uwConfig, logicalClock, depDir, log)
|
||||
IvyActions.updateEither(module, updateConfig, uwConfig, /*logicalClock, depDir,*/ log)
|
||||
// } catch {
|
||||
// case e: Throwable =>
|
||||
// e.printStackTrace
|
||||
|
|
|
|||
|
|
@ -31,13 +31,13 @@ import Keys.{
|
|||
}
|
||||
import Project.inScope
|
||||
import sbt.internal.inc.classpath.ClasspathUtilities
|
||||
import sbt.internal.librarymanagement.{ InlineIvyConfiguration, IvyPaths }
|
||||
import sbt.librarymanagement.ivy.{ InlineIvyConfiguration, IvyDependencyResolution, IvyPaths }
|
||||
import sbt.internal.inc.{ ZincUtil, ScalaInstance }
|
||||
import sbt.internal.util.Attributed.data
|
||||
import sbt.internal.util.Types.const
|
||||
import sbt.internal.util.{ Attributed, Settings, ~> }
|
||||
import sbt.io.{ GlobFilter, IO, Path }
|
||||
import sbt.librarymanagement.{ Configuration, Configurations, Resolver, UpdateOptions }
|
||||
import sbt.librarymanagement.{ Configuration, Configurations, Resolver }
|
||||
import sbt.util.{ Show, Logger }
|
||||
import scala.annotation.tailrec
|
||||
import scala.tools.nsc.reporters.ConsoleReporter
|
||||
|
|
@ -79,18 +79,12 @@ private[sbt] object Load {
|
|||
val stagingDirectory = getStagingDirectory(state, globalBase).getCanonicalFile
|
||||
val loader = getClass.getClassLoader
|
||||
val classpath = Attributed.blankSeq(provider.mainClasspath ++ scalaProvider.jars)
|
||||
val ivyConfiguration = new InlineIvyConfiguration(
|
||||
paths = IvyPaths(baseDirectory, bootIvyHome(state.configuration)),
|
||||
resolvers = Resolver.withDefaultResolvers(Nil).toVector,
|
||||
otherResolvers = Vector.empty,
|
||||
moduleConfigurations = Vector.empty,
|
||||
lock = None,
|
||||
checksums = Vector.empty,
|
||||
managedChecksums = false,
|
||||
resolutionCacheDir = None,
|
||||
updateOptions = UpdateOptions(),
|
||||
log = log
|
||||
)
|
||||
val ivyConfiguration =
|
||||
InlineIvyConfiguration()
|
||||
.withPaths(IvyPaths(baseDirectory, bootIvyHome(state.configuration)))
|
||||
.withResolvers(Resolver.combineDefaultResolvers(Vector.empty))
|
||||
.withLog(log)
|
||||
val dependencyResolution = IvyDependencyResolution(ivyConfiguration)
|
||||
val si = ScalaInstance(scalaProvider.version, scalaProvider.launcher)
|
||||
val zincDir = BuildPaths.getZincDirectory(state, globalBase)
|
||||
val classpathOptions = ClasspathOptionsUtil.boot
|
||||
|
|
@ -100,7 +94,7 @@ private[sbt] object Load {
|
|||
globalLock = launcher.globalLock,
|
||||
componentProvider = app.provider.components,
|
||||
secondaryCacheDir = Option(zincDir),
|
||||
ivyConfiguration = ivyConfiguration,
|
||||
dependencyResolution = dependencyResolution,
|
||||
compilerBridgeSource = ZincUtil.getDefaultBridgeModule(scalaProvider.version),
|
||||
scalaJarsTarget = zincDir,
|
||||
log = log
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ final case class PluginManagement(overrides: Set[ModuleID],
|
|||
addOverrides(extractOverrides(cp))
|
||||
|
||||
def inject: Seq[Setting[_]] = Seq(
|
||||
Keys.dependencyOverrides ++= overrides
|
||||
Keys.dependencyOverrides ++= overrides.toVector
|
||||
)
|
||||
|
||||
def resetDepth: PluginManagement =
|
||||
|
|
|
|||
|
|
@ -7,5 +7,5 @@ import sbt.librarymanagement.RawRepository
|
|||
|
||||
object FakeRawRepository {
|
||||
def create(name: String): RawRepository =
|
||||
new RawRepository(new FakeResolver(name, IO.createTemporaryDirectory, Map.empty))
|
||||
new RawRepository(new FakeResolver(name, IO.createTemporaryDirectory, Map.empty), name)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,8 @@ object Dependencies {
|
|||
private val utilTracking = "org.scala-sbt" %% "util-tracking" % utilVersion
|
||||
private val utilScripted = "org.scala-sbt" %% "util-scripted" % utilVersion
|
||||
|
||||
private val libraryManagement = "org.scala-sbt" %% "librarymanagement" % lmVersion
|
||||
private val libraryManagementCore = "org.scala-sbt" %% "librarymanagement-core" % lmVersion
|
||||
private val libraryManagementIvy = "org.scala-sbt" %% "librarymanagement-ivy" % lmVersion
|
||||
|
||||
val launcherInterface = "org.scala-sbt" % "launcher-interface" % "1.0.0"
|
||||
val rawLauncher = "org.scala-sbt" % "launcher" % "1.0.0"
|
||||
|
|
@ -77,7 +78,8 @@ object Dependencies {
|
|||
def addSbtUtilScripted(p: Project): Project =
|
||||
addSbtModule(p, sbtUtilPath, "utilScripted", utilScripted)
|
||||
|
||||
def addSbtLm(p: Project): Project = addSbtModule(p, sbtLmPath, "lm", libraryManagement)
|
||||
def addSbtLmCore(p: Project): Project = addSbtModule(p, sbtLmPath, "lmCore", libraryManagementCore)
|
||||
def addSbtLmIvy(p: Project): Project = addSbtModule(p, sbtLmPath, "lmIvy", libraryManagementIvy)
|
||||
|
||||
def addSbtCompilerInterface(p: Project): Project =
|
||||
addSbtModule(p, sbtZincPath, "compilerInterface", compilerInterface)
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ trait Import {
|
|||
type URI = java.net.URI
|
||||
type URL = java.net.URL
|
||||
|
||||
implicit def Seq2Vector[T](s: Seq[T]): Vector[T] = s.toVector
|
||||
|
||||
// sbt
|
||||
val StdoutOutput = sbt.OutputStrategy.StdoutOutput
|
||||
type BufferedOutput = sbt.OutputStrategy.BufferedOutput
|
||||
|
|
@ -225,8 +227,8 @@ trait Import {
|
|||
type Caller = sbt.librarymanagement.Caller
|
||||
val ChainedResolver = sbt.librarymanagement.ChainedResolver
|
||||
type ChainedResolver = sbt.librarymanagement.ChainedResolver
|
||||
val CircularDependencyLevel = sbt.librarymanagement.CircularDependencyLevel
|
||||
type CircularDependencyLevel = sbt.librarymanagement.CircularDependencyLevel
|
||||
val CircularDependencyLevel = sbt.librarymanagement.ivy.CircularDependencyLevel
|
||||
type CircularDependencyLevel = sbt.librarymanagement.ivy.CircularDependencyLevel
|
||||
val Configuration = sbt.librarymanagement.Configuration
|
||||
type Configuration = sbt.librarymanagement.Configuration
|
||||
val ConfigurationReport = sbt.librarymanagement.ConfigurationReport
|
||||
|
|
@ -236,33 +238,34 @@ trait Import {
|
|||
type ConflictManager = sbt.librarymanagement.ConflictManager
|
||||
val ConflictWarning = sbt.librarymanagement.ConflictWarning
|
||||
type ConflictWarning = sbt.librarymanagement.ConflictWarning
|
||||
val Credentials = sbt.librarymanagement.Credentials
|
||||
type Credentials = sbt.librarymanagement.Credentials
|
||||
val Credentials = sbt.librarymanagement.ivy.Credentials
|
||||
type Credentials = sbt.librarymanagement.ivy.Credentials
|
||||
val CrossVersion = sbt.librarymanagement.CrossVersion
|
||||
type CrossVersion = sbt.librarymanagement.CrossVersion
|
||||
val DefaultMavenRepository = sbt.librarymanagement.DefaultMavenRepository
|
||||
val DefaultMavenRepository = sbt.librarymanagement.Resolver.DefaultMavenRepository
|
||||
val Developer = sbt.librarymanagement.Developer
|
||||
type Developer = sbt.librarymanagement.Developer
|
||||
val Disabled = sbt.librarymanagement.Disabled
|
||||
type Disabled = sbt.librarymanagement.Disabled
|
||||
type DirectCredentials = sbt.librarymanagement.DirectCredentials
|
||||
type DirectCredentials = sbt.librarymanagement.ivy.DirectCredentials
|
||||
val EvictionPair = sbt.librarymanagement.EvictionPair
|
||||
type EvictionPair = sbt.librarymanagement.EvictionPair
|
||||
val EvictionWarning = sbt.librarymanagement.EvictionWarning
|
||||
type EvictionWarning = sbt.librarymanagement.EvictionWarning
|
||||
val EvictionWarningOptions = sbt.librarymanagement.EvictionWarningOptions
|
||||
type EvictionWarningOptions = sbt.librarymanagement.EvictionWarningOptions
|
||||
val ExclusionRule = sbt.librarymanagement.ExclusionRule
|
||||
type ExclusionRule = sbt.librarymanagement.ExclusionRule
|
||||
type FileCredentials = sbt.librarymanagement.FileCredentials
|
||||
// val ExclusionRule = sbt.librarymanagement.InclExclRule
|
||||
// type ExclusionRule = sbt.librarymanagement.InclExclRule
|
||||
type FileCredentials = sbt.librarymanagement.ivy.FileCredentials
|
||||
val FileRepository = sbt.librarymanagement.FileRepository
|
||||
type FileRepository = sbt.librarymanagement.FileRepository
|
||||
val Full = sbt.librarymanagement.Full
|
||||
type Full = sbt.librarymanagement.Full
|
||||
val IvyScala = sbt.librarymanagement.IvyScala
|
||||
type IvyScala = sbt.librarymanagement.IvyScala
|
||||
val JCenterRepository = sbt.librarymanagement.JCenterRepository
|
||||
val JavaNet2Repository = sbt.librarymanagement.JavaNet2Repository
|
||||
val IvyScala = sbt.librarymanagement.ScalaModuleInfo
|
||||
type IvyScala = sbt.librarymanagement.ScalaModuleInfo
|
||||
val JCenterRepository = sbt.librarymanagement.Resolver.JCenterRepository
|
||||
val JavaNet2Repository = sbt.librarymanagement.Resolver.JavaNet2Repository
|
||||
type MakePomConfiguration = sbt.librarymanagement.MakePomConfiguration
|
||||
val MavenCache = sbt.librarymanagement.MavenCache
|
||||
type MavenCache = sbt.librarymanagement.MavenCache
|
||||
val MavenRepo = sbt.librarymanagement.MavenRepo
|
||||
|
|
@ -301,8 +304,8 @@ trait Import {
|
|||
val URLRepository = sbt.librarymanagement.URLRepository
|
||||
type URLRepository = sbt.librarymanagement.URLRepository
|
||||
val UpdateLogging = sbt.librarymanagement.UpdateLogging
|
||||
val UpdateOptions = sbt.librarymanagement.UpdateOptions
|
||||
type UpdateOptions = sbt.librarymanagement.UpdateOptions
|
||||
val UpdateOptions = sbt.librarymanagement.ivy.UpdateOptions
|
||||
type UpdateOptions = sbt.librarymanagement.ivy.UpdateOptions
|
||||
val UpdateReport = sbt.librarymanagement.UpdateReport
|
||||
type UpdateReport = sbt.librarymanagement.UpdateReport
|
||||
val UpdateStats = sbt.librarymanagement.UpdateStats
|
||||
|
|
@ -312,8 +315,8 @@ trait Import {
|
|||
type VersionNumberCompatibility = sbt.librarymanagement.VersionNumberCompatibility
|
||||
|
||||
// sbt.internal.librarymanagement
|
||||
type IvyPaths = sbt.internal.librarymanagement.IvyPaths
|
||||
val IvyPaths = sbt.internal.librarymanagement.IvyPaths
|
||||
type IvyPaths = sbt.librarymanagement.ivy.IvyPaths
|
||||
val IvyPaths = sbt.librarymanagement.ivy.IvyPaths
|
||||
|
||||
type IncOptions = xsbti.compile.IncOptions
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import scala.language.experimental.macros
|
||||
|
||||
/* sbt -- Simple Build Tool
|
||||
* Copyright 2010, 2011 Mark Harrah
|
||||
*/
|
||||
|
|
@ -5,8 +7,8 @@ package object sbt
|
|||
extends sbt.IOSyntax0
|
||||
with sbt.std.TaskExtra
|
||||
with sbt.internal.util.Types
|
||||
with sbt.internal.librarymanagement.impl.DependencyBuilders
|
||||
with sbt.ProjectExtra
|
||||
with sbt.librarymanagement.DependencyBuilders
|
||||
with sbt.librarymanagement.DependencyFilterExtra
|
||||
with sbt.librarymanagement.LibraryManagementSyntax
|
||||
with sbt.BuildExtra
|
||||
|
|
@ -36,15 +38,16 @@ package object sbt
|
|||
final val Global = Scope.Global
|
||||
final val GlobalScope = Scope.GlobalScope
|
||||
|
||||
import sbt.{ Configurations => C }
|
||||
final val Compile = C.Compile
|
||||
final val Test = C.Test
|
||||
final val Runtime = C.Runtime
|
||||
final val IntegrationTest = C.IntegrationTest
|
||||
final val Default = C.Default
|
||||
final val Provided = C.Provided
|
||||
// import sbt.{ Configurations => C }
|
||||
// final val Compile = C.Compile
|
||||
// final val Test = C.Test
|
||||
// final val Runtime = C.Runtime
|
||||
// final val IntegrationTest = C.IntegrationTest
|
||||
// final val Default = C.Default
|
||||
// final val Provided = C.Provided
|
||||
// java.lang.System is more important, so don't alias this one
|
||||
// final val System = C.System
|
||||
final val Optional = C.Optional
|
||||
def config(s: String): Configuration = C.config(s)
|
||||
// final val Optional = C.Optional
|
||||
def config(name: String): Configuration =
|
||||
macro sbt.librarymanagement.ConfigurationMacro.configMacroImpl
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ val b = project
|
|||
localCache,
|
||||
scalaVersion := "2.11.8",
|
||||
libraryDependencies += "org.example" %% "artifacta" % "1.0.0-SNAPSHOT" withSources() classifier("tests"),
|
||||
externalResolvers := Seq(
|
||||
externalResolvers := Vector(
|
||||
MavenCache("demo", ((baseDirectory in ThisBuild).value / "demo-repo")),
|
||||
DefaultMavenRepository
|
||||
)
|
||||
|
|
|
|||
|
|
@ -18,8 +18,9 @@ lazy val root = (project in file("."))
|
|||
val module = ivyModule.value
|
||||
val config = updateConfiguration.value
|
||||
|
||||
import sbt.internal.librarymanagement.IvyConfiguration
|
||||
import sbt.librarymanagement.ivy.IvyConfiguration
|
||||
import sbt.librarymanagement.{ ModuleSettings, UpdateConfiguration }
|
||||
import sbt.internal.util.HListFormats._
|
||||
|
||||
type In = IvyConfiguration :+: ModuleSettings :+: UpdateConfiguration :+: HNil
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
configurationsToRetrieve := Some(Set(Compile))
|
||||
configurationsToRetrieve := Some(Vector(Compile))
|
||||
|
||||
retrieveManaged := true
|
||||
|
||||
|
|
@ -8,4 +8,4 @@ autoScalaLibrary := false
|
|||
|
||||
managedDirectory := file("dependencies")
|
||||
|
||||
retrievePattern := "[conf]/[artifact]-[revision](-[classifier]).[ext]"
|
||||
retrievePattern := "[conf]/[artifact]-[revision](-[classifier]).[ext]"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import scala.xml.{ Node, _ }
|
||||
import scala.xml.Utility.trim
|
||||
import sbt.internal.librarymanagement.{ IvySbt, MakePomConfiguration, MakePom }
|
||||
import sbt.librarymanagement.MakePomConfiguration
|
||||
import sbt.internal.librarymanagement.{ IvySbt, MakePom }
|
||||
|
||||
lazy val check = taskKey[Unit]("check")
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ lazy val root = (project in file(".")).
|
|||
settings(
|
||||
libraryDependencies ++= baseDirectory(dependencies).value,
|
||||
scalaVersion := "2.9.2",
|
||||
ivyScala := ivyScala.value map (_.withOverrideScalaVersion(sbtPlugin.value)),
|
||||
scalaModuleInfo := scalaModuleInfo.value map (_.withOverrideScalaVersion(sbtPlugin.value)),
|
||||
autoScalaLibrary := baseDirectory(base => !(base / "noscala").exists ).value,
|
||||
scalaOverride := check("scala.App").value
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
lazy val check = taskKey[Unit]("tests update")
|
||||
|
||||
def commonSettings: Seq[Def.Setting[_]] = Seq(
|
||||
resolvers ++= Resolver.typesafeIvyRepo("releases") :: Resolver.typesafeRepo("releases") :: Resolver.sbtPluginRepo("releases") :: Nil,
|
||||
resolvers ++= Vector(Resolver.typesafeIvyRepo("releases"), Resolver.typesafeRepo("releases"), Resolver.sbtPluginRepo("releases")),
|
||||
check := {
|
||||
val ur = update.value
|
||||
import sbinary._, Operations._, DefaultProtocol._
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
lazy val commonSettings = Seq(
|
||||
autoScalaLibrary := false,
|
||||
ivyScala := None,
|
||||
scalaModuleInfo := None,
|
||||
unmanagedJars in Compile ++= (scalaInstance map (_.allJars.toSeq)).value,
|
||||
publishArtifact in packageSrc := false,
|
||||
publishArtifact in packageDoc := false,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,10 @@ lazy val root = (project in file(".")) settings (
|
|||
TaskKey[Unit]("checkExtra") := checkExtra.value,
|
||||
TaskKey[Unit]("checkVersionPlusMapping") := checkVersionPlusMapping.value,
|
||||
resolvers += Resolver.sonatypeRepo("snapshots"),
|
||||
makePomConfiguration ~= { _.copy(extra = <extra-tag/>) },
|
||||
makePomConfiguration := {
|
||||
val p = makePomConfiguration.value
|
||||
new MakePomConfiguration(p.file, p.moduleInfo, p.configurations, <extra-tag/>, p.process, p.filterRepositories, p.allRepositories, p.includeTypes)
|
||||
},
|
||||
libraryDependencies += "com.google.code.findbugs" % "jsr305" % "1.3.+"
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@ autoScalaLibrary := false
|
|||
|
||||
ivyPaths := IvyPaths(baseDirectory.value, Some(target.value / "ivy-cache"))
|
||||
|
||||
ivyScala := Some(IvyScala(
|
||||
scalaModuleInfo := Some(sbt.librarymanagement.ScalaModuleInfo(
|
||||
(scalaVersion in update).value,
|
||||
(scalaBinaryVersion in update).value,
|
||||
Vector.empty,
|
||||
filterImplicit = false,
|
||||
checkExplicit = false,
|
||||
filterImplicit = false,
|
||||
overrideScalaVersion = false
|
||||
))
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
> 'set libraryDependencies := Seq("junit" % "junit" % "3.8.1" % "test")'
|
||||
> check 3.8.1
|
||||
> 'set dependencyOverrides := Set("junit" % "junit" % "4.5")'
|
||||
> 'set dependencyOverrides := Vector("junit" % "junit" % "4.5")'
|
||||
> check 4.5
|
||||
|
||||
> 'set libraryDependencies := Seq("junit" % "junit" % "4.5" % "test")'
|
||||
> check 4.5
|
||||
> 'set dependencyOverrides := Set("junit" % "junit" % "3.8.1")'
|
||||
> 'set dependencyOverrides := Vector("junit" % "junit" % "3.8.1")'
|
||||
> check 3.8.1
|
||||
|
||||
> 'set libraryDependencies := Seq("net.databinder" %% "dispatch-http" % "0.8.7")'
|
||||
> check 0.8.7
|
||||
> 'set dependencyOverrides := Set("net.databinder" %% "dispatch-http" % "0.8.6")'
|
||||
> 'set dependencyOverrides := Vector("net.databinder" %% "dispatch-http" % "0.8.6")'
|
||||
> check 0.8.6
|
||||
|
||||
> 'set libraryDependencies := Seq("net.databinder" %% "dispatch-http" % "0.8.6")'
|
||||
> check 0.8.6
|
||||
> 'set dependencyOverrides := Set("net.databinder" %% "dispatch-http" % "0.8.7")'
|
||||
> 'set dependencyOverrides := Vector("net.databinder" %% "dispatch-http" % "0.8.7")'
|
||||
> check 0.8.7
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ scalaBinaryVersion := "2.9.1"
|
|||
|
||||
resolvers += Classpaths.typesafeReleases
|
||||
|
||||
dependencyOverrides := Set("com.typesafe.sbtscalariform" % "sbtscalariform" % "0.3.1")
|
||||
dependencyOverrides := Vector("com.typesafe.sbtscalariform" % "sbtscalariform" % "0.3.1")
|
||||
|
||||
autoScalaLibrary := false
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
lazy val custom = config("custom")
|
||||
lazy val custom = config("custom") //Configurations.config("custom")
|
||||
|
||||
lazy val root = (project in file(".")).
|
||||
configs(custom).
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
def configIvyScala =
|
||||
ivyScala ~= (_ map (_ withCheckExplicit false))
|
||||
scalaModuleInfo ~= (_ map (_ withCheckExplicit false))
|
||||
|
||||
val declared = SettingKey[Boolean]("declared")
|
||||
lazy val a = project.
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ object ScriptedPlugin extends AutoPlugin {
|
|||
override def requires = plugins.JvmPlugin
|
||||
override def trigger = allRequirements
|
||||
object autoImport {
|
||||
def scriptedConf = config("scripted-sbt") hide
|
||||
def scriptedLaunchConf = config("scripted-sbt-launch") hide
|
||||
val ScriptedConf = Configurations.config("scripted-sbt") hide
|
||||
val ScriptedLaunchConf = Configurations.config("scripted-sbt-launch") hide
|
||||
val scriptedSbt = SettingKey[String]("scripted-sbt")
|
||||
val sbtLauncher = TaskKey[File]("sbt-launcher")
|
||||
val sbtTestDirectory = SettingKey[File]("sbt-test-directory")
|
||||
|
|
@ -32,26 +32,26 @@ object ScriptedPlugin extends AutoPlugin {
|
|||
}
|
||||
import autoImport._
|
||||
override lazy val projectSettings = Seq(
|
||||
ivyConfigurations ++= Seq(scriptedConf, scriptedLaunchConf),
|
||||
ivyConfigurations ++= Seq(ScriptedConf, ScriptedLaunchConf),
|
||||
scriptedSbt := (sbtVersion in pluginCrossBuild).value,
|
||||
sbtLauncher := getJars(scriptedLaunchConf).map(_.get.head).value,
|
||||
sbtLauncher := getJars(ScriptedLaunchConf).map(_.get.head).value,
|
||||
sbtTestDirectory := sourceDirectory.value / "sbt-test",
|
||||
libraryDependencies ++= {
|
||||
binarySbtVersion(scriptedSbt.value) match {
|
||||
case "0.13" =>
|
||||
Seq(
|
||||
"org.scala-sbt" % "scripted-sbt" % scriptedSbt.value % scriptedConf.toString,
|
||||
"org.scala-sbt" % "sbt-launch" % scriptedSbt.value % scriptedLaunchConf.toString
|
||||
"org.scala-sbt" % "scripted-sbt" % scriptedSbt.value % ScriptedConf.toString,
|
||||
"org.scala-sbt" % "sbt-launch" % scriptedSbt.value % ScriptedLaunchConf.toString
|
||||
)
|
||||
case sv if sv startsWith "1.0." =>
|
||||
Seq(
|
||||
"org.scala-sbt" %% "scripted-sbt" % scriptedSbt.value % scriptedConf.toString,
|
||||
"org.scala-sbt" % "sbt-launch" % scriptedSbt.value % scriptedLaunchConf.toString
|
||||
"org.scala-sbt" %% "scripted-sbt" % scriptedSbt.value % ScriptedConf.toString,
|
||||
"org.scala-sbt" % "sbt-launch" % scriptedSbt.value % ScriptedLaunchConf.toString
|
||||
)
|
||||
}
|
||||
},
|
||||
scriptedBufferLog := true,
|
||||
scriptedClasspath := getJars(scriptedConf).value,
|
||||
scriptedClasspath := getJars(ScriptedConf).value,
|
||||
scriptedTests := scriptedTestsTask.value,
|
||||
scriptedRun := scriptedRunTask.value,
|
||||
scriptedDependencies := {
|
||||
|
|
|
|||
Loading…
Reference in New Issue