flair.gradle.tasks.ListDevices.groovy Maven / Gradle / Ivy
package flair.gradle.tasks
import flair.gradle.cli.Adb
import flair.gradle.cli.ICli
import flair.gradle.cli.Idb
import flair.gradle.variants.Platform
import org.gradle.api.tasks.TaskAction
/**
* @author SamYStudiO ( [email protected] )
*/
class ListDevices extends AbstractTask
{
private ICli idb = new Idb( )
private ICli adb = new Adb( )
public Platform platform
public ListDevices()
{
group = TaskGroup.DEVICES.name
description = ""
}
@TaskAction
public void list()
{
if( platform == Platform.IOS )
{
idb.addArgument( "-devices" )
idb.execute( project , Platform.IOS )
}
else if( platform == Platform.ANDROID )
{
adb.addArgument( "devices" )
adb.execute( project , Platform.ANDROID )
}
}
}