mirror of https://github.com/sbt/sbt.git
commit
575bc12e00
|
|
@ -79,8 +79,8 @@ private final class MergedDescriptors(a: DependencyDescriptor, b: DependencyDesc
|
|||
{
|
||||
if (as.isEmpty)
|
||||
if (bs.isEmpty) as
|
||||
else defaultArtifact(a) +: explicitConfigurations(b, bs)
|
||||
else if (bs.isEmpty) explicitConfigurations(a, as) :+ defaultArtifact(b)
|
||||
else defaultArtifact(a) ++ explicitConfigurations(b, bs)
|
||||
else if (bs.isEmpty) explicitConfigurations(a, as) ++ defaultArtifact(b)
|
||||
else concat(explicitConfigurations(a, as), explicitConfigurations(b, bs))
|
||||
}
|
||||
private[this] def explicitConfigurations(base: DependencyDescriptor, arts: Array[DependencyArtifactDescriptor]): Array[DependencyArtifactDescriptor] =
|
||||
|
|
@ -93,11 +93,14 @@ private final class MergedDescriptors(a: DependencyDescriptor, b: DependencyDesc
|
|||
else
|
||||
art
|
||||
}
|
||||
private[this] def defaultArtifact(a: DependencyDescriptor): DependencyArtifactDescriptor =
|
||||
private[this] def defaultArtifact(a: DependencyDescriptor): Array[DependencyArtifactDescriptor] =
|
||||
{
|
||||
val dd = new DefaultDependencyArtifactDescriptor(a, a.getDependencyRevisionId.getName, "jar", "jar", null, null)
|
||||
addConfigurations(dd, a.getModuleConfigurations)
|
||||
dd
|
||||
// If the dependency descriptor is empty, then it means that it has been created from a POM file. In this case,
|
||||
// it is correct to create a seemingly non-existent dependency artifact.
|
||||
if (a.getAllDependencyArtifacts.isEmpty) Array(dd)
|
||||
else a.getAllDependencyArtifacts filter (_ == dd)
|
||||
}
|
||||
private[this] def copyWithConfigurations(dd: DependencyArtifactDescriptor, confs: Seq[String]): DependencyArtifactDescriptor =
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
resolvers += Resolver.file("buggy", file("repo"))(
|
||||
Patterns(
|
||||
ivyPatterns = Seq("[organization]/[module]/[revision]/ivy.xml"),
|
||||
artifactPatterns = Seq("[organization]/[module]/[revision]/[artifact].[ext]"),
|
||||
isMavenCompatible = false,
|
||||
descriptorOptional = true,
|
||||
skipConsistencyCheck = true
|
||||
)
|
||||
)
|
||||
|
||||
libraryDependencies += "a" % "b" % "1.0.0" % "compile->runtime" artifacts(Artifact("b1", "jar", "jar"))
|
||||
libraryDependencies += "a" % "b" % "1.0.0" % "test->runtime" artifacts(Artifact("b1", "jar", "jar"))
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,14 @@
|
|||
<ivy-module xmlns:e="http://ant.apache.org/ivy/extra" version="2.0">
|
||||
<info organisation="a" module="b" revision="1.0.0" status="release" publication="20160201120702">
|
||||
<description>a</description>
|
||||
</info>
|
||||
<configurations>
|
||||
<conf name="runtime" description="..."/>
|
||||
</configurations>
|
||||
<publications>
|
||||
<artifact name="b1.jar" type="jar" ext="jar" conf="runtime"/>
|
||||
<artifact name="b2.jar" type="jar" ext="jar" conf="runtime"/>
|
||||
</publications>
|
||||
<dependencies>
|
||||
</dependencies>
|
||||
</ivy-module>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# Verify that we successfully get the artifacts.
|
||||
# This project depends on a module for which we cannot generate a "default artifact",
|
||||
# because no such artifact exists.
|
||||
|
||||
> update
|
||||
Loading…
Reference in New Issue