|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecthudson.plugins.android_emulator.Utils
public class Utils
| Constructor Summary | |
|---|---|
Utils()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
discoverAndroidHome(hudson.Launcher launcher,
hudson.EnvVars envVars,
java.lang.String androidHome)
Tries to validate the given Android SDK root directory; otherwise tries to locate a copy of the SDK by checking for common environment variables. |
static java.lang.String |
expandVariables(hudson.model.AbstractBuild<?,?> build,
hudson.model.BuildListener listener,
java.lang.String token)
Expands the variable in the given string to its value in the environment variables available to this build. |
static java.lang.String |
expandVariables(hudson.EnvVars envVars,
java.util.Map<java.lang.String,java.lang.String> buildVars,
java.lang.String token)
Expands the variable in the given string to its value in the environment variables available to this build. |
static hudson.plugins.android_emulator.AndroidSdk |
getAndroidSdk(hudson.Launcher launcher,
java.lang.String androidHome)
Determines the properties of the SDK installed on the build machine. |
static java.lang.String |
getConfiguredAndroidHome()
Retrieves the configured Android SDK root directory. |
static hudson.EnvVars |
getEnvironment(hudson.model.AbstractBuild<?,?> build,
hudson.model.BuildListener listener)
Gets a combined set of environment variables for the current computer and build. |
static hudson.util.ArgumentListBuilder |
getToolCommand(hudson.plugins.android_emulator.AndroidSdk androidSdk,
boolean isUnix,
hudson.plugins.android_emulator.Tool tool,
java.lang.String args)
Generates a ready-to-use ArgumentListBuilder for one of the Android SDK tools. |
static java.util.Map<java.lang.String,java.lang.String> |
parseConfigFile(java.io.File configFile)
Parses the contents of a properties file into a map. |
static void |
runAndroidTool(hudson.Launcher launcher,
java.io.OutputStream stdout,
java.io.OutputStream stderr,
hudson.plugins.android_emulator.AndroidSdk androidSdk,
hudson.plugins.android_emulator.Tool tool,
java.lang.String args,
hudson.FilePath workingDirectory)
Runs an Android tool on the remote build node and waits for completion before returning. |
static ValidationResult |
validateAndroidHome(java.io.File sdkRoot,
boolean fromWebConfig)
Validates whether the given directory looks like a valid Android SDK directory. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Utils()
| Method Detail |
|---|
public static java.lang.String getConfiguredAndroidHome()
public static hudson.EnvVars getEnvironment(hudson.model.AbstractBuild<?,?> build,
hudson.model.BuildListener listener)
build - The build for which we should retrieve environment variables.listener - The listener used to get the environment variables.
public static java.lang.String discoverAndroidHome(hudson.Launcher launcher,
hudson.EnvVars envVars,
java.lang.String androidHome)
launcher - The launcher for the remote node.envVars - Environment variables for the build.androidHome - The (variable-expanded) SDK root given in global config.
public static hudson.plugins.android_emulator.AndroidSdk getAndroidSdk(hudson.Launcher launcher,
java.lang.String androidHome)
launcher - The launcher for the remote node.androidHome - The SDK root directory specified in the job/system configuration.
public static ValidationResult validateAndroidHome(java.io.File sdkRoot,
boolean fromWebConfig)
sdkRoot - The directory to validate.fromWebConfig - Whether we are being called from the web config and should be more lax.
public static hudson.util.ArgumentListBuilder getToolCommand(hudson.plugins.android_emulator.AndroidSdk androidSdk,
boolean isUnix,
hudson.plugins.android_emulator.Tool tool,
java.lang.String args)
androidSdk - The Android SDK to use.isUnix - Whether the system where this command should run is sane.tool - The Android tool to run.args - Any extra arguments for the command.
public static void runAndroidTool(hudson.Launcher launcher,
java.io.OutputStream stdout,
java.io.OutputStream stderr,
hudson.plugins.android_emulator.AndroidSdk androidSdk,
hudson.plugins.android_emulator.Tool tool,
java.lang.String args,
hudson.FilePath workingDirectory)
throws java.io.IOException,
java.lang.InterruptedException
launcher - The launcher for the remote node.stdout - The stream to which standard output should be redirected.stderr - The stream to which standard error should be redirected.androidSdk - The Android SDK to use.tool - The Android tool to run.args - Any extra arguments for the command.workingDirectory - The directory to run the tool from, or null if irrelevant
java.io.IOException - If execution of the tool fails.
java.lang.InterruptedException - If execution of the tool is interrupted.
public static java.util.Map<java.lang.String,java.lang.String> parseConfigFile(java.io.File configFile)
throws java.io.IOException
configFile - The file to read.
java.io.IOException - If the file could not be read.
public static java.lang.String expandVariables(hudson.model.AbstractBuild<?,?> build,
hudson.model.BuildListener listener,
java.lang.String token)
build - The build from which to get the build-specific and environment variables.listener - The listener used to get the environment variables.token - The token which may or may not contain variables in the format ${foo}.
public static java.lang.String expandVariables(hudson.EnvVars envVars,
java.util.Map<java.lang.String,java.lang.String> buildVars,
java.lang.String token)
envVars - Map of the environment variables.buildVars - Map of the build-specific variables.token - The token which may or may not contain variables in the format ${foo}.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||