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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | def initializeFormatter() { def formatterDefinitions = new XmlSlurper.parse("$rootDir/misc/codeformatter.xml") assert formatterDefinitions instanceof GPathResult def Properties props = new Properties() formatterDefinitions.&# 039 ;**&# 039 ;. findAll { node -> node.name() == &# 039 ;setting&# 039 ; }*. each { n -> props.put(n.@id.text(), n.@value.text() } return props } |