def ant(registry, xml_parent, data):
 ant = XML.SubElement(xml_parent, 'hudson.tasks.Ant')
 if (type(data) is str):
  data = {'targets': data}
 for (setting, value) in sorted(data.items()):
  if (setting == 'targets'):
   targets = XML.SubElement(ant, 'targets')
   targets.text = value
  if (setting == 'buildfile'):
   buildfile = XML.SubElement(ant, 'buildFile')
   buildfile.text = value
  if (setting == 'properties'):
   properties = data['properties']
   prop_string = ''
   for (prop, val) in properties.items():
    prop_string += ('%s=%s\n' % (prop, val))
   prop_element = XML.SubElement(ant, 'properties')
   prop_element.text = prop_string
  if (setting == 'java-opts'):
   javaopts = data['java-opts']
   jopt_string = ' '.join(javaopts)
   jopt_element = XML.SubElement(ant, 'antOpts')
   jopt_element.text = jopt_string
 XML.SubElement(ant, 'antName').text = data.get('ant-name', 'default')

def ant ( registry , xml_parent , data ) : ant = XML . SubElement ( xml_parent , 'hudson.tasks.Ant' ) if ( type ( data ) is str ) : data = { 'targets' : data } for ( setting , value ) in sorted ( data . items ( ) ) : if ( setting == 'targets' ) : targets = XML . SubElement ( ant , 'targets' ) targets . text = value if ( setting == 'buildfile' ) : buildfile = XML . SubElement ( ant , 'buildFile' ) buildfile . text = value if ( setting == 'properties' ) : properties = data [ 'properties' ] prop_string = '' for ( prop , val ) in properties . items ( ) : prop_string += ( '%s=%s\n' % ( prop , val ) ) prop_element = XML . SubElement ( ant , 'properties' ) prop_element . text = prop_string if ( setting == 'java-opts' ) : javaopts = data [ 'java-opts' ] jopt_string = ' ' . join ( javaopts ) jopt_element = XML . SubElement ( ant , 'antOpts' ) jopt_element . text = jopt_string XML . SubElement ( ant , 'antName' ) . text = data . get ( 'ant-name' , 'default' )
yaml: ant execute an ant target .