Action.NameMod=Name of VM.
Action.PlatformHelp.0=Select Platform of base disk image.
Action.PlatformHelp.1=\t\t(Available disk image can be found using 'list-image' command)
+Action.ProfileHelp.0=Select profile
+Action.DetailPlatformHelp.0=Display more information of platform
Action.RAMSizenDescription.0=RAM size. (
Action.RAMSizenDescription.1=)
Action.RemoteHelp.0=User account of remote.
ActionList.IPOpion=IP address of remote.
ActionList.Launch.0=Start emulator using selected VM.
ActionList.Launch.1=launch -n test [options]
-ActionList.ListImage.0=Display list of existing base disk image
-ActionList.ListImage.1=list-image
+ActionList.ListImage.0=Display list of existing platforms
+ActionList.ListImage.1=list-platform [options]
ActionList.ListVM.0=Display list of existing 'Virtual Machine'
ActionList.ListVM.1=list-vm [options]
ActionList.Modfiy.0=Modify configuration of selected 'Virtual Machine'.
ActionList.RemoteExportAs.1=remote-create-image -n test -e IP -u account [options]
ActionList.RemoteLaunch.0=Start remote emulator using selected VM.
ActionList.RemoteLaunch.1=remote-launch -n test -e IP -u account [options]
-ActionList.RemoteListImage.0=Display list of existing remote base disk image
-ActionList.RemoteListImage.1=remote-list-image -e IP -u account [options]
+ActionList.RemoteListImage.0=Display list of existing remote platforms
+ActionList.RemoteListImage.1=remote-platform-image -e IP -u account [options]
ActionList.RemoteListVM.0=Display list of existing 'Remote Virtual Machine'
ActionList.RemoteListVM.1=remote-list-VM -e IP -u account [options]
ActionList.RemoteModify.0=Modify configuration of selected 'Remote Virtual Machine'.
ConsoleProcessor.DeleteError.2=\ - path :
ConsoleProcessor.DupulicateNameError.0=Error: The target name (
ConsoleProcessor.DupulicateNameError.1=) already exists\!
-ConsoleProcessor.ImageList.0=Available Base Image:
-ConsoleProcessor.ImageList.1=Base Image is empty.
-ConsoleProcessor.LaunchConfigInfo.0=Print launch config file :
+ConsoleProcessor.ImageList.0=Available Platforms:
+ConsoleProcessor.ImageList.1=Platform list is empty.
+ConsoleProcessor.LaunchConfigInfo.0=Print launch configure file :
ConsoleProcessor.LaunchError.0=Error: Can not execute this VM.
ConsoleProcessor.NotExistPathError.0=Error: This directory does not exist. (Path :
ConsoleProcessor.NotExistVMError.0=Error: The name (
import org.tizen.emulator.manager.job.Overseer;
import org.tizen.emulator.manager.logging.EMLogger;
import org.tizen.emulator.manager.platform.Preparer;
-import org.tizen.emulator.manager.platform.backup.ProfileList;
import org.tizen.emulator.manager.resources.FilePathResources;
import org.tizen.emulator.manager.resources.StringResources;
import org.tizen.emulator.manager.tool.About;
checkConsoleMode(args);
if (isConsoleMode) {
+ Preparer.execute();
// initialize VMKeeper
EmulatorManager.setVMKeeper(new DisposableVMKeeper());
- EMLogger.getInstance().initLogger();
- ProfileList.initialize();
- /*
- try {
- FileLock lock = randomAccessFile.getChannel().tryLock();
- if (lock == null) {
- EMLogger.getLogger().log(Level.WARNING, "Can not launch Emulator Manager."
- + StringResources.NEW_LINE
- + "Another one with the same user name is running now."
- + StringResources.NEW_LINE);
- System.out.println("Can not launch Emulator Manager."
- + StringResources.NEW_LINE
- + "Another Emulator Manager is running now.");
- exitEmulatorManager(1);
- }
- } catch (IOException e) {
- EMLogger.getLogger().log(Level.WARNING, "Can not launch Emulator Manager."
- + StringResources.NEW_LINE +e.getMessage() + StringResources.NEW_LINE);
- exitEmulatorManager(1);
- }
- */
processor = new CommandLineParser();
processor.parseArgs(args);
// actions
public final static String AC_GLOBAL = "global"; //$NON-NLS-1$
public final static String AC_LIST_VM = "list-vm"; //$NON-NLS-1$
- public final static String AC_LIST_IMAGE = "list-image"; //$NON-NLS-1$
+ public final static String AC_LIST_PLATFORM = "list-platform"; //$NON-NLS-1$
public final static String AC_CREATE = "create"; //$NON-NLS-1$
public final static String AC_DETAIL = "detail"; //$NON-NLS-1$
public final static String AC_DELETE = "delete"; //$NON-NLS-1$
public final static String AC_REMOTE_MODIFY = "remote-modify"; //$NON-NLS-1$
public final static String AC_REMOTE_CLONE = "remote-clone"; //$NON-NLS-1$
public final static String AC_REMOTE_RESET = "remote-reset"; //$NON-NLS-1$
- public final static String AC_REMOTE_LIST_IMAGE = "remote-list-image"; //$NON-NLS-1$
+ public final static String AC_REMOTE_LIST_PLATFORM = "remote-list-platform"; //$NON-NLS-1$
public final static String AC_REMOTE_CREATE_IMAGE = "remote-create-image"; //$NON-NLS-1$
public final static String AC_REMOTE_DETAIL = "remote-detail"; //$NON-NLS-1$
public final static String AC_REMOTE_WORKSPACE = "remote-workspace"; //$NON-NLS-1$
public final static String OP_TEST = "test"; //$NON-NLS-1$
public final static String OP_COUNT = "count"; //$NON-NLS-1$
public final static String OP_COMPRESS = "compress";
+ public final static String OP_PROFILE = "profile";
public final static String OP_RESOLUTION = "resolution"; //$NON-NLS-1$
public final static String OP_DPI = "dpi"; //$NON-NLS-1$
public final static String DESC_PLATFORM = Messages.getString("Action.PlatformHelp.0") //$NON-NLS-1$
+ StringResources.NEW_LINE
+ Messages.getString("Action.PlatformHelp.1"); //$NON-NLS-1$
+ public final static String DESC_PROFILE = Messages.getString("Action.ProfileHelp.0");
+ public final static String DESC_DETAIL_PLATFORM = Messages.getString("Action.DetailPlatformHelp.0");
public final static String DESC_RESOLUTION = resolutionDescription();
public final static String DESC_DPI = Messages.getString("Action.DPIHelp"); //$NON-NLS-1$
public final static String DESC_SKIN = Messages.getString("Action.SkinHelp"); //$NON-NLS-1$
public final static String DEFAULT_BASE = Messages.getString("Action.DefaultBaseImage"); //$NON-NLS-1$
public final static String DEFAULT_SKIN = Messages.getString("Action.DefaultSkin"); //$NON-NLS-1$
-
public static String resolutionDescription() {
String resolution = ""; //$NON-NLS-1$
for (RESOLUTION r : RESOLUTION.values()) {
globalAction = new Global();
addAction(new ListVM());
- addAction(new ListImage());
+ addAction(new ListPlatform());
addAction(new Detail());
addAction(new Launch());
addAction(new Create());
addAction(new CreateBaseImage());
addAction(new RemoteListVM());
- addAction(new RemoteListImage());
+ addAction(new RemoteListPlatform());
addAction(new RemoteDetail());
addAction(new RemoteLaunch());
addAction(new RemoteCreate());
}
}
-class ListImage extends Action {
- public ListImage() {
- this.action = Actions.AC_LIST_IMAGE;
+class ListPlatform extends Action {
+ public ListPlatform() {
+ this.action = Actions.AC_LIST_PLATFORM;
this.description = Messages.getString("ActionList.ListImage.0"); //$NON-NLS-1$
this.usage = Messages.getString("ActionList.ListImage.1"); //$NON-NLS-1$
+
+ commandList.add(new Command("p", Actions.OP_PROFILE, //$NON-NLS-1$
+ Actions.DESC_PROFILE, "", false, true)); //$NON-NLS-1$
+ commandList.add(new Command("d", Actions.OP_DETAIL, //$NON-NLS-1$
+ Actions.DESC_DETAIL_PLATFORM, "", false, false)); //$NON-NLS-1$
}
@Override
public boolean process() {
+ String profile = null;
boolean isDetail = false;
+ for (Command c : commandList) {
+ if (c.isInCommandLine()) {
+ switch (c.getShortName().charAt(0)) {
+ case 'd' : // detail
+ isDetail = true;
+ break;
+ case 'p' : // profile
+ profile = c.getCurrentValue();
+ break;
+ }
+ }
+ }
ConsoleProcessor processor = new ConsoleProcessor();
- for (String s : processor.getInfoOfImageList(isDetail)) { // TODO
+ List<String> list = processor.getInfoOfImageList(profile, isDetail);
+
+ // list is empty -> error???
+ if (list.isEmpty()) {
+ System.out.println(Messages.getString("ConsoleProcessor.ImageList.1")); //$NON-NLS-1$
+ return false;
+ }
+
+ for (String s : list) {
System.out.println(s);
}
+
return true;
}
}
-class RemoteListImage extends Action {
- public RemoteListImage() {
- this.action = Actions.AC_REMOTE_LIST_IMAGE;
+class RemoteListPlatform extends Action {
+ public RemoteListPlatform() {
+ this.action = Actions.AC_REMOTE_LIST_PLATFORM;
this.description = Messages.getString("ActionList.RemoteListImage.0"); //$NON-NLS-1$
this.usage = Messages.getString("ActionList.RemoteListImage.1"); //$NON-NLS-1$
remoteManager.storeRemoteInfo(commandList);
remoteManager.sshCmd(cmd);
- cmd.add("list-image"); //$NON-NLS-1$
+ cmd.add(Actions.AC_LIST_PLATFORM);
return remoteManager.runRemoteCmd(cmd);
}
import org.tizen.emulator.manager.EmulatorManager;
import org.tizen.emulator.manager.logging.EMLogger;
-import org.tizen.emulator.manager.platform.backup.BaseImage;
-import org.tizen.emulator.manager.platform.backup.Profile;
-import org.tizen.emulator.manager.platform.backup.ProfileList;
+import org.tizen.emulator.manager.platform.Platform;
import org.tizen.emulator.manager.resources.FilePathResources;
import org.tizen.emulator.manager.resources.StringResources;
import org.tizen.emulator.manager.tool.About;
return getProperties().size();
}
- public ArrayList<String> getInfoOfImageList(boolean isDetail) {
+ public ArrayList<String> getInfoOfImageList(String profile, boolean isDetail) {
+ // TODO: isDetail ??
+
ArrayList<String> list = new ArrayList<String>();
- list.add(Messages.getString("ConsoleProcessor.ImageList.0") + StringResources.NEW_LINE); //$NON-NLS-1$
- for (Profile profile : ProfileList.getProfileList()) {
- for (BaseImage image : profile.getImageList()) {
- list.add(image.toString());
+ for (Platform platform : Platform.getPlatformList()) {
+ if (profile == null) {
+ list.add(platform.getName());
+ } else if (platform.getProfile().getName().equals(profile)) {
+ list.add(platform.getName());
}
}
- if (list.size() == 1) {
- list.remove(0);
- list.add(Messages.getString("ConsoleProcessor.ImageList.1")); //$NON-NLS-1$
- }
-
return list;
}
public int getCountOfImageList() {
- //ArrayList<String> list = new ArrayList<String>();
- int count = 0;
- for (Profile profile : ProfileList.getProfileList()) {
- count += profile.getImageList().size();
- }
-
- return count;
+ return Platform.getPlatformList().size();
}
public boolean launchEmulator(String name, String path, boolean isTest) {