From 7141000e659864339f3f6aed982f05f4f6b23770 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Sat, 19 Nov 2011 18:17:20 -0500 Subject: [PATCH] revert XNode/Node rename because of shadowing when running full API doc generation --- ivy/MakePom.scala | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ivy/MakePom.scala b/ivy/MakePom.scala index 180f41622..c2e70e9a4 100644 --- a/ivy/MakePom.scala +++ b/ivy/MakePom.scala @@ -8,7 +8,9 @@ package sbt; import java.io.File -import scala.xml.{Node, NodeSeq, PrettyPrinter} +// Node needs to be renamed to XNode because the task subproject contains a Node type that will shadow +// scala.xml.Node when generating aggregated API documentation +import scala.xml.{Node => XNode, NodeSeq, PrettyPrinter} import Configurations.Optional import org.apache.ivy.{core, plugins, Ivy} @@ -20,17 +22,17 @@ import plugins.resolver.{ChainResolver, DependencyResolver, IBiblioResolver} class MakePom(val log: Logger) { - def write(ivy: Ivy, module: ModuleDescriptor, moduleInfo: ModuleInfo, configurations: Option[Iterable[Configuration]], extra: NodeSeq, process: Node => Node, filterRepositories: MavenRepository => Boolean, allRepositories: Boolean, output: File): Unit = + def write(ivy: Ivy, module: ModuleDescriptor, moduleInfo: ModuleInfo, configurations: Option[Iterable[Configuration]], extra: NodeSeq, process: XNode => XNode, filterRepositories: MavenRepository => Boolean, allRepositories: Boolean, output: File): Unit = write(process(toPom(ivy, module, moduleInfo, configurations, extra, filterRepositories, allRepositories)), output) // use \n as newline because toString uses PrettyPrinter, which hard codes line endings to be \n - def write(node: Node, output: File): Unit = write(toString(node), output, "\n") + def write(node: XNode, output: File): Unit = write(toString(node), output, "\n") def write(xmlString: String, output: File, newline: String) { IO.write(output, "" + newline + xmlString) } - def toString(node: Node): String = new PrettyPrinter(1000, 4).format(node) - def toPom(ivy: Ivy, module: ModuleDescriptor, moduleInfo: ModuleInfo, configurations: Option[Iterable[Configuration]], extra: NodeSeq, filterRepositories: MavenRepository => Boolean, allRepositories: Boolean): Node = + def toString(node: XNode): String = new PrettyPrinter(1000, 4).format(node) + def toPom(ivy: Ivy, module: ModuleDescriptor, moduleInfo: ModuleInfo, configurations: Option[Iterable[Configuration]], extra: NodeSeq, filterRepositories: MavenRepository => Boolean, allRepositories: Boolean): XNode = ( 4.0.0 { makeModuleID(module) } @@ -223,9 +225,9 @@ class MakePom(val log: Logger) def toID(name: String) = checkID(name.filter(isValidIDCharacter).mkString, name) def isValidIDCharacter(c: Char) = c.isLetterOrDigit private def checkID(id: String, name: String) = if(id.isEmpty) error("Could not convert '" + name + "' to an ID") else id - def mavenRepository(repo: MavenRepository): Node = + def mavenRepository(repo: MavenRepository): XNode = mavenRepository(toID(repo.name), repo.name, repo.root) - def mavenRepository(id: String, name: String, root: String): Node = + def mavenRepository(id: String, name: String, root: String): XNode = {id} {name}