All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jayway.maven.plugins.android.standalonemojos.DevicesMojo Maven / Gradle / Ivy

There is a newer version: 4.0.0-rc.2
Show newest version
package com.jayway.maven.plugins.android.standalonemojos;

import com.android.ddmlib.IDevice;
import com.jayway.maven.plugins.android.AbstractAndroidMojo;
import com.jayway.maven.plugins.android.DeviceCallback;
import com.jayway.maven.plugins.android.common.DeviceHelper;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;

/**
 * DevicesMojo lists all attached devices and emulators found with the android debug bridge. It uses the same
 * naming convention for the emulator as used in other places in the Android Maven Plugin and adds the status
 * of the device in the list.
 * 

* TODO The goal is very simple and could be enhanced for better display, a verbose option to display and to take the * android.device paramter into account. * * @author Manfred Moser * @goal devices * @requiresProject false */ public class DevicesMojo extends AbstractAndroidMojo { /** * Display a list of attached devices. * * @throws MojoExecutionException * @throws MojoFailureException */ public void execute() throws MojoExecutionException, MojoFailureException { doWithDevices( new DeviceCallback() { public void doWithDevice( final IDevice device ) throws MojoExecutionException { getLog().info( DeviceHelper.getDescriptiveNameWithStatus( device ) ); } } ); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy