Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ lazy val xml = crossProject(JSPlatform, JVMPlatform)
exclude[MissingTypesProblem]("scala.xml.Unparsed"),
exclude[DirectMissingMethodProblem]("scala.xml.Elem.this"),
exclude[DirectMissingMethodProblem]("scala.xml.Elem.apply"),
exclude[DirectMissingMethodProblem]("scala.xml.Elem.processXml"),
exclude[DirectMissingMethodProblem]("scala.xml.Elem.xmlToProcess"),
// Scala 2.12 deprecated mutable.Stack, so we broke
// binary compatibility for 2.0.0 in the following way:
exclude[IncompatibleMethTypeProblem]("scala.xml.parsing.FactoryAdapter.scopeStack_="),
Expand Down
26 changes: 0 additions & 26 deletions shared/src/main/scala/scala/xml/Elem.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,6 @@ object Elem {
case _: SpecialNode | _: Group => None
case _ => Some((n.prefix, n.label, n.attributes, n.scope, n.child.toSeq))
}

import scala.sys.process._
import scala.language.implicitConversions

/**
* Implicitly convert a [[scala.xml.Elem]] into a
* [[scala.sys.process.ProcessBuilder]]. This is done by obtaining the text
* elements of the element, trimming spaces, and then converting the result
* from string to a process. Importantly, tags are completely ignored, so
* they cannot be used to separate parameters.
*/
@deprecated("To create a scala.sys.process.Process from an xml.Elem, please use Process(elem.text.trim).", "2.11.0")
implicit def xmlToProcess(command: scala.xml.Elem): ProcessBuilder = Process(command.text.trim)

@deprecated("To create a scala.sys.process.Process from an xml.Elem, please use Process(elem.text.trim).", "2.11.0")
implicit def processXml(p: Process.type): { def apply(command: Elem): ProcessBuilder } = new {
/**
* Creates a [[scala.sys.process.ProcessBuilder]] from a Scala XML Element.
* This can be used as a way to template strings.
*
* @example {{{
* apply(<x> {dxPath.absolutePath} --dex --output={classesDexPath.absolutePath} {classesMinJarPath.absolutePath}</x>)
* }}}
*/
def apply(command: Elem): ProcessBuilder = Process(command.text.trim)
}
}

/**
Expand Down