hudson.plugins.android_emulator
Class AbstractBuilder

java.lang.Object
  extended by hudson.tasks.BuildStepCompatibilityLayer
      extended by hudson.tasks.Builder
          extended by hudson.plugins.android_emulator.AbstractBuilder
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.tasks.Builder>, hudson.tasks.BuildStep
Direct Known Subclasses:
InstallBuilder, UninstallBuilder

public abstract class AbstractBuilder
extends hudson.tasks.Builder


Nested Class Summary
 
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
hudson.tasks.BuildStep.PublisherList
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
 
Constructor Summary
AbstractBuilder()
           
 
Method Summary
protected static hudson.plugins.android_emulator.AndroidSdk getAndroidSdk(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, hudson.model.BuildListener listener)
          Gets an Android SDK instance, ready for use.
protected static java.lang.String getDeviceIdentifier(hudson.model.AbstractBuild<?,?> build, hudson.model.BuildListener listener)
          Gets the Android device identifier for this job, defaulting to the AVD started by this plugin.
protected static void uninstallApk(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, java.io.PrintStream logger, hudson.plugins.android_emulator.AndroidSdk androidSdk, java.lang.String deviceIdentifier, hudson.FilePath apkPath)
          Uninstalls the Android package corresponding to the given APK file from an Android device.
protected static void uninstallApk(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, java.io.PrintStream logger, hudson.plugins.android_emulator.AndroidSdk androidSdk, java.lang.String deviceIdentifier, java.lang.String packageId)
          Uninstalls the given Android package ID from the given Android device.
 
Methods inherited from class hudson.tasks.Builder
all, getDescriptor, getRequiredMonitorService, prebuild
 
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, getProjectAction, getProjectActions, perform, perform, prebuild
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hudson.tasks.BuildStep
getProjectAction, getProjectActions, perform, prebuild
 

Constructor Detail

AbstractBuilder

public AbstractBuilder()
Method Detail

getAndroidSdk

protected static hudson.plugins.android_emulator.AndroidSdk getAndroidSdk(hudson.model.AbstractBuild<?,?> build,
                                                                          hudson.Launcher launcher,
                                                                          hudson.model.BuildListener listener)
Gets an Android SDK instance, ready for use.

Parameters:
build - The build for which we should retrieve the SDK instance.
launcher - The launcher for the remote node.
listener - The listener used to get the environment variables.
Returns:
An Android SDK instance, or null if none was found.

getDeviceIdentifier

protected static java.lang.String getDeviceIdentifier(hudson.model.AbstractBuild<?,?> build,
                                                      hudson.model.BuildListener listener)
Gets the Android device identifier for this job, defaulting to the AVD started by this plugin.

Parameters:
build - The build for which we should retrieve the SDK instance.
listener - The listener used to get the environment variables.
Returns:
The device identifier (defaulting to the value of "-s $ANDROID_AVD_DEVICE").

uninstallApk

protected static void uninstallApk(hudson.model.AbstractBuild<?,?> build,
                                   hudson.Launcher launcher,
                                   java.io.PrintStream logger,
                                   hudson.plugins.android_emulator.AndroidSdk androidSdk,
                                   java.lang.String deviceIdentifier,
                                   hudson.FilePath apkPath)
                            throws java.io.IOException,
                                   java.lang.InterruptedException
Uninstalls the Android package corresponding to the given APK file from an Android device.

Parameters:
build - The build for which we should uninstall the package.
launcher - The launcher for the remote node.
logger - Where log output should be redirected to.
androidSdk - The Android SDK to use.
deviceIdentifier - The device from which the package should be removed.
apkPath - The path to the APK file.
Throws:
java.io.IOException - If execution failed.
java.lang.InterruptedException - If execution failed.

uninstallApk

protected static void uninstallApk(hudson.model.AbstractBuild<?,?> build,
                                   hudson.Launcher launcher,
                                   java.io.PrintStream logger,
                                   hudson.plugins.android_emulator.AndroidSdk androidSdk,
                                   java.lang.String deviceIdentifier,
                                   java.lang.String packageId)
                            throws java.io.IOException,
                                   java.lang.InterruptedException
Uninstalls the given Android package ID from the given Android device.

Parameters:
build - The build for which we should uninstall the package.
launcher - The launcher for the remote node.
logger - Where log output should be redirected to.
androidSdk - The Android SDK to use.
deviceIdentifier - The device from which the package should be removed.
packageId - The ID of the Android package to remove from the given device.
Throws:
java.io.IOException - If execution failed.
java.lang.InterruptedException - If execution failed.


Copyright © 2011. All Rights Reserved.