diff --git a/librarymanagement/src/main/scala/sbt/internal/librarymanagement/Ivy.scala b/librarymanagement/src/main/scala/sbt/internal/librarymanagement/Ivy.scala
index 467e9d137..f6d449c4a 100644
--- a/librarymanagement/src/main/scala/sbt/internal/librarymanagement/Ivy.scala
+++ b/librarymanagement/src/main/scala/sbt/internal/librarymanagement/Ivy.scala
@@ -140,8 +140,8 @@ final class IvySbt(val configuration: IvyConfiguration) {
/**
* Cleans cached resolution cache.
- *
- * @param md - module descriptor of the original Ivy graph.
+ *
+ * @param md - module descriptor of the original Ivy graph.
*/
private[sbt] def cleanCachedResolutionCache(md: ModuleDescriptor, log: Logger): Unit =
withIvy(log) { i =>
diff --git a/librarymanagement/src/main/scala/sbt/internal/librarymanagement/IvyActions.scala b/librarymanagement/src/main/scala/sbt/internal/librarymanagement/IvyActions.scala
index 8d43601fe..8fc1d4866 100644
--- a/librarymanagement/src/main/scala/sbt/internal/librarymanagement/IvyActions.scala
+++ b/librarymanagement/src/main/scala/sbt/internal/librarymanagement/IvyActions.scala
@@ -251,14 +251,14 @@ object IvyActions {
updateClassifiers(ivySbt, config, UnresolvedWarningConfiguration(), LogicalClock.unknown, None, Vector(), log)
/**
- * Creates explicit artifacts for each classifier in `config.module`, and then attempts to resolve them directly. This
- * is for Maven compatibility, where these artifacts are not "published" in the POM, so they don't end up in the Ivy
- * that sbt generates for them either.
- * Artifacts can be obtained from calling toSeq on UpdateReport.
- * In addition, retrieves specific Ivy artifacts if they have one of the requested `config.configuration.types`.
- * @param config important to set `config.configuration.types` to only allow artifact types that can correspond to
- * "classified" artifacts (sources and javadocs).
- */
+ * Creates explicit artifacts for each classifier in `config.module`, and then attempts to resolve them directly. This
+ * is for Maven compatibility, where these artifacts are not "published" in the POM, so they don't end up in the Ivy
+ * that sbt generates for them either.
+ * Artifacts can be obtained from calling toSeq on UpdateReport.
+ * In addition, retrieves specific Ivy artifacts if they have one of the requested `config.configuration.types`.
+ * @param config important to set `config.configuration.types` to only allow artifact types that can correspond to
+ * "classified" artifacts (sources and javadocs).
+ */
private[sbt] def updateClassifiers(ivySbt: IvySbt, config: GetClassifiersConfiguration,
uwconfig: UnresolvedWarningConfiguration, logicalClock: LogicalClock, depDir: Option[File],
artifacts: Vector[(String, ModuleID, Artifact, File)],
@@ -283,9 +283,10 @@ object IvyActions {
((sourceArtifactTypes.toIterable map (_ -> Artifact.SourceClassifier))
:: (docArtifactTypes.toIterable map (_ -> Artifact.DocClassifier)) :: Nil).flatten.toMap
r.substitute { (conf, mid, artFileSeq) =>
- artFileSeq map { case (art, f) =>
- // Deduce the classifier from the type if no classifier is present already
- art.copy(classifier = art.classifier orElse typeClassifierMap.get(art.`type`)) -> f
+ artFileSeq map {
+ case (art, f) =>
+ // Deduce the classifier from the type if no classifier is present already
+ art.copy(classifier = art.classifier orElse typeClassifierMap.get(art.`type`)) -> f
}
}
case Left(w) =>
@@ -318,18 +319,18 @@ object IvyActions {
}
/**
- * Explicitly set an "include all" rule (the default) because otherwise, if we declare ANY explicitArtifacts,
- * [[org.apache.ivy.core.resolve.IvyNode#getArtifacts]] (in Ivy 2.3.0-rc1) will not merge in the descriptor's
- * artifacts and will only keep the explicitArtifacts.
- *
- * Look for the comment saying {{{
- * // and now we filter according to include rules
- * }}}
- * in `IvyNode`, which iterates on `includes`, which will ordinarily be empty because higher up, in {{{
- * addAllIfNotNull(includes, usage.getDependencyIncludesSet(rootModuleConf));
- * }}}
- * `usage.getDependencyIncludesSet` returns null if there are no (explicit) include rules.
- */
+ * Explicitly set an "include all" rule (the default) because otherwise, if we declare ANY explicitArtifacts,
+ * [[org.apache.ivy.core.resolve.IvyNode#getArtifacts]] (in Ivy 2.3.0-rc1) will not merge in the descriptor's
+ * artifacts and will only keep the explicitArtifacts.
+ *
+ * Look for the comment saying {{{
+ * // and now we filter according to include rules
+ * }}}
+ * in `IvyNode`, which iterates on `includes`, which will ordinarily be empty because higher up, in {{{
+ * addAllIfNotNull(includes, usage.getDependencyIncludesSet(rootModuleConf));
+ * }}}
+ * `usage.getDependencyIncludesSet` returns null if there are no (explicit) include rules.
+ */
private def intransitiveModuleWithExplicitArts(module: ModuleID, arts: Seq[Artifact]): ModuleID =
module.copy(isTransitive = false, explicitArtifacts = arts, inclusions = InclExclRule.everything :: Nil)
diff --git a/librarymanagement/src/main/scala/sbt/librarymanagement/Artifact.scala b/librarymanagement/src/main/scala/sbt/librarymanagement/Artifact.scala
index b5b209bcb..8bf97bc05 100644
--- a/librarymanagement/src/main/scala/sbt/librarymanagement/Artifact.scala
+++ b/librarymanagement/src/main/scala/sbt/librarymanagement/Artifact.scala
@@ -30,23 +30,23 @@ object Artifact {
def javadoc(name: String) = classified(name, DocClassifier)
def pom(name: String) = Artifact(name, PomType, PomType, None, Pom :: Nil, None)
- // Possible ivy artifact types such that sbt will treat those artifacts at sources / docs
- val DefaultSourceTypes = Set("src", "source", "sources")
- val DefaultDocTypes = Set("doc", "docs", "javadoc", "javadocs")
+ // Possible ivy artifact types such that sbt will treat those artifacts at sources / docs
+ val DefaultSourceTypes = Set("src", "source", "sources")
+ val DefaultDocTypes = Set("doc", "docs", "javadoc", "javadocs")
- val DocClassifier = "javadoc"
- val SourceClassifier = "sources"
+ val DocClassifier = "javadoc"
+ val SourceClassifier = "sources"
- val TestsClassifier = "tests"
- // Artifact types used when:
- // * artifacts are explicitly created for Maven dependency resolution (see updateClassifiers)
- // * declaring artifacts as part of creating Ivy files.
- val DocType = "doc"
- val SourceType = "src"
- val PomType = "pom"
+ val TestsClassifier = "tests"
+ // Artifact types used when:
+ // * artifacts are explicitly created for Maven dependency resolution (see updateClassifiers)
+ // * declaring artifacts as part of creating Ivy files.
+ val DocType = "doc"
+ val SourceType = "src"
+ val PomType = "pom"
- assert (DefaultDocTypes contains DocType)
- assert (DefaultSourceTypes contains SourceType)
+ assert(DefaultDocTypes contains DocType)
+ assert(DefaultSourceTypes contains SourceType)
def extract(url: URL, default: String): String = extract(url.toString, default)
def extract(name: String, default: String): String =
@@ -73,22 +73,24 @@ object Artifact {
base + "-" + module.revision + classifierStr + "." + artifact.extension
}
- val classifierTypeMap = Map(SourceClassifier -> SourceType, DocClassifier -> DocType)
- @deprecated("Configuration should not be decided from the classifier.", "1.0")
- def classifierConf(classifier: String): Configuration =
- if(classifier.startsWith(TestsClassifier))
- Test
- else
- Optional
- def classifierType(classifier: String): String = classifierTypeMap.getOrElse(classifier.stripPrefix(TestsClassifier + "-"), DefaultType)
+ val classifierTypeMap = Map(SourceClassifier -> SourceType, DocClassifier -> DocType)
+ @deprecated("Configuration should not be decided from the classifier.", "1.0")
+ def classifierConf(classifier: String): Configuration =
+ if (classifier.startsWith(TestsClassifier))
+ Test
+ else
+ Optional
+ def classifierType(classifier: String): String = classifierTypeMap.getOrElse(classifier.stripPrefix(TestsClassifier + "-"), DefaultType)
- /** Create a classified explicit artifact, to be used when trying to resolve sources|javadocs from Maven. This is
- * necessary because those artifacts are not published in the Ivy generated from the Pom of the module in question.
- * The artifact is created under the default configuration. */
- def classified(name: String, classifier: String): Artifact =
- Artifact(name, classifierType(classifier), DefaultExtension, Some(classifier), Nil, None)
+ /**
+ * Create a classified explicit artifact, to be used when trying to resolve sources|javadocs from Maven. This is
+ * necessary because those artifacts are not published in the Ivy generated from the Pom of the module in question.
+ * The artifact is created under the default configuration.
+ */
+ def classified(name: String, classifier: String): Artifact =
+ Artifact(name, classifierType(classifier), DefaultExtension, Some(classifier), Nil, None)
- private val optStringPickler = implicitly[Pickler[Option[String]]]
+ private val optStringPickler = implicitly[Pickler[Option[String]]]
private val optStringUnpickler = implicitly[Unpickler[Option[String]]]
private val vectorConfigurationPickler = implicitly[Pickler[Vector[Configuration]]]
private val vectorConfigurationUnpickler = implicitly[Unpickler[Vector[Configuration]]]
diff --git a/librarymanagement/src/main/scala/sbt/librarymanagement/IvyInterface.scala b/librarymanagement/src/main/scala/sbt/librarymanagement/IvyInterface.scala
index ed99f6bd1..964fe7447 100644
--- a/librarymanagement/src/main/scala/sbt/librarymanagement/IvyInterface.scala
+++ b/librarymanagement/src/main/scala/sbt/librarymanagement/IvyInterface.scala
@@ -9,7 +9,7 @@ import scala.xml.NodeSeq
import org.apache.ivy.plugins.resolver.{ DependencyResolver, IBiblioResolver }
import org.apache.ivy.util.url.CredentialsStore
import org.apache.ivy.core.module.descriptor
-import org.apache.ivy.util.filter.{Filter => IvyFilter}
+import org.apache.ivy.util.filter.{ Filter => IvyFilter }
import sbt.serialization._
/** Additional information about a project module */
@@ -27,12 +27,14 @@ final case class ScmInfo(browseUrl: URL, connection: String, devConnection: Opti
final case class Developer(id: String, name: String, email: String, url: URL)
-/** Rule to either:
- *