FileDocCategorySizeDatePackage
SdkCommandLine.javaAPI DocAndroid 1.5 API8826Wed May 06 22:41:10 BST 2009com.android.sdkmanager

SdkCommandLine

public class SdkCommandLine extends CommandLineProcessor
Specific command-line flags for the {@link SdkManager}.

Fields Summary
public static final String
VERB_LIST
public static final String
VERB_CREATE
public static final String
VERB_MOVE
public static final String
VERB_DELETE
public static final String
VERB_UPDATE
public static final String
OBJECT_AVD
public static final String
OBJECT_AVDS
public static final String
OBJECT_TARGET
public static final String
OBJECT_TARGETS
public static final String
OBJECT_PROJECT
public static final String
ARG_ALIAS
public static final String
ARG_ACTIVITY
public static final String
KEY_ACTIVITY
public static final String
KEY_PACKAGE
public static final String
KEY_MODE
public static final String
KEY_TARGET_ID
public static final String
KEY_NAME
public static final String
KEY_PATH
public static final String
KEY_FILTER
public static final String
KEY_SKIN
public static final String
KEY_SDCARD
public static final String
KEY_FORCE
public static final String
KEY_RENAME
private static final String[]
ACTIONS
Action definitions for SdkManager command line.

Each entry is a string array with:

  • the verb.
  • an object (use #NO_VERB_OBJECT if there's no object).
  • a description.
  • an alternate form for the object (e.g. plural).
Constructors Summary
public SdkCommandLine(com.android.sdklib.ISdkLog logger)

    
       
        super(logger, ACTIONS);

        // --- create avd ---
        
        define(MODE.STRING, false, 
                VERB_CREATE, OBJECT_AVD, "p", KEY_PATH,
                "Location path of the directory where the new AVD will be created", null);
        define(MODE.STRING, true, 
                VERB_CREATE, OBJECT_AVD, "n", KEY_NAME,
                "Name of the new AVD", null);
        define(MODE.INTEGER, true, 
                VERB_CREATE, OBJECT_AVD, "t", KEY_TARGET_ID,
                "Target id of the new AVD", null);
        define(MODE.STRING, false, 
                VERB_CREATE, OBJECT_AVD, "s", KEY_SKIN,
                "Skin of the new AVD", null);
        define(MODE.STRING, false, 
                VERB_CREATE, OBJECT_AVD, "c", KEY_SDCARD,
                "Path to a shared SD card image, or size of a new sdcard for the new AVD", null);
        define(MODE.BOOLEAN, false, 
                VERB_CREATE, OBJECT_AVD, "f", KEY_FORCE,
                "Force creation (override an existing AVD)", false);

        // --- delete avd ---
        
        define(MODE.STRING, true, 
                VERB_DELETE, OBJECT_AVD, "n", KEY_NAME,
                "Name of the AVD to delete", null);

        // --- move avd ---
        
        define(MODE.STRING, true, 
                VERB_MOVE, OBJECT_AVD, "n", KEY_NAME,
                "Name of the AVD to move or rename", null);
        define(MODE.STRING, false, 
                VERB_MOVE, OBJECT_AVD, "r", KEY_RENAME,
                "New name of the AVD to rename", null);
        define(MODE.STRING, false, 
                VERB_MOVE, OBJECT_AVD, "p", KEY_PATH,
                "New location path of the directory where to move the AVD", null);

        // --- update avd ---
        
        define(MODE.STRING, true, 
                VERB_UPDATE, OBJECT_AVD, "n", KEY_NAME,
                "Name of the AVD to update", null);

        // --- create project ---

        /* Disabled for ADT 0.9 / Cupcake SDK 1.5_r1 release. [bug #1795718].
           This currently does not work, the alias build rules need to be fixed.
           
        define(MODE.ENUM, true, 
                VERB_CREATE, OBJECT_PROJECT, "m", KEY_MODE,
                "Project mode", new String[] { ARG_ACTIVITY, ARG_ALIAS });
        */
        define(MODE.STRING, true, 
                VERB_CREATE, OBJECT_PROJECT,
                "p", KEY_PATH,
                "Location path of new project", null);
        define(MODE.INTEGER, true, 
                VERB_CREATE, OBJECT_PROJECT, "t", KEY_TARGET_ID,
                "Target id of the new project", null);
        define(MODE.STRING, true, 
                VERB_CREATE, OBJECT_PROJECT, "k", KEY_PACKAGE,
                "Package name", null);
        define(MODE.STRING, true, 
                VERB_CREATE, OBJECT_PROJECT, "a", KEY_ACTIVITY,
                "Activity name", null);
        define(MODE.STRING, false, 
                VERB_CREATE, OBJECT_PROJECT, "n", KEY_NAME,
                "Project name", null);

        // --- update project ---

        define(MODE.STRING, true, 
                VERB_UPDATE, OBJECT_PROJECT,
                "p", KEY_PATH,
                "Location path of the project", null);
        define(MODE.INTEGER, true, 
                VERB_UPDATE, OBJECT_PROJECT,
                "t", KEY_TARGET_ID,
                "Target id to set for the project", -1);
        define(MODE.STRING, false, 
                VERB_UPDATE, OBJECT_PROJECT,
                "n", KEY_NAME,
                "Project name", null);
    
Methods Summary
public booleangetFlagForce()
Helper to retrieve the --force flag.

        return ((Boolean) getValue(null, null, KEY_FORCE)).booleanValue();
    
public java.lang.StringgetParamLocationPath()
Helper to retrieve the --path value.

        return ((String) getValue(null, null, KEY_PATH));
    
public java.lang.StringgetParamMoveNewName()
Helper to retrieve the --rename value for a move verb.

        return ((String) getValue(VERB_MOVE, null, KEY_RENAME));
    
public java.lang.StringgetParamName()
Helper to retrieve the --name value.

        return ((String) getValue(null, null, KEY_NAME));
    
public java.lang.StringgetParamProjectActivity()
Helper to retrieve the --activity for the new project action.

        return ((String) getValue(null, OBJECT_PROJECT, KEY_ACTIVITY));
    
public java.lang.StringgetParamProjectPackage()
Helper to retrieve the --package value.

        return ((String) getValue(null, OBJECT_PROJECT, KEY_PACKAGE));
    
public java.lang.StringgetParamSdCard()
Helper to retrieve the --sdcard value.

        return ((String) getValue(null, null, KEY_SDCARD));
    
public java.lang.StringgetParamSkin()
Helper to retrieve the --skin value.

        return ((String) getValue(null, null, KEY_SKIN));
    
public intgetParamTargetId()
Helper to retrieve the --target id value.

        return ((Integer) getValue(null, null, KEY_TARGET_ID)).intValue();