mirror of https://github.com/sbt/sbt.git
[2.x] refactor: Gate Ivy-specific tasks behind useIvy
**Problem** Several tasks (makePom, makeMavenPomOfSbtPlugin, deliverTask, publisher, publishOrSkip, depMap, GlobalPlugin dependency mapping) unconditionally depend on Ivy infrastructure, preventing ivyless operation. **Solution** Add useIvy guards to each task: - makePom and makeMavenPomOfSbtPlugin: error when useIvy=false - deliverTask: error when useIvy=false - publisher: error when useIvy=false - publishOrSkip: error when useIvy=false - depMap: return empty map when useIvy=false - GlobalPlugin.extract: skip ivyModule.dependencyMapping when useIvy=false Generated-by: Claude claude-opus-4-6
This commit is contained in:
parent
8746f5b291
commit
e7882b9cd0
|
|
@ -3724,6 +3724,7 @@ object Classpaths {
|
|||
def deliverTask(config: TaskKey[PublishConfiguration]): Initialize[Task[File]] =
|
||||
Def.task {
|
||||
Def.unit(update.value)
|
||||
if !useIvy.value then sys.error("deliver/makeIvyXml requires useIvy := true")
|
||||
IvyActions.deliver(ivyModule.value, config.value, streams.value.log)
|
||||
}
|
||||
|
||||
|
|
@ -3755,6 +3756,10 @@ object Classpaths {
|
|||
val log = streams.value.log
|
||||
val ref = thisProjectRef.value
|
||||
logSkipPublish(log, ref)
|
||||
} else if (!useIvy.value) {
|
||||
sys.error(
|
||||
"publishOrSkip requires useIvy := true. Use publish/publishLocal for ivyless publishing."
|
||||
)
|
||||
} else {
|
||||
val conf = config.value
|
||||
val log = streams.value.log
|
||||
|
|
@ -4212,10 +4217,10 @@ object Classpaths {
|
|||
|
||||
private[sbt] def depMap: Initialize[Task[Map[ModuleRevisionId, ModuleDescriptor]]] =
|
||||
import sbt.TupleSyntax.*
|
||||
(buildDependencies.toTaskable, thisProjectRef.toTaskable, settingsData, streams).flatMapN {
|
||||
(bd, thisProj, data, s) =>
|
||||
(buildDependencies.toTaskable, thisProjectRef.toTaskable, settingsData, streams)
|
||||
.flatMapN { (bd, thisProj, data, s) =>
|
||||
depMap(bd.classpathTransitiveRefs(thisProj), data, s.log)
|
||||
}
|
||||
}
|
||||
|
||||
private[sbt] def depMap(
|
||||
projects: Seq[ProjectRef],
|
||||
|
|
|
|||
|
|
@ -79,7 +79,9 @@ object GlobalPlugin {
|
|||
val taskInit = Def.task {
|
||||
val intcp = (Runtime / internalDependencyClasspath).value
|
||||
val prods = (Runtime / exportedProducts).value
|
||||
val depMap = projectDescriptors.value + ivyModule.value.dependencyMapping(state.log)
|
||||
val depMap =
|
||||
if useIvy.value then projectDescriptors.value + ivyModule.value.dependencyMapping(state.log)
|
||||
else projectDescriptors.value
|
||||
|
||||
GlobalPluginData(
|
||||
projectID.value,
|
||||
|
|
|
|||
Loading…
Reference in New Issue