From 6a36ce7689fb326235e96bb52b034e73e621d273 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Mon, 29 Apr 2019 23:11:01 -0400 Subject: [PATCH] applying Scalafmt 2.0.0-RC6 with sbt/sbt rules --- .../AbstractEngineSpec.scala | 8 +- .../SemanticSelectorExtra.scala | 12 +- .../formats/NodeSeqFormat.scala | 2 +- .../ConfigurationExtra.scala | 17 +- .../ConfigurationFormats.scala | 20 ++- .../sbt/librarymanagement/CrossVersion.scala | 52 +++--- .../DependencyResolution.scala | 42 +++-- .../librarymanagement/EvictionWarning.scala | 8 +- .../LibraryManagementInterface.scala | 10 +- .../sbt/librarymanagement/Publisher.scala | 8 +- .../sbt/librarymanagement/ResolverExtra.scala | 6 +- .../librarymanagement/RichUpdateReport.scala | 14 +- .../librarymanagement/UpdateReportExtra.scala | 16 +- core/src/test/scala/ConfigMacroSpec.scala | 2 +- .../sbt/librarymanagement/ResolverTest.scala | 13 +- .../librarymanagement/ComponentManager.scala | 10 +- .../librarymanagement/ConvertResolver.scala | 8 +- .../librarymanagement/FakeResolver.scala | 5 +- .../sbt/internal/librarymanagement/Ivy.scala | 50 +++--- .../librarymanagement/IvyActions.scala | 26 ++- .../internal/librarymanagement/IvyCache.scala | 4 +- .../internal/librarymanagement/MakePom.scala | 154 ++++++++++-------- .../CachedResolutionResolveEngine.scala | 42 +++-- .../ivyint/GigahorseUrlHandler.scala | 37 +++-- .../ivyint/ParallelResolveEngine.scala | 33 ++-- .../ivyint/SbtChainResolver.scala | 30 ++-- .../ivy/IvyDependencyResolution.scala | 10 +- .../librarymanagement/ivy/IvyPublisher.scala | 16 +- .../ivy/formats/UpdateOptionsFormat.scala | 4 +- .../BaseCachedResolutionSpec.scala | 8 +- .../BaseIvySpecification.scala | 32 ++-- .../ComponentManagerTest.scala | 10 +- .../DMSerializationSpec.scala | 18 +- .../EvictionWarningSpec.scala | 3 +- .../librarymanagement/FrozenModeSpec.scala | 6 +- .../librarymanagement/IvyRepoSpec.scala | 24 +-- .../librarymanagement/ScalaOverrideTest.scala | 120 +++++++++----- 37 files changed, 544 insertions(+), 336 deletions(-) diff --git a/common-test/src/main/scala/sbt/internal/librarymanagement/AbstractEngineSpec.scala b/common-test/src/main/scala/sbt/internal/librarymanagement/AbstractEngineSpec.scala index f8b404e9f..e676b7857 100644 --- a/common-test/src/main/scala/sbt/internal/librarymanagement/AbstractEngineSpec.scala +++ b/common-test/src/main/scala/sbt/internal/librarymanagement/AbstractEngineSpec.scala @@ -5,9 +5,11 @@ import sbt.librarymanagement._ abstract class AbstractEngineSpec extends UnitSpec { def cleanCache(): Unit - def module(moduleId: ModuleID, - deps: Vector[ModuleID], - scalaFullVersion: Option[String]): ModuleDescriptor + def module( + moduleId: ModuleID, + deps: Vector[ModuleID], + scalaFullVersion: Option[String] + ): ModuleDescriptor def updateEither(module: ModuleDescriptor): Either[UnresolvedWarning, UpdateReport] diff --git a/core/src/main/scala/sbt/internal/librarymanagement/SemanticSelectorExtra.scala b/core/src/main/scala/sbt/internal/librarymanagement/SemanticSelectorExtra.scala index 49990d1df..c609a1529 100644 --- a/core/src/main/scala/sbt/internal/librarymanagement/SemanticSelectorExtra.scala +++ b/core/src/main/scala/sbt/internal/librarymanagement/SemanticSelectorExtra.scala @@ -19,7 +19,8 @@ private[librarymanagement] abstract class SemSelAndChunkFunctions { // from and to can not have an operator. if (hasOperator(fromStr) || hasOperator(toStr)) { throw new IllegalArgumentException( - s"Invalid ' - ' range, both side of comparators can not have an operator: $fromStr - $toStr") + s"Invalid ' - ' range, both side of comparators can not have an operator: $fromStr - $toStr" + ) } val from = SemComparator(fromStr) val to = SemComparator(toStr) @@ -33,7 +34,8 @@ private[librarymanagement] abstract class SemSelAndChunkFunctions { (comparatorsBefore ++ comparatorsAfter) case _ => throw new IllegalArgumentException( - s"Invalid ' - ' range position, both side of versions must be specified: $andClauseToken") + s"Invalid ' - ' range position, both side of versions must be specified: $andClauseToken" + ) } } SemSelAndChunk(comparators.flatMap(_.expandWildcard)) @@ -165,7 +167,8 @@ private[librarymanagement] abstract class SemComparatorFunctions { if (hasXrangeSelector) { if (tags.nonEmpty) throw new IllegalArgumentException( - s"Pre-release version requires major, minor, patch versions to be specified: $comparator") + s"Pre-release version requires major, minor, patch versions to be specified: $comparator" + ) val numbers = Seq(major, minor, patch).takeWhile { case Some(str) => str.matches("\\d+") case None => false @@ -180,7 +183,8 @@ private[librarymanagement] abstract class SemComparatorFunctions { } else { if (tags.nonEmpty && (major.isEmpty || minor.isEmpty || patch.isEmpty)) throw new IllegalArgumentException( - s"Pre-release version requires major, minor, patch versions to be specified: $comparator") + s"Pre-release version requires major, minor, patch versions to be specified: $comparator" + ) val operator = opStr match { case Some("<") => Lt case Some("<=") => Lte diff --git a/core/src/main/scala/sbt/internal/librarymanagement/formats/NodeSeqFormat.scala b/core/src/main/scala/sbt/internal/librarymanagement/formats/NodeSeqFormat.scala index 2a81aa37b..45704dfa6 100644 --- a/core/src/main/scala/sbt/internal/librarymanagement/formats/NodeSeqFormat.scala +++ b/core/src/main/scala/sbt/internal/librarymanagement/formats/NodeSeqFormat.scala @@ -5,7 +5,7 @@ import scala.xml._ trait NodeSeqFormat { self: BasicJsonProtocol => implicit lazy val NodeSeqFormat: JsonFormat[NodeSeq] = projectFormat[NodeSeq, String]( - xml => { xml }.toString, + xml => {xml}.toString, str => XML.loadString(str).child ) } diff --git a/core/src/main/scala/sbt/librarymanagement/ConfigurationExtra.scala b/core/src/main/scala/sbt/librarymanagement/ConfigurationExtra.scala index b8e339526..d15297198 100644 --- a/core/src/main/scala/sbt/librarymanagement/ConfigurationExtra.scala +++ b/core/src/main/scala/sbt/librarymanagement/ConfigurationExtra.scala @@ -90,12 +90,14 @@ private[librarymanagement] abstract class ConfigurationExtra { def describedAs(newDescription: String) = Configuration.of(id, name, newDescription, isPublic, extendsConfigs, transitive) def extend(configs: Configuration*) = - Configuration.of(id, - name, - description, - isPublic, - configs.toVector ++ extendsConfigs, - transitive) + Configuration.of( + id, + name, + description, + isPublic, + configs.toVector ++ extendsConfigs, + transitive + ) def notTransitive = intransitive def intransitive = Configuration.of(id, name, description, isPublic, extendsConfigs, false) def hide = Configuration.of(id, name, description, false, extendsConfigs, transitive) @@ -109,7 +111,8 @@ private[sbt] object ConfigurationMacro { val enclosingValName = definingValName( c, methodName => - s"""$methodName must be directly assigned to a val, such as `val Tooling = $methodName("tooling")`.""") + s"""$methodName must be directly assigned to a val, such as `val Tooling = $methodName("tooling")`.""" + ) if (enclosingValName.head.isLower) { c.error(c.enclosingPosition, "configuration id must be capitalized") } diff --git a/core/src/main/scala/sbt/librarymanagement/ConfigurationFormats.scala b/core/src/main/scala/sbt/librarymanagement/ConfigurationFormats.scala index c292cbc29..66bea9aae 100644 --- a/core/src/main/scala/sbt/librarymanagement/ConfigurationFormats.scala +++ b/core/src/main/scala/sbt/librarymanagement/ConfigurationFormats.scala @@ -10,8 +10,10 @@ trait ConfigurationFormats { self: sbt.librarymanagement.ConfigurationFormats with sjsonnew.BasicJsonProtocol => implicit lazy val ConfigurationFormat: JsonFormat[sbt.librarymanagement.Configuration] = new JsonFormat[sbt.librarymanagement.Configuration] { - override def read[J](jsOpt: Option[J], - unbuilder: Unbuilder[J]): sbt.librarymanagement.Configuration = { + override def read[J]( + jsOpt: Option[J], + unbuilder: Unbuilder[J] + ): sbt.librarymanagement.Configuration = { jsOpt match { case Some(js) => unbuilder.beginObject(js) @@ -23,12 +25,14 @@ trait ConfigurationFormats { unbuilder.readField[Vector[sbt.librarymanagement.Configuration]]("extendsConfigs") val transitive = unbuilder.readField[Boolean]("transitive") unbuilder.endObject() - new sbt.librarymanagement.Configuration(id, - name, - description, - isPublic, - extendsConfigs, - transitive) + new sbt.librarymanagement.Configuration( + id, + name, + description, + isPublic, + extendsConfigs, + transitive + ) case None => deserializationError("Expected JsObject but found None") } diff --git a/core/src/main/scala/sbt/librarymanagement/CrossVersion.scala b/core/src/main/scala/sbt/librarymanagement/CrossVersion.scala index c93702ded..6c37596b3 100644 --- a/core/src/main/scala/sbt/librarymanagement/CrossVersion.scala +++ b/core/src/main/scala/sbt/librarymanagement/CrossVersion.scala @@ -175,8 +175,10 @@ object Full { trait DisabledFormats { self: sjsonnew.BasicJsonProtocol => implicit lazy val DisabledFormat: JsonFormat[sbt.librarymanagement.Disabled] = new JsonFormat[sbt.librarymanagement.Disabled] { - override def read[J](jsOpt: Option[J], - unbuilder: Unbuilder[J]): sbt.librarymanagement.Disabled = { + override def read[J]( + jsOpt: Option[J], + unbuilder: Unbuilder[J] + ): sbt.librarymanagement.Disabled = { jsOpt match { case Some(js) => unbuilder.beginObject(js) @@ -196,8 +198,10 @@ trait DisabledFormats { self: sjsonnew.BasicJsonProtocol => implicit lazy val DisabledObjectFormat: JsonFormat[sbt.librarymanagement.Disabled.type] = new JsonFormat[sbt.librarymanagement.Disabled.type] { - override def read[J](jsOpt: Option[J], - unbuilder: Unbuilder[J]): sbt.librarymanagement.Disabled.type = { + override def read[J]( + jsOpt: Option[J], + unbuilder: Unbuilder[J] + ): sbt.librarymanagement.Disabled.type = { jsOpt match { case Some(js) => unbuilder.beginObject(js) @@ -219,8 +223,10 @@ trait DisabledFormats { self: sjsonnew.BasicJsonProtocol => trait BinaryFormats { self: sjsonnew.BasicJsonProtocol => implicit lazy val BinaryFormat: JsonFormat[sbt.librarymanagement.Binary] = new JsonFormat[sbt.librarymanagement.Binary] { - override def read[J](jsOpt: Option[J], - unbuilder: Unbuilder[J]): sbt.librarymanagement.Binary = { + override def read[J]( + jsOpt: Option[J], + unbuilder: Unbuilder[J] + ): sbt.librarymanagement.Binary = { jsOpt match { case Some(js) => unbuilder.beginObject(js) @@ -244,8 +250,10 @@ trait BinaryFormats { self: sjsonnew.BasicJsonProtocol => trait ConstantFormats { self: sjsonnew.BasicJsonProtocol => implicit lazy val ConstantFormat: JsonFormat[sbt.librarymanagement.Constant] = new JsonFormat[sbt.librarymanagement.Constant] { - override def read[J](jsOpt: Option[J], - unbuilder: Unbuilder[J]): sbt.librarymanagement.Constant = { + override def read[J]( + jsOpt: Option[J], + unbuilder: Unbuilder[J] + ): sbt.librarymanagement.Constant = { jsOpt match { case Some(js) => unbuilder.beginObject(js) @@ -267,8 +275,10 @@ trait ConstantFormats { self: sjsonnew.BasicJsonProtocol => trait PatchFormats { self: sjsonnew.BasicJsonProtocol => implicit lazy val PatchFormat: JsonFormat[sbt.librarymanagement.Patch] = new JsonFormat[sbt.librarymanagement.Patch] { - override def read[J](jsOpt: Option[J], - unbuilder: Unbuilder[J]): sbt.librarymanagement.Patch = { + override def read[J]( + jsOpt: Option[J], + unbuilder: Unbuilder[J] + ): sbt.librarymanagement.Patch = { jsOpt match { case Some(js) => unbuilder.beginObject(js) @@ -290,8 +300,10 @@ trait PatchFormats { self: sjsonnew.BasicJsonProtocol => trait FullFormats { self: sjsonnew.BasicJsonProtocol => implicit lazy val FullFormat: JsonFormat[sbt.librarymanagement.Full] = new JsonFormat[sbt.librarymanagement.Full] { - override def read[J](jsOpt: Option[J], - unbuilder: Unbuilder[J]): sbt.librarymanagement.Full = { + override def read[J]( + jsOpt: Option[J], + unbuilder: Unbuilder[J] + ): sbt.librarymanagement.Full = { jsOpt match { case Some(js) => unbuilder.beginObject(js) @@ -320,11 +332,13 @@ trait CrossVersionFormats { with sbt.librarymanagement.PatchFormats with sbt.librarymanagement.FullFormats => implicit lazy val CrossVersionFormat: JsonFormat[sbt.librarymanagement.CrossVersion] = - flatUnionFormat6[sbt.librarymanagement.CrossVersion, - sbt.librarymanagement.Disabled, - sbt.librarymanagement.Disabled.type, - sbt.librarymanagement.Binary, - sbt.librarymanagement.Constant, - sbt.librarymanagement.Patch, - sbt.librarymanagement.Full]("type") + flatUnionFormat6[ + sbt.librarymanagement.CrossVersion, + sbt.librarymanagement.Disabled, + sbt.librarymanagement.Disabled.type, + sbt.librarymanagement.Binary, + sbt.librarymanagement.Constant, + sbt.librarymanagement.Patch, + sbt.librarymanagement.Full + ]("type") } diff --git a/core/src/main/scala/sbt/librarymanagement/DependencyResolution.scala b/core/src/main/scala/sbt/librarymanagement/DependencyResolution.scala index f9f2f41cc..500f569e5 100644 --- a/core/src/main/scala/sbt/librarymanagement/DependencyResolution.scala +++ b/core/src/main/scala/sbt/librarymanagement/DependencyResolution.scala @@ -30,9 +30,11 @@ class DependencyResolution private[sbt] (lmEngine: DependencyResolutionInterface * @param configurations The configurations that this module has. * @return A `ModuleDescriptor` describing a subproject and its dependencies. */ - def moduleDescriptor(moduleId: ModuleID, - directDependencies: Vector[ModuleID], - scalaModuleInfo: Option[ScalaModuleInfo]): ModuleDescriptor = { + def moduleDescriptor( + moduleId: ModuleID, + directDependencies: Vector[ModuleID], + scalaModuleInfo: Option[ScalaModuleInfo] + ): ModuleDescriptor = { val moduleSetting = ModuleDescriptorConfiguration(moduleId, ModuleInfo(moduleId.name)) .withScalaModuleInfo(scalaModuleInfo) .withDependencies(directDependencies) @@ -49,10 +51,12 @@ class DependencyResolution private[sbt] (lmEngine: DependencyResolutionInterface * @return The result, either an unresolved warning or an update report. Note that this * update report will or will not be successful depending on the `missingOk` option. */ - def update(module: ModuleDescriptor, - configuration: UpdateConfiguration, - uwconfig: UnresolvedWarningConfiguration, - log: Logger): Either[UnresolvedWarning, UpdateReport] = + def update( + module: ModuleDescriptor, + configuration: UpdateConfiguration, + uwconfig: UnresolvedWarningConfiguration, + log: Logger + ): Either[UnresolvedWarning, UpdateReport] = lmEngine.update(module, configuration, uwconfig, log) /** @@ -71,8 +75,10 @@ class DependencyResolution private[sbt] (lmEngine: DependencyResolutionInterface * @param scalaModuleInfo The information about the Scala verson used, if any. * @return A `ModuleDescriptor` that depends on `dependencyId`. */ - def wrapDependencyInModule(dependencyId: ModuleID, - scalaModuleInfo: Option[ScalaModuleInfo]): ModuleDescriptor = { + def wrapDependencyInModule( + dependencyId: ModuleID, + scalaModuleInfo: Option[ScalaModuleInfo] + ): ModuleDescriptor = { val sha1 = Hash.toHex(Hash(dependencyId.name)) val dummyID = ModuleID(sbtOrgTemp, modulePrefixTemp + sha1, dependencyId.revision) .withConfigurations(dependencyId.configurations) @@ -88,10 +94,12 @@ class DependencyResolution private[sbt] (lmEngine: DependencyResolutionInterface * @param log The logger. * @return The result, either an unresolved warning or a sequence of files. */ - def retrieve(dependencyId: ModuleID, - scalaModuleInfo: Option[ScalaModuleInfo], - retrieveDirectory: File, - log: Logger): Either[UnresolvedWarning, Vector[File]] = + def retrieve( + dependencyId: ModuleID, + scalaModuleInfo: Option[ScalaModuleInfo], + retrieveDirectory: File, + log: Logger + ): Either[UnresolvedWarning, Vector[File]] = retrieve(wrapDependencyInModule(dependencyId, scalaModuleInfo), retrieveDirectory, log) /** @@ -102,9 +110,11 @@ class DependencyResolution private[sbt] (lmEngine: DependencyResolutionInterface * @param log The logger. * @return The result, either an unresolved warning or a sequence of files. */ - def retrieve(module: ModuleDescriptor, - retrieveDirectory: File, - log: Logger): Either[UnresolvedWarning, Vector[File]] = { + def retrieve( + module: ModuleDescriptor, + retrieveDirectory: File, + log: Logger + ): Either[UnresolvedWarning, Vector[File]] = { // Using the default artifact type filter here, so sources and docs are excluded. val retrieveConfiguration = RetrieveConfiguration() .withRetrieveDirectory(retrieveDirectory) diff --git a/core/src/main/scala/sbt/librarymanagement/EvictionWarning.scala b/core/src/main/scala/sbt/librarymanagement/EvictionWarning.scala index 04da1a4c6..22405934c 100644 --- a/core/src/main/scala/sbt/librarymanagement/EvictionWarning.scala +++ b/core/src/main/scala/sbt/librarymanagement/EvictionWarning.scala @@ -98,7 +98,7 @@ object EvictionWarningOptions { guessSbtOne orElse guessSecondSegment orElse guessSemVer orElse guessFalse lazy val guessSecondSegment - : PartialFunction[(ModuleID, Option[ModuleID], Option[ScalaModuleInfo]), Boolean] = { + : PartialFunction[(ModuleID, Option[ModuleID], Option[ScalaModuleInfo]), Boolean] = { case (m1, Some(m2), Some(scalaModuleInfo)) if m2.name.endsWith("_" + scalaModuleInfo.scalaFullVersion) || m2.name.endsWith( "_" + scalaModuleInfo.scalaBinaryVersion @@ -112,7 +112,7 @@ object EvictionWarningOptions { } lazy val guessSbtOne - : PartialFunction[(ModuleID, Option[ModuleID], Option[ScalaModuleInfo]), Boolean] = { + : PartialFunction[(ModuleID, Option[ModuleID], Option[ScalaModuleInfo]), Boolean] = { case (m1, Some(m2), Some(scalaModuleInfo)) if (m2.organization == "org.scala-sbt") && (m2.name.endsWith("_" + scalaModuleInfo.scalaFullVersion) || @@ -126,7 +126,7 @@ object EvictionWarningOptions { } lazy val guessSemVer - : PartialFunction[(ModuleID, Option[ModuleID], Option[ScalaModuleInfo]), Boolean] = { + : PartialFunction[(ModuleID, Option[ModuleID], Option[ScalaModuleInfo]), Boolean] = { case (m1, Some(m2), _) => (m1.revision, m2.revision) match { case (VersionNumber(ns1, ts1, es1), VersionNumber(ns2, ts2, es2)) => @@ -137,7 +137,7 @@ object EvictionWarningOptions { } lazy val guessFalse - : PartialFunction[(ModuleID, Option[ModuleID], Option[ScalaModuleInfo]), Boolean] = { + : PartialFunction[(ModuleID, Option[ModuleID], Option[ScalaModuleInfo]), Boolean] = { case (_, _, _) => false } } diff --git a/core/src/main/scala/sbt/librarymanagement/LibraryManagementInterface.scala b/core/src/main/scala/sbt/librarymanagement/LibraryManagementInterface.scala index 5236a1a2a..cdca4a8dc 100644 --- a/core/src/main/scala/sbt/librarymanagement/LibraryManagementInterface.scala +++ b/core/src/main/scala/sbt/librarymanagement/LibraryManagementInterface.scala @@ -26,10 +26,12 @@ trait DependencyResolutionInterface { * @return The result, either an unresolved warning or an update report. Note that this * update report will or will not be successful depending on the `missingOk` option. */ - def update(module: ModuleDescriptor, - configuration: UpdateConfiguration, - uwconfig: UnresolvedWarningConfiguration, - log: Logger): Either[UnresolvedWarning, UpdateReport] + def update( + module: ModuleDescriptor, + configuration: UpdateConfiguration, + uwconfig: UnresolvedWarningConfiguration, + log: Logger + ): Either[UnresolvedWarning, UpdateReport] } /** diff --git a/core/src/main/scala/sbt/librarymanagement/Publisher.scala b/core/src/main/scala/sbt/librarymanagement/Publisher.scala index da3e09e6f..c071240f9 100644 --- a/core/src/main/scala/sbt/librarymanagement/Publisher.scala +++ b/core/src/main/scala/sbt/librarymanagement/Publisher.scala @@ -35,9 +35,11 @@ class Publisher private[sbt] (publisherEngine: PublisherInterface) { * @param log The logger. * @return The `File` containing the POM descriptor. */ - def makePomFile(module: ModuleDescriptor, - configuration: MakePomConfiguration, - log: Logger): File = + def makePomFile( + module: ModuleDescriptor, + configuration: MakePomConfiguration, + log: Logger + ): File = publisherEngine.makePomFile(module, configuration, log) } diff --git a/core/src/main/scala/sbt/librarymanagement/ResolverExtra.scala b/core/src/main/scala/sbt/librarymanagement/ResolverExtra.scala index 03974baba..d359f31ad 100644 --- a/core/src/main/scala/sbt/librarymanagement/ResolverExtra.scala +++ b/core/src/main/scala/sbt/librarymanagement/ResolverExtra.scala @@ -169,8 +169,10 @@ private[librarymanagement] abstract class ResolverFunctions { * Add the local Ivy repository to the user repositories. * If `mavenCentral` is true, add the Maven Central repository. */ - def combineDefaultResolvers(userResolvers: Vector[Resolver], - mavenCentral: Boolean): Vector[Resolver] = + def combineDefaultResolvers( + userResolvers: Vector[Resolver], + mavenCentral: Boolean + ): Vector[Resolver] = combineDefaultResolvers(userResolvers, jcenter = false, mavenCentral) /** diff --git a/core/src/main/scala/sbt/librarymanagement/RichUpdateReport.scala b/core/src/main/scala/sbt/librarymanagement/RichUpdateReport.scala index c97bf9da1..f66440bbb 100644 --- a/core/src/main/scala/sbt/librarymanagement/RichUpdateReport.scala +++ b/core/src/main/scala/sbt/librarymanagement/RichUpdateReport.scala @@ -14,12 +14,14 @@ final class RichUpdateReport(report: UpdateReport) { val stamps = files .map( f => - (f, - // TODO: The list of files may also contain some odd files that do not actually exist like: - // "./target/ivyhome/resolution-cache/com.example/foo/0.4.0/resolved.xml.xml". - // IO.getModifiedTimeOrZero() will just return zero, but the list of files should not contain such - // files to begin with, in principle. - IO.getModifiedTimeOrZero(f)) + ( + f, + // TODO: The list of files may also contain some odd files that do not actually exist like: + // "./target/ivyhome/resolution-cache/com.example/foo/0.4.0/resolved.xml.xml". + // IO.getModifiedTimeOrZero() will just return zero, but the list of files should not contain such + // files to begin with, in principle. + IO.getModifiedTimeOrZero(f) + ) ) .toMap UpdateReport(report.cachedDescriptor, report.configurations, report.stats, stamps) diff --git a/core/src/main/scala/sbt/librarymanagement/UpdateReportExtra.scala b/core/src/main/scala/sbt/librarymanagement/UpdateReportExtra.scala index 9a498c024..1ffba5008 100644 --- a/core/src/main/scala/sbt/librarymanagement/UpdateReportExtra.scala +++ b/core/src/main/scala/sbt/librarymanagement/UpdateReportExtra.scala @@ -74,24 +74,32 @@ private[librarymanagement] abstract class ModuleReportExtra { reportStr( "extraAttributes", if (extraAttributes.isEmpty) None - else { Some(extraAttributes.toString) } + else { + Some(extraAttributes.toString) + } ) + reportStr("isDefault", isDefault map { _.toString }) + reportStr("branch", branch) + reportStr( "configurations", if (configurations.isEmpty) None - else { Some(configurations.mkString(", ")) } + else { + Some(configurations.mkString(", ")) + } ) + reportStr( "licenses", if (licenses.isEmpty) None - else { Some(licenses.mkString(", ")) } + else { + Some(licenses.mkString(", ")) + } ) + reportStr( "callers", if (callers.isEmpty) None - else { Some(callers.mkString(", ")) } + else { + Some(callers.mkString(", ")) + } ) private[sbt] def reportStr(key: String, value: Option[String]): String = value map { x => diff --git a/core/src/test/scala/ConfigMacroSpec.scala b/core/src/test/scala/ConfigMacroSpec.scala index 93810a96a..c35ab104b 100644 --- a/core/src/test/scala/ConfigMacroSpec.scala +++ b/core/src/test/scala/ConfigMacroSpec.scala @@ -55,7 +55,7 @@ object ConfigMacroSpec extends Properties("ConfigMacroSpec") { s"Actual name: ${c.name}" |: s"Actual isPublic: ${c.isPublic}" |: (c.id == id) && - (c.name == name) && + (c.name == name) && (c.isPublic == isPublic) } } diff --git a/core/src/test/scala/sbt/librarymanagement/ResolverTest.scala b/core/src/test/scala/sbt/librarymanagement/ResolverTest.scala index d98eab799..70f7c19cd 100644 --- a/core/src/test/scala/sbt/librarymanagement/ResolverTest.scala +++ b/core/src/test/scala/sbt/librarymanagement/ResolverTest.scala @@ -11,11 +11,14 @@ object ResolverTest extends UnitSpec { val patsExpected = Vector("http://foo.com/test/[orgPath]") val patterns = Resolver .url("test", new URL("http://foo.com/test"))( - Patterns(pats, - pats, - isMavenCompatible = false, - descriptorOptional = true, - skipConsistencyCheck = true)) + Patterns( + pats, + pats, + isMavenCompatible = false, + descriptorOptional = true, + skipConsistencyCheck = true + ) + ) .patterns patterns.ivyPatterns shouldBe patsExpected diff --git a/ivy/src/main/scala/sbt/internal/librarymanagement/ComponentManager.scala b/ivy/src/main/scala/sbt/internal/librarymanagement/ComponentManager.scala index a973f59e1..ed42cd14c 100644 --- a/ivy/src/main/scala/sbt/internal/librarymanagement/ComponentManager.scala +++ b/ivy/src/main/scala/sbt/internal/librarymanagement/ComponentManager.scala @@ -30,7 +30,9 @@ class ComponentManager( def files(id: String)(ifMissing: IfMissing): Iterable[File] = { def fromGlobal = lockGlobalCache { - try { update(id); getOrElse(createAndCache) } catch { + try { + update(id); getOrElse(createAndCache) + } catch { case _: NotInCache => createAndCache } } @@ -100,7 +102,11 @@ object ComponentManager { lazy val (version, timestamp) = { val properties = new java.util.Properties val propertiesStream = versionResource.openStream - try { properties.load(propertiesStream) } finally { propertiesStream.close() } + try { + properties.load(propertiesStream) + } finally { + propertiesStream.close() + } (properties.getProperty("version"), properties.getProperty("timestamp")) } lazy val stampedVersion = version + "_" + timestamp diff --git a/ivy/src/main/scala/sbt/internal/librarymanagement/ConvertResolver.scala b/ivy/src/main/scala/sbt/internal/librarymanagement/ConvertResolver.scala index 2c9a79357..43020d215 100644 --- a/ivy/src/main/scala/sbt/internal/librarymanagement/ConvertResolver.scala +++ b/ivy/src/main/scala/sbt/internal/librarymanagement/ConvertResolver.scala @@ -246,9 +246,11 @@ private[sbt] object ConvertResolver { def managedChecksumsEnabled: Boolean import sbt.io.syntax._ - private def downloadChecksum(resource: Resource, - targetChecksumFile: File, - algorithm: String): Boolean = { + private def downloadChecksum( + resource: Resource, + targetChecksumFile: File, + algorithm: String + ): Boolean = { if (!ChecksumHelper.isKnownAlgorithm(algorithm)) throw new IllegalArgumentException(s"Unknown checksum algorithm: $algorithm") diff --git a/ivy/src/main/scala/sbt/internal/librarymanagement/FakeResolver.scala b/ivy/src/main/scala/sbt/internal/librarymanagement/FakeResolver.scala index c84dcc50a..794fff9e3 100644 --- a/ivy/src/main/scala/sbt/internal/librarymanagement/FakeResolver.scala +++ b/ivy/src/main/scala/sbt/internal/librarymanagement/FakeResolver.scala @@ -178,8 +178,9 @@ private[sbt] class FakeResolver(private var name: String, cacheDir: File, module val artifact = for { artifacts <- modules get ((moduleOrganisation, moduleName, moduleRevision)) - artifact <- artifacts find (a => - a.name == art.getName && a.tpe == art.getType && a.ext == art.getExt) + artifact <- artifacts find ( + a => a.name == art.getName && a.tpe == art.getType && a.ext == art.getExt + ) } yield new ArtifactOrigin(art, /* isLocal = */ true, artifact.file.toURI.toURL.toString) artifact.orNull diff --git a/ivy/src/main/scala/sbt/internal/librarymanagement/Ivy.scala b/ivy/src/main/scala/sbt/internal/librarymanagement/Ivy.scala index 5cf1264f1..cc381573e 100644 --- a/ivy/src/main/scala/sbt/internal/librarymanagement/Ivy.scala +++ b/ivy/src/main/scala/sbt/internal/librarymanagement/Ivy.scala @@ -73,7 +73,11 @@ final class IvySbt( IvySbt.synchronized { val originalLogger = Message.getDefaultLogger Message.setDefaultLogger(logger) - try { f } finally { Message.setDefaultLogger(originalLogger) } + try { + f + } finally { + Message.setDefaultLogger(originalLogger) + } } // Ivy is not thread-safe nor can the cache be used concurrently. // If provided a GlobalLock, we can use that to ensure safe access to the cache. @@ -207,7 +211,9 @@ final class IvySbt( ivyint.ErrorMessageAuthenticator.install() ivy.pushContext() ivy.getLoggerEngine.pushLogger(log) - try { f(ivy) } finally { + try { + f(ivy) + } finally { ivy.getLoggerEngine.popLogger() ivy.popContext() } @@ -275,7 +281,8 @@ final class IvySbt( IvySbt.setConflictManager(moduleID, conflictManager, ivy.getSettings) val defaultConf = defaultConfiguration getOrElse Configuration.of( "Default", - ModuleDescriptor.DEFAULT_CONFIGURATION) + ModuleDescriptor.DEFAULT_CONFIGURATION + ) log.debug( s"Using inline dependencies specified in Scala${(if (ivyXML.isEmpty) "" else " and XML")}." ) @@ -383,7 +390,7 @@ final class IvySbt( // Redefine to use a subset of properties, that are serialisable override implicit lazy val InlineIvyConfigurationFormat - : JsonFormat[InlineIvyConfiguration] = { + : JsonFormat[InlineIvyConfiguration] = { def hlToInlineIvy(i: InlineIvyHL): InlineIvyConfiguration = { val ( paths, @@ -406,7 +413,7 @@ final class IvySbt( // Redefine to use a subset of properties, that are serialisable override implicit lazy val ExternalIvyConfigurationFormat - : JsonFormat[ExternalIvyConfiguration] = { + : JsonFormat[ExternalIvyConfiguration] = { def hlToExternalIvy(e: ExternalIvyHL): ExternalIvyConfiguration = { val (baseDirectory, _) = e ExternalIvyConfiguration( @@ -729,9 +736,11 @@ private[sbt] object IvySbt { allConfigurations: Vector[ConfigRef] ): MDArtifact = { val artifact = new MDArtifact(moduleID, a.name, a.`type`, a.extension, null, extra(a, false)) - copyConfigurations(a, - (ref: ConfigRef) => { artifact.addConfiguration(ref.name) }, - allConfigurations) + copyConfigurations( + a, + (ref: ConfigRef) => { artifact.addConfiguration(ref.name) }, + allConfigurations + ) artifact } def getExtraAttributes(revID: ExtendableItem): Map[String, String] = { @@ -757,21 +766,21 @@ private[sbt] object IvySbt { private def wrapped(module: ModuleID, dependencies: NodeSeq) = { { - if (hasInfo(module, dependencies)) - NodeSeq.Empty - else - addExtraAttributes(defaultInfo(module), module.extraAttributes) - } - { dependencies } + if (hasInfo(module, dependencies)) + NodeSeq.Empty + else + addExtraAttributes(defaultInfo(module), module.extraAttributes) + } + {dependencies} { - // this is because Ivy adds a default artifact if none are specified. - if ((dependencies \\ "publications").isEmpty) else NodeSeq.Empty - } + // this is because Ivy adds a default artifact if none are specified. + if ((dependencies \\ "publications").isEmpty) else NodeSeq.Empty + } } private[this] def defaultInfo(module: ModuleID): scala.xml.Elem = { import module._ - val base = + val base = branchName.fold(base) { br => base % new scala.xml.UnprefixedAttribute("branch", br, scala.xml.Null) } @@ -784,7 +793,7 @@ private[sbt] object IvySbt { case (e, (key, value)) => e % new scala.xml.UnprefixedAttribute(key, value, scala.xml.Null) } private def hasInfo(module: ModuleID, x: scala.xml.NodeSeq) = { - val info = { x } \ "info" + val info = {x} \ "info" if (info.nonEmpty) { def check(found: NodeSeq, expected: String, label: String) = if (found.isEmpty) @@ -995,7 +1004,8 @@ private[sbt] object IvySbt { ): Unit = excludes.foreach(exclude => addExclude(moduleID, scalaModuleInfo)(exclude)) def addExclude(moduleID: DefaultModuleDescriptor, scalaModuleInfo: Option[ScalaModuleInfo])( - exclude0: ExclusionRule): Unit = { + exclude0: ExclusionRule + ): Unit = { // this adds _2.11 postfix val exclude = CrossVersion.substituteCross(exclude0, scalaModuleInfo) val confs = diff --git a/ivy/src/main/scala/sbt/internal/librarymanagement/IvyActions.scala b/ivy/src/main/scala/sbt/internal/librarymanagement/IvyActions.scala index 29e9683d8..ffa2f733e 100644 --- a/ivy/src/main/scala/sbt/internal/librarymanagement/IvyActions.scala +++ b/ivy/src/main/scala/sbt/internal/librarymanagement/IvyActions.scala @@ -152,7 +152,11 @@ object IvyActions { ): T = { val previous = resolver.getChecksumAlgorithms resolver.setChecksums(checksums mkString ",") - try { act } finally { resolver.setChecksums(previous mkString ",") } + try { + act + } finally { + resolver.setChecksums(previous mkString ",") + } } private def crossVersionMap(moduleSettings: ModuleSettings): Option[String => String] = moduleSettings match { @@ -367,12 +371,14 @@ object IvyActions { resolveOptions.setTransitive(false) resolveOptions.setCheckIfChanged(false) } - resolver.customResolve(descriptor, - missingOk, - updateConfiguration.logicalClock, - resolveOptions, - cache, - log) + resolver.customResolve( + descriptor, + missingOk, + updateConfiguration.logicalClock, + resolveOptions, + cache, + log + ) } private def retrieve( @@ -496,7 +502,11 @@ object IvyActions { resolver.commitPublishTransaction() } catch { case e: Throwable => - try { resolver.abortPublishTransaction() } finally { throw e } + try { + resolver.abortPublishTransaction() + } finally { + throw e + } } } } diff --git a/ivy/src/main/scala/sbt/internal/librarymanagement/IvyCache.scala b/ivy/src/main/scala/sbt/internal/librarymanagement/IvyCache.scala index f56656a02..9e8f28aa8 100644 --- a/ivy/src/main/scala/sbt/internal/librarymanagement/IvyCache.scala +++ b/ivy/src/main/scala/sbt/internal/librarymanagement/IvyCache.scala @@ -58,7 +58,9 @@ class IvyCache(val ivyHome: Option[File]) { /** Clears the cache of the jar for the given ID.*/ def clearCachedJar(id: ModuleID, lock: Option[xsbti.GlobalLock], log: Logger): Unit = { - try { withCachedJar(id, lock, log)(_.delete); () } catch { + try { + withCachedJar(id, lock, log)(_.delete); () + } catch { case e: Exception => log.debug("Error cleaning cached jar: " + e.toString) } } diff --git a/ivy/src/main/scala/sbt/internal/librarymanagement/MakePom.scala b/ivy/src/main/scala/sbt/internal/librarymanagement/MakePom.scala index 80b466b5a..4f172ce94 100644 --- a/ivy/src/main/scala/sbt/internal/librarymanagement/MakePom.scala +++ b/ivy/src/main/scala/sbt/internal/librarymanagement/MakePom.scala @@ -137,27 +137,27 @@ class MakePom(val log: Logger) { ): XNode = ( 4.0.0 - { makeModuleID(module) } - { moduleInfo.nameFormal } - { makeStartYear(moduleInfo) } - { makeOrganization(moduleInfo) } - { makeScmInfo(moduleInfo) } - { makeDeveloperInfo(moduleInfo) } - { extra } + {makeModuleID(module)} + {moduleInfo.nameFormal} + {makeStartYear(moduleInfo)} + {makeOrganization(moduleInfo)} + {makeScmInfo(moduleInfo)} + {makeDeveloperInfo(moduleInfo)} + {extra} { - val deps = depsInConfs(module, configurations) - makeProperties(module, deps) ++ - makeDependencies(deps, includeTypes, module.getAllExcludeRules) - } - { makeRepositories(ivy.getSettings, allRepositories, filterRepositories) } + val deps = depsInConfs(module, configurations) + makeProperties(module, deps) ++ + makeDependencies(deps, includeTypes, module.getAllExcludeRules) + } + {makeRepositories(ivy.getSettings, allRepositories, filterRepositories)} ) def makeModuleID(module: ModuleDescriptor): NodeSeq = { val mrid = moduleDescriptor(module) val a: NodeSeq = - ({ mrid.getOrganisation } - { mrid.getName } - { packaging(module) }) + ({mrid.getOrganisation} + {mrid.getName} + {packaging(module)}) val b: NodeSeq = ((description(module.getDescription) ++ homePage(module.getHomePage) ++ @@ -168,32 +168,32 @@ class MakePom(val log: Logger) { def makeStartYear(moduleInfo: ModuleInfo): NodeSeq = moduleInfo.startYear match { - case Some(y) => { y } + case Some(y) => {y} case _ => NodeSeq.Empty } def makeOrganization(moduleInfo: ModuleInfo): NodeSeq = { - { moduleInfo.organizationName } + {moduleInfo.organizationName} { - moduleInfo.organizationHomepage match { - case Some(h)=> { h } - case _ => NodeSeq.Empty - } + moduleInfo.organizationHomepage match { + case Some(h) => {h} + case _ => NodeSeq.Empty } + } } def makeScmInfo(moduleInfo: ModuleInfo): NodeSeq = { moduleInfo.scmInfo match { case Some(s) => - { s.browseUrl } - { s.connection } + {s.browseUrl} + {s.connection} { - s.devConnection match { - case Some(d)=> { d } - case _=> NodeSeq.Empty - } + s.devConnection match { + case Some(d) => {d} + case _ => NodeSeq.Empty } + } case _ => NodeSeq.Empty } @@ -202,20 +202,20 @@ class MakePom(val log: Logger) { if (moduleInfo.developers.nonEmpty) { { - moduleInfo.developers.map { developer: Developer => - - { developer.id } - { developer.name } - { developer.url } + moduleInfo.developers.map { developer: Developer => + + {developer.id} + {developer.name} + {developer.url} { - developer.email match { - case "" | null => NodeSeq.Empty - case e => { e } - } - } - + developer.email match { + case "" | null => NodeSeq.Empty + case e => {e} + } } + } + } } else NodeSeq.Empty } @@ -232,7 +232,8 @@ class MakePom(val log: Logger) { if (k == PomExtraDependencyAttributes.ExtraAttributesKey) xmlSpacePreserve else scala.xml.Null { - for ((key, value) <- extra) yield ({ value }).copy(label = key, attributes = _extraAttributes(key)) + for ((key, value) <- extra) + yield ({value}).copy(label = key, attributes = _extraAttributes(key)) } } @@ -244,18 +245,34 @@ class MakePom(val log: Logger) { def xmlSpacePreserve = new PrefixedAttribute("xml", "space", "preserve", scala.xml.Null) def description(d: String) = - if ((d eq null) || d.isEmpty) NodeSeq.Empty else { d } + if ((d eq null) || d.isEmpty) NodeSeq.Empty + else + { + d + } def licenses(ls: Array[License]) = - if (ls == null || ls.isEmpty) NodeSeq.Empty else { ls.map(license) } + if (ls == null || ls.isEmpty) NodeSeq.Empty + else + { + ls.map(license) + } def license(l: License) = - { l.getName } - { l.getUrl } + {l.getName} + {l.getUrl} repo - def homePage(homePage: String) = if (homePage eq null) NodeSeq.Empty else { homePage } + def homePage(homePage: String) = + if (homePage eq null) NodeSeq.Empty + else + { + homePage + } def revision(version: String) = - if (version ne null) { version } else NodeSeq.Empty + if (version ne null) { + version + } + else NodeSeq.Empty def packaging(module: ModuleDescriptor) = module.getAllArtifacts match { case Array() => "pom" @@ -286,7 +303,9 @@ class MakePom(val log: Logger) { NodeSeq.Empty else - { dependencies.map(makeDependency(_, includeTypes, excludes)) } + { + dependencies.map(makeDependency(_, includeTypes, excludes)) + } @deprecated("Use `makeDependency` variant which takes excludes", "0.13.9") @@ -360,14 +379,14 @@ class MakePom(val log: Logger) { ): Elem = { val mrid = dependency.getDependencyRevisionId - { mrid.getOrganisation } - { mrid.getName } - { makeDependencyVersion(mrid.getRevision) } - { scopeElem(scope) } - { optionalElem(optional) } - { classifierElem(classifier) } - { typeElem(tpe) } - { exclusions(dependency, excludes) } + {mrid.getOrganisation} + {mrid.getName} + {makeDependencyVersion(mrid.getRevision)} + {scopeElem(scope)} + {optionalElem(optional)} + {classifierElem(classifier)} + {typeElem(tpe)} + {exclusions(dependency, excludes)} } @@ -385,7 +404,7 @@ class MakePom(val log: Logger) { } def typeElem(tpe: Option[String]): NodeSeq = tpe match { - case Some(t) => { t } + case Some(t) => {t} case None => NodeSeq.Empty } @@ -393,7 +412,7 @@ class MakePom(val log: Logger) { Option(artifact.getExtraAttribute("classifier")) def classifierElem(classifier: Option[String]): NodeSeq = classifier match { - case Some(c) => { c } + case Some(c) => {c} case None => NodeSeq.Empty } @@ -404,7 +423,7 @@ class MakePom(val log: Logger) { } def scopeElem(scope: Option[String]): NodeSeq = scope match { case None | Some(Configurations.Compile.name) => NodeSeq.Empty - case Some(s) => { s } + case Some(s) => {s} } def optionalElem(opt: Boolean) = if (opt) true else NodeSeq.Empty def moduleDescriptor(module: ModuleDescriptor) = module.getModuleRevisionId @@ -426,7 +445,9 @@ class MakePom(val log: Logger) { val excl = dependency.getExcludeRules(dependency.getModuleConfigurations) ++ excludes val (warns, excls) = IvyUtil.separate(excl.map(makeExclusion)) if (warns.nonEmpty) log.warn(warns.mkString(IO.Newline)) - if (excls.nonEmpty) { excls } + if (excls.nonEmpty) { + excls + } else NodeSeq.Empty } def makeExclusion(exclRule: ExcludeRule): Either[String, NodeSeq] = { @@ -440,8 +461,8 @@ class MakePom(val log: Logger) { else Right( - { g } - { a } + {g} + {a} ) } @@ -466,7 +487,10 @@ class MakePom(val log: Logger) { } val repositoryElements = mavenRepositories.filter(filterRepositories).map(mavenRepository) if (repositoryElements.isEmpty) repositoryElements - else { repositoryElements } + else + { + repositoryElements + } } def allResolvers(settings: IvySettings): Seq[DependencyResolver] = flatten(castResolvers(settings.getResolvers)).distinct @@ -487,10 +511,10 @@ class MakePom(val log: Logger) { mavenRepository(toID(repo.name), repo.name, repo.root) def mavenRepository(id: String, name: String, root: String): XNode = - { id } - { name } - { root } - { "default" } + {id} + {name} + {root} + {"default"} /** diff --git a/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/CachedResolutionResolveEngine.scala b/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/CachedResolutionResolveEngine.scala index 14635136c..d9cadfd81 100644 --- a/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/CachedResolutionResolveEngine.scala +++ b/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/CachedResolutionResolveEngine.scala @@ -51,12 +51,12 @@ private[sbt] class CachedResolutionResolveCache { concurrent.TrieMap() // Used for subproject val projectReportCache - : concurrent.Map[(ModuleRevisionId, LogicalClock), Either[ResolveException, UpdateReport]] = + : concurrent.Map[(ModuleRevisionId, LogicalClock), Either[ResolveException, UpdateReport]] = concurrent.TrieMap() val resolveReportCache: concurrent.Map[ModuleRevisionId, ResolveReport] = concurrent.TrieMap() val resolvePropertiesCache: concurrent.Map[ModuleRevisionId, String] = concurrent.TrieMap() val conflictCache - : concurrent.Map[(ModuleID, ModuleID), (Vector[ModuleID], Vector[ModuleID], String)] = + : concurrent.Map[(ModuleID, ModuleID), (Vector[ModuleID], Vector[ModuleID], String)] = concurrent.TrieMap() val maxConflictCacheSize: Int = 1024 val maxUpdateReportCacheSize: Int = 1024 @@ -188,11 +188,13 @@ private[sbt] class CachedResolutionResolveCache { val (pathOrg, pathName, pathRevision, pathScalaVersion, pathSbtVersion) = md match { case x: ArtificialModuleDescriptor => val tmrid = x.targetModuleRevisionId - (tmrid.getOrganisation, - tmrid.getName, - tmrid.getRevision + "_" + mrid.getName, - scalaVersion(tmrid), - sbtVersion(tmrid)) + ( + tmrid.getOrganisation, + tmrid.getName, + tmrid.getRevision + "_" + mrid.getName, + scalaVersion(tmrid), + sbtVersion(tmrid) + ) case _ => (mrid.getOrganisation, mrid.getName, mrid.getRevision, scalaVersion(mrid), sbtVersion(mrid)) } @@ -328,7 +330,9 @@ private[sbt] trait CachedResolutionResolveEngine extends ResolveEngine { val ivy = makeInstance ivy.pushContext() ivy.getLoggerEngine.pushLogger(log) - try { f(ivy) } finally { + try { + f(ivy) + } finally { ivy.getLoggerEngine.popLogger() ivy.popContext() } @@ -336,7 +340,11 @@ private[sbt] trait CachedResolutionResolveEngine extends ResolveEngine { def withDefaultLogger[A](log: MessageLogger)(f: => A): A = { val originalLogger = Message.getDefaultLogger Message.setDefaultLogger(log) - try { f } finally { Message.setDefaultLogger(originalLogger) } + try { + f + } finally { + Message.setDefaultLogger(originalLogger) + } } /** @@ -488,8 +496,10 @@ private[sbt] trait CachedResolutionResolveEngine extends ResolveEngine { case (failed, paths) => if (paths.isEmpty) (failed, paths) else - (failed, - List(IvyRetrieve.toModuleID(md0.getResolvedModuleRevisionId)) ::: paths.toList.tail) + ( + failed, + List(IvyRetrieve.toModuleID(md0.getResolvedModuleRevisionId)) ::: paths.toList.tail + ) } } new ResolveException(messages, failed, ListMap(failedPaths: _*)) @@ -577,8 +587,9 @@ private[sbt] trait CachedResolutionResolveEngine extends ResolveEngine { ((organization, name), xs) }: _*) // this returns a List of Lists of (org, name). should be deterministic - def detectLoops(allModules: Map[(String, String), Vector[OrganizationArtifactReport]]) - : List[List[(String, String)]] = { + def detectLoops( + allModules: Map[(String, String), Vector[OrganizationArtifactReport]] + ): List[List[(String, String)]] = { val loopSets: mutable.Set[Set[(String, String)]] = mutable.Set.empty val loopLists: mutable.ListBuffer[List[(String, String)]] = mutable.ListBuffer.empty def testLoop( @@ -949,8 +960,9 @@ private[sbt] trait CachedResolutionResolveEngine extends ResolveEngine { val configurations0: Vector[ConfigurationReport] = ur.configurations.toVector // This is how md looks from md0 via dd's mapping. val remappedConfigs0: Map[String, Vector[String]] = Map(rootModuleConfs map { conf0 => - val remapped - : Vector[String] = dd.getDependencyConfigurations(conf0.getName).toVector flatMap { conf => + val remapped: Vector[String] = dd + .getDependencyConfigurations(conf0.getName) + .toVector flatMap { conf => node.getRealConfs(conf).toVector } conf0.getName -> remapped diff --git a/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/GigahorseUrlHandler.scala b/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/GigahorseUrlHandler.scala index f90aa133f..72c7c58b4 100644 --- a/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/GigahorseUrlHandler.scala +++ b/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/GigahorseUrlHandler.scala @@ -52,12 +52,16 @@ class GigahorseUrlHandler(http: OkHttpClient) extends AbstractURLHandler { if (checkStatusCode(url, response)) { val bodyCharset = BasicURLHandler.getCharSetFromContentType( - Option(response.body().contentType()).map(_.toString).orNull) + Option(response.body().contentType()).map(_.toString).orNull + ) Some( - new SbtUrlInfo(true, - response.body().contentLength(), - lastModifiedTimestamp(response), - bodyCharset)) + new SbtUrlInfo( + true, + response.body().contentLength(), + lastModifiedTimestamp(response), + bodyCharset + ) + ) } else None // // Commented out for now - can potentially be used for non HTTP urls @@ -75,7 +79,8 @@ class GigahorseUrlHandler(http: OkHttpClient) extends AbstractURLHandler { Message.warn("Host " + e.getMessage + " not found. url=" + url) Message.info( "You probably access the destination server through " - + "a proxy server that is not well configured.") + + "a proxy server that is not well configured." + ) None case e: IOException => Message.error("Server access Error: " + e.getMessage + " url=" + url) @@ -106,7 +111,8 @@ class GigahorseUrlHandler(http: OkHttpClient) extends AbstractURLHandler { if (!checkStatusCode(url, response)) { throw new IOException( "The HTTP response code for " + url + " did not indicate a success." - + " See log for more detail.") + + " See log for more detail." + ) } response } catch { @@ -145,7 +151,8 @@ class GigahorseUrlHandler(http: OkHttpClient) extends AbstractURLHandler { IO.delete(dest) throw new IOException( "Downloaded file size doesn't match expected Content Length for " + url - + ". Please retry.") + + ". Please retry." + ) } val lastModified = lastModifiedTimestamp(response) @@ -198,11 +205,12 @@ class GigahorseUrlHandler(http: OkHttpClient) extends AbstractURLHandler { object GigahorseUrlHandler { // This is requires to access the constructor of URLInfo. - private[sbt] class SbtUrlInfo(available: Boolean, - contentLength: Long, - lastModified: Long, - bodyCharset: String) - extends URLInfo(available, contentLength, lastModified, bodyCharset) { + private[sbt] class SbtUrlInfo( + available: Boolean, + contentLength: Long, + lastModified: Long, + bodyCharset: String + ) extends URLInfo(available, contentLength, lastModified, bodyCharset) { def this(available: Boolean, contentLength: Long, lastModified: Long) = { this(available, contentLength, lastModified, null) } @@ -220,7 +228,8 @@ object GigahorseUrlHandler { Message.warn("Your proxy requires authentication.") } else if (status == 401) { Message.warn( - "CLIENT ERROR: 401 Unauthorized. Check your resolvers username and password.") + "CLIENT ERROR: 401 Unauthorized. Check your resolvers username and password." + ) } else if (String.valueOf(status).startsWith("4")) { Message.verbose("CLIENT ERROR: " + response.message() + " url=" + url) } else if (String.valueOf(status).startsWith("5")) { diff --git a/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/ParallelResolveEngine.scala b/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/ParallelResolveEngine.scala index d5107f2aa..cac26e395 100644 --- a/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/ParallelResolveEngine.scala +++ b/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/ParallelResolveEngine.scala @@ -14,9 +14,11 @@ import org.apache.ivy.util.filter.Filter import scala.concurrent.duration.Duration import scala.concurrent.{ Await, ExecutionContext, Future } -private[ivyint] case class DownloadResult(dep: IvyNode, - report: DownloadReport, - totalSizeDownloaded: Long) +private[ivyint] case class DownloadResult( + dep: IvyNode, + report: DownloadReport, + totalSizeDownloaded: Long +) object ParallelResolveEngine { private lazy val resolveExecutionContext: ExecutionContext = { @@ -28,14 +30,17 @@ object ParallelResolveEngine { } /** Define an ivy [[ResolveEngine]] that resolves dependencies in parallel. */ -private[sbt] class ParallelResolveEngine(settings: ResolveEngineSettings, - eventManager: EventManager, - sortEngine: SortEngine) - extends ResolveEngine(settings, eventManager, sortEngine) { +private[sbt] class ParallelResolveEngine( + settings: ResolveEngineSettings, + eventManager: EventManager, + sortEngine: SortEngine +) extends ResolveEngine(settings, eventManager, sortEngine) { - override def downloadArtifacts(report: ResolveReport, - artifactFilter: Filter, - options: DownloadOptions): Unit = { + override def downloadArtifacts( + report: ResolveReport, + artifactFilter: Filter, + options: DownloadOptions + ): Unit = { import scala.collection.JavaConverters._ val start = System.currentTimeMillis report.getArtifacts match { @@ -82,9 +87,11 @@ private[sbt] class ParallelResolveEngine(settings: ResolveEngineSettings, * * Return the report and the total downloaded size. */ - private def downloadNodeArtifacts(dependency: IvyNode, - artifactFilter: Filter, - options: DownloadOptions): DownloadResult = { + private def downloadNodeArtifacts( + dependency: IvyNode, + artifactFilter: Filter, + options: DownloadOptions + ): DownloadResult = { val resolver = dependency.getModuleRevision.getArtifactResolver val selectedArtifacts = dependency.getSelectedArtifacts(artifactFilter) diff --git a/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/SbtChainResolver.scala b/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/SbtChainResolver.scala index 517c26682..2314838ef 100644 --- a/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/SbtChainResolver.scala +++ b/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/SbtChainResolver.scala @@ -94,9 +94,11 @@ private[sbt] case class SbtChainResolver( /** Implements the custom sbt chain resolution with support for snapshots and caching. */ private object CustomSbtResolution { - def getCached(dd: DependencyDescriptor, - data: ResolveData, - resolved0: Option[ResolvedModuleRevision]): Option[ResolvedModuleRevision] = { + def getCached( + dd: DependencyDescriptor, + data: ResolveData, + resolved0: Option[ResolvedModuleRevision] + ): Option[ResolvedModuleRevision] = { resolved0.orElse { val resolverName = getName Message.verbose(s"$resolverName: Checking cache for: $dd") @@ -144,7 +146,8 @@ private[sbt] case class SbtChainResolver( var currentlyResolved = resolved0 def performResolution( - resolver: DependencyResolver): Option[(ResolvedModuleRevision, DependencyResolver)] = { + resolver: DependencyResolver + ): Option[(ResolvedModuleRevision, DependencyResolver)] = { // Resolve all resolvers when the module is changing val previouslyResolved = currentlyResolved if (useLatest) data.setCurrentResolvedModuleRevision(null) @@ -152,8 +155,9 @@ private[sbt] case class SbtChainResolver( currentlyResolved = Option(resolver.getDependency(descriptor, data)) if (currentlyResolved eq previouslyResolved) None else if (useLatest) { - currentlyResolved.map(x => - (reparseModuleDescriptor(descriptor, data, resolver, x), resolver)) + currentlyResolved.map( + x => (reparseModuleDescriptor(descriptor, data, resolver, x), resolver) + ) } else currentlyResolved.map(x => (forcedRevision(x), resolver)) } @@ -179,9 +183,11 @@ private[sbt] case class SbtChainResolver( } private final val prefix = "Undefined resolution order" - def resolveLatest(foundRevisions: Seq[(ResolvedModuleRevision, DependencyResolver)], - descriptor: DependencyDescriptor, - data: ResolveData): Option[ResolvedModuleRevision] = { + def resolveLatest( + foundRevisions: Seq[(ResolvedModuleRevision, DependencyResolver)], + descriptor: DependencyDescriptor, + data: ResolveData + ): Option[ResolvedModuleRevision] = { val sortedRevisions = foundRevisions.sortBy { case (rmr, resolver) => @@ -220,13 +226,15 @@ private[sbt] case class SbtChainResolver( if (resolvedModule.getId.getRevision.contains("SNAPSHOT")) { Message.warn( - "Resolving a snapshot version. It's going to be slow unless you use `updateOptions := updateOptions.value.withLatestSnapshots(false)` options.") + "Resolving a snapshot version. It's going to be slow unless you use `updateOptions := updateOptions.value.withLatestSnapshots(false)` options." + ) val resolvers = sortedRevisions.map(_._2.getName) sortedRevisions.foreach(h => { val (module, resolver) = h Message.info( s"Out of ${sortedRevisions.size} candidates we found for ${module.getId} in ${resolvers - .mkString(" and ")}, we are choosing ${resolver}.") + .mkString(" and ")}, we are choosing ${resolver}." + ) }) } else { Message.warn(s"Choosing $resolver for ${resolvedModule.getId}") diff --git a/ivy/src/main/scala/sbt/librarymanagement/ivy/IvyDependencyResolution.scala b/ivy/src/main/scala/sbt/librarymanagement/ivy/IvyDependencyResolution.scala index 1b93bacf7..bc72f4bc2 100644 --- a/ivy/src/main/scala/sbt/librarymanagement/ivy/IvyDependencyResolution.scala +++ b/ivy/src/main/scala/sbt/librarymanagement/ivy/IvyDependencyResolution.scala @@ -14,10 +14,12 @@ class IvyDependencyResolution private[sbt] (val ivySbt: IvySbt) new Module(moduleSetting) } - override def update(module: ModuleDescriptor, - configuration: UpdateConfiguration, - uwconfig: UnresolvedWarningConfiguration, - log: Logger): Either[UnresolvedWarning, UpdateReport] = + override def update( + module: ModuleDescriptor, + configuration: UpdateConfiguration, + uwconfig: UnresolvedWarningConfiguration, + log: Logger + ): Either[UnresolvedWarning, UpdateReport] = IvyActions.updateEither(toModule(module), configuration, uwconfig, log) private[sbt] def toModule(module: ModuleDescriptor): Module = diff --git a/ivy/src/main/scala/sbt/librarymanagement/ivy/IvyPublisher.scala b/ivy/src/main/scala/sbt/librarymanagement/ivy/IvyPublisher.scala index 643ef7c32..dc15ba7a9 100644 --- a/ivy/src/main/scala/sbt/librarymanagement/ivy/IvyPublisher.scala +++ b/ivy/src/main/scala/sbt/librarymanagement/ivy/IvyPublisher.scala @@ -14,14 +14,18 @@ class IvyPublisher private[sbt] (val ivySbt: IvySbt) extends PublisherInterface new Module(moduleSetting) } - override def makePomFile(module: ModuleDescriptor, - configuration: MakePomConfiguration, - log: Logger): File = + override def makePomFile( + module: ModuleDescriptor, + configuration: MakePomConfiguration, + log: Logger + ): File = IvyActions.makePomFile(toModule(module), configuration, log) - override def publish(module: ModuleDescriptor, - configuration: PublishConfiguration, - log: Logger): Unit = + override def publish( + module: ModuleDescriptor, + configuration: PublishConfiguration, + log: Logger + ): Unit = IvyActions.publish(toModule(module), configuration, log) private[sbt] def toModule(module: ModuleDescriptor): Module = diff --git a/ivy/src/main/scala/sbt/librarymanagement/ivy/formats/UpdateOptionsFormat.scala b/ivy/src/main/scala/sbt/librarymanagement/ivy/formats/UpdateOptionsFormat.scala index db0e83789..fc71dee26 100644 --- a/ivy/src/main/scala/sbt/librarymanagement/ivy/formats/UpdateOptionsFormat.scala +++ b/ivy/src/main/scala/sbt/librarymanagement/ivy/formats/UpdateOptionsFormat.scala @@ -27,7 +27,7 @@ trait UpdateOptionsFormat { self: BasicJsonProtocol with ModuleIDFormats with Re uo.cachedResolution, uo.gigahorse, uo.moduleResolvers - ), + ), (xs: (String, Boolean, Boolean, Boolean, Boolean, Map[ModuleID, Resolver])) => new UpdateOptions( levels(xs._1), @@ -37,7 +37,7 @@ trait UpdateOptionsFormat { self: BasicJsonProtocol with ModuleIDFormats with Re xs._5, PartialFunction.empty, xs._6 - ) + ) ) private val levels: Map[String, CircularDependencyLevel] = Map( diff --git a/ivy/src/test/scala/sbt/internal/librarymanagement/BaseCachedResolutionSpec.scala b/ivy/src/test/scala/sbt/internal/librarymanagement/BaseCachedResolutionSpec.scala index f53454c5f..53ad0ba09 100644 --- a/ivy/src/test/scala/sbt/internal/librarymanagement/BaseCachedResolutionSpec.scala +++ b/ivy/src/test/scala/sbt/internal/librarymanagement/BaseCachedResolutionSpec.scala @@ -4,9 +4,11 @@ import sbt.librarymanagement._ import sbt.librarymanagement.ivy._ trait BaseCachedResolutionSpec extends BaseIvySpecification { - override def module(moduleId: ModuleID, - deps: Vector[ModuleID], - scalaFullVersion: Option[String]): ModuleDescriptor = { + override def module( + moduleId: ModuleID, + deps: Vector[ModuleID], + scalaFullVersion: Option[String] + ): ModuleDescriptor = { val uo: UpdateOptions = UpdateOptions() .withCachedResolution(true) module(moduleId, deps, scalaFullVersion, uo, true) diff --git a/ivy/src/test/scala/sbt/internal/librarymanagement/BaseIvySpecification.scala b/ivy/src/test/scala/sbt/internal/librarymanagement/BaseIvySpecification.scala index f6add3e61..304412069 100644 --- a/ivy/src/test/scala/sbt/internal/librarymanagement/BaseIvySpecification.scala +++ b/ivy/src/test/scala/sbt/internal/librarymanagement/BaseIvySpecification.scala @@ -24,17 +24,21 @@ trait BaseIvySpecification extends AbstractEngineSpec { def configurations = Vector(Compile, Test, Runtime) - def module(moduleId: ModuleID, - deps: Vector[ModuleID], - scalaFullVersion: Option[String]): ModuleDescriptor = { + def module( + moduleId: ModuleID, + deps: Vector[ModuleID], + scalaFullVersion: Option[String] + ): ModuleDescriptor = { module(moduleId, deps, scalaFullVersion, UpdateOptions(), true) } - def module(moduleId: ModuleID, - deps: Vector[ModuleID], - scalaFullVersion: Option[String], - uo: UpdateOptions = UpdateOptions(), - overrideScalaVersion: Boolean = true): IvySbt#Module = { + def module( + moduleId: ModuleID, + deps: Vector[ModuleID], + scalaFullVersion: Option[String], + uo: UpdateOptions = UpdateOptions(), + overrideScalaVersion: Boolean = true + ): IvySbt#Module = { val scalaModuleInfo = scalaFullVersion map { fv => ScalaModuleInfo( scalaFullVersion = fv, @@ -71,8 +75,10 @@ trait BaseIvySpecification extends AbstractEngineSpec { .withUpdateOptions(uo) } - def makeUpdateConfiguration(offline: Boolean, - metadataDirectory: Option[File]): UpdateConfiguration = { + def makeUpdateConfiguration( + offline: Boolean, + metadataDirectory: Option[File] + ): UpdateConfiguration = { val retrieveConfig = RetrieveConfiguration() .withRetrieveDirectory(currentManaged) .withOutputPattern(Resolver.defaultRetrievePattern) @@ -108,8 +114,10 @@ trait BaseIvySpecification extends AbstractEngineSpec { def ivyUpdate(module: ModuleDescriptor): UpdateReport = update(module) - def mkPublishConfiguration(resolver: Resolver, - artifacts: Map[Artifact, File]): PublishConfiguration = { + def mkPublishConfiguration( + resolver: Resolver, + artifacts: Map[Artifact, File] + ): PublishConfiguration = { PublishConfiguration() .withResolverName(resolver.name) .withArtifacts(artifacts.toVector) diff --git a/ivy/src/test/scala/sbt/internal/librarymanagement/ComponentManagerTest.scala b/ivy/src/test/scala/sbt/internal/librarymanagement/ComponentManagerTest.scala index 4cc452755..2a9f3f675 100644 --- a/ivy/src/test/scala/sbt/internal/librarymanagement/ComponentManagerTest.scala +++ b/ivy/src/test/scala/sbt/internal/librarymanagement/ComponentManagerTest.scala @@ -67,7 +67,9 @@ class ComponentManagerTest extends UnitSpec { withManagerHome(ivyHome) { usingManager => checksum(usingManager.file(TestID)(Fail)) shouldBe hash } - } finally { definingManager.clearCache(TestID) } + } finally { + definingManager.clearCache(TestID) + } } } } @@ -82,7 +84,8 @@ class ComponentManagerTest extends UnitSpec { private def createFile[T](manager: ComponentManager, id: String, name: String)(f: File => T): T = createFiles(manager, id, name)(files => f(files.toList.head)) private def createFiles[T](manager: ComponentManager, id: String, names: String*)( - f: Seq[File] => T): T = + f: Seq[File] => T + ): T = withTemporaryDirectory { dir => val files = names.map(name => new File(dir, name)) files.foreach(writeRandomContent) @@ -113,7 +116,8 @@ class ComponentManagerTest extends UnitSpec { val location = componentLocation(id) if (location.exists) throw new RuntimeException( - s"Cannot redefine component. ID: $id, files: ${files.mkString(",")}") + s"Cannot redefine component. ID: $id, files: ${files.mkString(",")}" + ) else { IO.copy(files.map { f => f -> new java.io.File(location, f.getName) diff --git a/ivy/src/test/scala/sbt/internal/librarymanagement/DMSerializationSpec.scala b/ivy/src/test/scala/sbt/internal/librarymanagement/DMSerializationSpec.scala index f5c6379b8..586b04531 100644 --- a/ivy/src/test/scala/sbt/internal/librarymanagement/DMSerializationSpec.scala +++ b/ivy/src/test/scala/sbt/internal/librarymanagement/DMSerializationSpec.scala @@ -51,14 +51,18 @@ class DMSerializationSpec extends UnitSpec { } lazy val updateReportExample = - UpdateReport(new File("./foo"), - Vector(configurationReportExample), - UpdateStats(0, 0, 0, false), - Map(new File("./foo") -> 0)) + UpdateReport( + new File("./foo"), + Vector(configurationReportExample), + UpdateStats(0, 0, 0, false), + Map(new File("./foo") -> 0) + ) lazy val configurationReportExample = - ConfigurationReport(ConfigRef("compile"), - Vector(moduleReportExample), - Vector(organizationArtifactReportExample)) + ConfigurationReport( + ConfigRef("compile"), + Vector(moduleReportExample), + Vector(organizationArtifactReportExample) + ) lazy val organizationArtifactReportExample = OrganizationArtifactReport("org", "name", Vector(moduleReportExample)) lazy val moduleReportExample = diff --git a/ivy/src/test/scala/sbt/internal/librarymanagement/EvictionWarningSpec.scala b/ivy/src/test/scala/sbt/internal/librarymanagement/EvictionWarningSpec.scala index 106a0e87f..3a90fc05a 100644 --- a/ivy/src/test/scala/sbt/internal/librarymanagement/EvictionWarningSpec.scala +++ b/ivy/src/test/scala/sbt/internal/librarymanagement/EvictionWarningSpec.scala @@ -62,7 +62,8 @@ class EvictionWarningSpec extends BaseIvySpecification { val m2 = "org.scala-sbt" % "util-logging_2.12" % "1.1.0" assert( EvictionWarningOptions - .defaultGuess((m1, Option(m2), Option(dummyScalaModuleInfo("2.12.4"))))) + .defaultGuess((m1, Option(m2), Option(dummyScalaModuleInfo("2.12.4")))) + ) } def akkaActor214 = diff --git a/ivy/src/test/scala/sbt/internal/librarymanagement/FrozenModeSpec.scala b/ivy/src/test/scala/sbt/internal/librarymanagement/FrozenModeSpec.scala index c6c18c6cf..c6620bee7 100644 --- a/ivy/src/test/scala/sbt/internal/librarymanagement/FrozenModeSpec.scala +++ b/ivy/src/test/scala/sbt/internal/librarymanagement/FrozenModeSpec.scala @@ -49,7 +49,9 @@ class FrozenModeSpec extends BaseIvySpecification { val toExplicitResolve = module(defaultModuleId, explicitStoml, None, normalOptions) val frozenResolution = update(toExplicitResolve, frozenConf) assert(frozenResolution.isRight) - assert(frozenResolution.right.get.allModules.size == numberResolved, - s"The number of explicit modules in frozen mode should be equal than $numberResolved") + assert( + frozenResolution.right.get.allModules.size == numberResolved, + s"The number of explicit modules in frozen mode should be equal than $numberResolved" + ) } } diff --git a/ivy/src/test/scala/sbt/internal/librarymanagement/IvyRepoSpec.scala b/ivy/src/test/scala/sbt/internal/librarymanagement/IvyRepoSpec.scala index 2117e8c89..468b9fef6 100644 --- a/ivy/src/test/scala/sbt/internal/librarymanagement/IvyRepoSpec.scala +++ b/ivy/src/test/scala/sbt/internal/librarymanagement/IvyRepoSpec.scala @@ -61,19 +61,23 @@ class IvyRepoSpec extends BaseIvySpecification { val clMod = { val externalModules = Vector(dep) // Note: need to extract ourModuleID so we can plug it in here, can't fish it back out of the IvySbt#Module (`m`) - GetClassifiersModule(ourModuleID, - scalaModuleInfo, - externalModules, - Vector(Configurations.Compile), - attemptedClassifiers) + GetClassifiersModule( + ourModuleID, + scalaModuleInfo, + externalModules, + Vector(Configurations.Compile), + attemptedClassifiers + ) } val artifactFilter = getArtifactTypeFilter(c.artifactFilter) - val gcm = GetClassifiersConfiguration(clMod, - Vector.empty, - c.withArtifactFilter(artifactFilter.invert), - srcTypes, - docTypes) + val gcm = GetClassifiersConfiguration( + clMod, + Vector.empty, + c.withArtifactFilter(artifactFilter.invert), + srcTypes, + docTypes + ) val report2 = lmEngine() diff --git a/ivy/src/test/scala/sbt/internal/librarymanagement/ScalaOverrideTest.scala b/ivy/src/test/scala/sbt/internal/librarymanagement/ScalaOverrideTest.scala index cbc5765c0..3dcfff33f 100644 --- a/ivy/src/test/scala/sbt/internal/librarymanagement/ScalaOverrideTest.scala +++ b/ivy/src/test/scala/sbt/internal/librarymanagement/ScalaOverrideTest.scala @@ -25,51 +25,81 @@ class ScalaOverrideTest extends UnitSpec { } """OverrideScalaMediator - """ should "Override compiler version" in check(Organization, "2.11.8")(Organization, - CompilerID, - "2.11.9") - it should "Override library version" in check(Organization, "2.11.8")(Organization, - LibraryID, - "2.11.8") - it should "Override reflect version" in check(Organization, "2.11.8")(Organization, - ReflectID, - "2.11.7") - it should "Override actors version" in check(Organization, "2.11.8")(Organization, - ActorsID, - "2.11.6") - it should "Override scalap version" in check(Organization, "2.11.8")(Organization, - ScalapID, - "2.11.5") + """ should "Override compiler version" in check(Organization, "2.11.8")( + Organization, + CompilerID, + "2.11.9" + ) + it should "Override library version" in check(Organization, "2.11.8")( + Organization, + LibraryID, + "2.11.8" + ) + it should "Override reflect version" in check(Organization, "2.11.8")( + Organization, + ReflectID, + "2.11.7" + ) + it should "Override actors version" in check(Organization, "2.11.8")( + Organization, + ActorsID, + "2.11.6" + ) + it should "Override scalap version" in check(Organization, "2.11.8")( + Organization, + ScalapID, + "2.11.5" + ) - it should "Override default compiler organization" in check(OtherOrgID, "2.11.8")(Organization, - CompilerID, - "2.11.9") - it should "Override default library organization" in check(OtherOrgID, "2.11.8")(Organization, - LibraryID, - "2.11.8") - it should "Override default reflect organization" in check(OtherOrgID, "2.11.8")(Organization, - ReflectID, - "2.11.7") - it should "Override default actors organization" in check(OtherOrgID, "2.11.8")(Organization, - ActorsID, - "2.11.6") - it should "Override default scalap organization" in check(OtherOrgID, "2.11.8")(Organization, - ScalapID, - "2.11.5") + it should "Override default compiler organization" in check(OtherOrgID, "2.11.8")( + Organization, + CompilerID, + "2.11.9" + ) + it should "Override default library organization" in check(OtherOrgID, "2.11.8")( + Organization, + LibraryID, + "2.11.8" + ) + it should "Override default reflect organization" in check(OtherOrgID, "2.11.8")( + Organization, + ReflectID, + "2.11.7" + ) + it should "Override default actors organization" in check(OtherOrgID, "2.11.8")( + Organization, + ActorsID, + "2.11.6" + ) + it should "Override default scalap organization" in check(OtherOrgID, "2.11.8")( + Organization, + ScalapID, + "2.11.5" + ) - it should "Override custom compiler organization" in check(Organization, "2.11.8")(OtherOrgID, - CompilerID, - "2.11.9") - it should "Override custom library organization" in check(Organization, "2.11.8")(OtherOrgID, - LibraryID, - "2.11.8") - it should "Override custom reflect organization" in check(Organization, "2.11.8")(OtherOrgID, - ReflectID, - "2.11.7") - it should "Override custom actors organization" in check(Organization, "2.11.8")(OtherOrgID, - ActorsID, - "2.11.6") - it should "Override custom scalap organization" in check(Organization, "2.11.8")(OtherOrgID, - ScalapID, - "2.11.5") + it should "Override custom compiler organization" in check(Organization, "2.11.8")( + OtherOrgID, + CompilerID, + "2.11.9" + ) + it should "Override custom library organization" in check(Organization, "2.11.8")( + OtherOrgID, + LibraryID, + "2.11.8" + ) + it should "Override custom reflect organization" in check(Organization, "2.11.8")( + OtherOrgID, + ReflectID, + "2.11.7" + ) + it should "Override custom actors organization" in check(Organization, "2.11.8")( + OtherOrgID, + ActorsID, + "2.11.6" + ) + it should "Override custom scalap organization" in check(Organization, "2.11.8")( + OtherOrgID, + ScalapID, + "2.11.5" + ) }