mirror of https://github.com/sbt/sbt.git
delete correct test for packaging="pom"
This commit is contained in:
parent
036156413d
commit
a2ae2bc433
|
|
@ -1,3 +0,0 @@
|
|||
class A {
|
||||
val x = classOf[org.apache.velocity.Template]
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
libraryDependencies += "org.apache.velocity" % "velocity" % "1.7" intransitive()
|
||||
|
|
@ -1 +0,0 @@
|
|||
libraryDependencies += "org.apache.velocity" % "velocity" % "1.5" intransitive() jar()
|
||||
|
|
@ -1 +0,0 @@
|
|||
libraryDependencies += "org.apache.velocity" % "velocity" % "1.5" intransitive()
|
||||
|
|
@ -1 +0,0 @@
|
|||
ivyPaths := new IvyPaths(baseDirectory.value, Some(target.value / "ivy-cache"))
|
||||
|
|
@ -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
|
||||
|
|
@ -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") }
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
> check-pom
|
||||
Loading…
Reference in New Issue