Skip to content

Instantly share code, notes, and snippets.

@stevez
Created February 13, 2012 21:43
Show Gist options
  • Select an option

  • Save stevez/1820723 to your computer and use it in GitHub Desktop.

Select an option

Save stevez/1820723 to your computer and use it in GitHub Desktop.
def classpath = new XmlParser().parse('.classpath')
classpath.each {
println "${it.@kind} ${it.@path}"
}
def newEntry = new Node(classpath, 'classpathentry', [kind:'lib', path:'libs/abc.jar'])
println "after adding a new entry:"
classpath.each {
println "${it.@kind} ${it.@path}"
}
String outxml = groovy.xml.XmlUtil.serialize( classpath )
println outxml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment