delete correct test for packaging="pom"

This commit is contained in:
Mark Harrah 2013-07-12 13:49:06 -04:00
parent 036156413d
commit a2ae2bc433
8 changed files with 25 additions and 23 deletions

View File

@ -1,3 +0,0 @@
class A {
val x = classOf[org.apache.velocity.Template]
}

View File

@ -1 +0,0 @@
libraryDependencies += "org.apache.velocity" % "velocity" % "1.7" intransitive()

View File

@ -1 +0,0 @@
libraryDependencies += "org.apache.velocity" % "velocity" % "1.5" intransitive() jar()

View File

@ -1 +0,0 @@
libraryDependencies += "org.apache.velocity" % "velocity" % "1.5" intransitive()

View File

@ -1 +0,0 @@
ivyPaths := new IvyPaths(baseDirectory.value, Some(target.value / "ivy-cache"))

View File

@ -1,16 +0,0 @@
# velocity 1.5, packaging=pom, but has a main jar
# this verifies that sbt does not retrieve it by default
$ copy-file changes/pkgpom.sbt dep.sbt
> reload
-> compile
# with an explicit jar(), sbt should know about it without
# needing to ping the repository
$ copy-file changes/pkgpom-explicit.sbt dep.sbt
> reload
> compile
# velocity 1.7, packaging=jar, so this should pull in a main jar as usual
$ copy-file changes/pkgjar.sbt dep.sbt
> reload
> compile

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object PomTest extends Build
{
override def settings = super.settings :+ (TaskKey[Unit]("check-pom") <<= checkPom)
lazy val subJar = Project("sub-jar", file("subJar"))
lazy val subWar = Project("sub-war", file("subWar")) settings( warArtifact)
lazy val subParent = Project("sub-parent", file("subParent")) settings( publishArtifact in Compile := false )
def art(p: ProjectReference) = makePom in p
def checkPom = (art(subJar), art(subWar), art(subParent)) map { (jar, war, pom) =>
checkPackaging(jar, "jar")
checkPackaging(war, "war")
checkPackaging(pom, "pom")
}
def checkPackaging(pom: File, expected: String) =
{
val packaging = (xml.XML.loadFile(pom) \\ "packaging").text
if(packaging != expected) error("Incorrect packaging for '" + pom + "'. Expected '" + expected + "', but got '" + packaging + "'")
}
def warArtifact = artifact in (Compile, packageBin) ~= { _.copy(`type` = "war", extension = "war") }
}

View File

@ -0,0 +1 @@
> check-pom