|
| 1 | +package sbt |
| 2 | +package sbtpgp |
| 3 | + |
| 4 | +import sbt.{ librarymanagement => lm } |
| 5 | +import sbt.internal.{ librarymanagement => ilm } |
| 6 | + |
| 7 | +object Compat { |
| 8 | + val IvyActions = ilm.IvyActions |
| 9 | + type PublishConfiguration = ilm.PublishConfiguration |
| 10 | + type IvySbt = ilm.IvySbt |
| 11 | + type IvyScala = lm.IvyScala |
| 12 | + type UpdateConfiguration = lm.UpdateConfiguration |
| 13 | + type InlineConfiguration = ilm.InlineConfiguration |
| 14 | + val InlineConfiguration = ilm.InlineConfiguration |
| 15 | + val defaultProgress = EvaluateTask.defaultProgress |
| 16 | + type InteractionService = sbt.sbtpgp.InteractionService |
| 17 | + |
| 18 | + def pgpRequires: Plugins = sbt.plugins.IvyPlugin |
| 19 | + |
| 20 | + val interactionService = taskKey[InteractionService]("Service used to ask for user input through the current user interface(s).") |
| 21 | + |
| 22 | + def compatSettings: Vector[Def.Setting[_]] = |
| 23 | + Vector( |
| 24 | + interactionService := defaultInteraction |
| 25 | + ) |
| 26 | + |
| 27 | + def subConfiguration(m: ModuleID, confs: Boolean): ModuleID = |
| 28 | + m.withConfigurations( |
| 29 | + if (confs) m.configurations |
| 30 | + else None |
| 31 | + ) |
| 32 | + |
| 33 | + def subExplicitArtifacts(m: ModuleID, artifacts: Vector[Artifact]): ModuleID = |
| 34 | + m.withExplicitArtifacts(artifacts) |
| 35 | + |
| 36 | + def subExtension(art: Artifact, ext: String): Artifact = |
| 37 | + art.withExtension(ext) |
| 38 | + |
| 39 | + def subMissingOk(c: UpdateConfiguration, ok: Boolean): UpdateConfiguration = |
| 40 | + c.withMissingOk(ok) |
| 41 | + |
| 42 | + def mkInlineConfiguration(base: ModuleID, deps: Vector[ModuleID], |
| 43 | + ivyScala: Option[IvyScala], confs: Vector[Configuration]): InlineConfiguration = |
| 44 | + InlineConfiguration(false, None, base, ModuleInfo(base.name), deps) |
| 45 | + .withIvyScala(ivyScala) |
| 46 | + .withConfigurations(confs) |
| 47 | + |
| 48 | + private lazy val commandLineUIServices: InteractionService = new CommandLineUIServices |
| 49 | + def defaultInteraction: InteractionService = commandLineUIServices |
| 50 | +} |
0 commit comments