From fb64501c9b3c7e0f71146165105c2b1b2f85626c Mon Sep 17 00:00:00 2001 From: dmharrah Date: Sun, 2 Aug 2009 01:07:09 +0000 Subject: [PATCH] yet another 2.8 compatibility hack git-svn-id: https://simple-build-tool.googlecode.com/svn/trunk@932 d89573ee-9141-11dd-94d4-bdf5e562f29c --- src/main/scala/sbt/Webstart.scala | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/scala/sbt/Webstart.scala b/src/main/scala/sbt/Webstart.scala index e717ec026..3bb4c5727 100644 --- a/src/main/scala/sbt/Webstart.scala +++ b/src/main/scala/sbt/Webstart.scala @@ -211,7 +211,15 @@ private object WebstartScalaProject /** Writes the XML string 'xmlString' to the file 'outputPath' if the hashes are different.*/ private def writeXML(xml: Elem, outputPath: Path, log: Logger): Option[String] = { - val xmlString = scala.xml.Utility.toXML(xml, false) + val xmlString = + { + import scala.xml.Utility + implicit def another28Hack(any: AnyRef): { def toXML(xml: Elem, stripComments: Boolean): String } = + new { + def toXML(xml: Elem, stripComments: Boolean) = Utility.toXML(xml).toString // this will only be called for 2.8, which defaults to stripComments= false, unlike 2.7 + } + scala.xml.Utility.toXML(xml, false) // 2.8 doesn't have this method anymore, so the above implicit will kick in for 2.8 only + } if(!outputPath.exists) { log.debug("JNLP file did not exist, writing inline XML to " + outputPath)