flair.gradle.utils.CliDevicesOutputParser.groovy Maven / Gradle / Ivy
package flair.gradle.utils
/**
* @author SamYStudiO ( [email protected] )
*/
public class CliDevicesOutputParser
{
public CliDevicesOutputParser()
{
}
public String parse( String adtOutput )
{
List list = new ArrayList( )
boolean startExtraction = false
adtOutput.eachLine {
if( startExtraction && !it.startsWith( "Handle" ) ) list.add( it.trim( ).split( "\\s" )[ 0 ] )
if( it.startsWith( "List of" ) ) startExtraction = true
}
return list.size( ) > 0 ? list[ 0 ] : null
}
}