DEV-NOTES|Gradle: Reading Eclipses codeformatter xml file

This little code snippet transforms the code formatter XML description file into a properties structure which could be applied to the JDT properties later on.

<br />
def initializeFormatter() {<br />
  def formatterDefinitions = new XmlSlurper.parse(&quot;$rootDir/misc/codeformatter.xml&quot;)<br />
  assert formatterDefinitions instanceof GPathResult</p>
<p>  def Properties props = new Properties()</p>
<p>  formatterDefinitions.&#039;**&#039;.findAll{ node -&gt;<br /> == &#039;setting&#039;<br />
  }*.each { n -&gt;<br />
    props.put(n.@id.text(), n.@value.text()<br />
<p>  return props<br />
}<br />