From: jihye424.kim Date: Wed, 17 Jun 2015 05:31:25 +0000 (+0900) Subject: FilePathResources: seperate platform emulator and tool emulator path X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fc7b5f227cfdf62004983189dadd2da49ec7991e;p=sdk%2Femulator%2Femulator-manager.git FilePathResources: seperate platform emulator and tool emulator path - replace emulator path to 'emulator dir' of plaform from version of platform Change-Id: I7cc4397b0a95e01628832ac54e0bb710c070d679 Signed-off-by: jihye424.kim --- diff --git a/src/org/tizen/emulator/manager/EmulatorManager.java b/src/org/tizen/emulator/manager/EmulatorManager.java index 7bf4f44..41b4488 100755 --- a/src/org/tizen/emulator/manager/EmulatorManager.java +++ b/src/org/tizen/emulator/manager/EmulatorManager.java @@ -287,7 +287,7 @@ public class EmulatorManager { MessageDialog msg = new MessageDialog(new Shell(Display.getCurrent())); - randomAccessFile = new RandomAccessFile(new File(FilePathResources.getBinPath() + randomAccessFile = new RandomAccessFile(new File(FilePathResources.getToolEmulatorBinPath() + File.separator + "." +System.getProperty("user.name"))+ ".lock", "rw"); try { diff --git a/src/org/tizen/emulator/manager/console/ActionList.java b/src/org/tizen/emulator/manager/console/ActionList.java index f477812..e31d98d 100644 --- a/src/org/tizen/emulator/manager/console/ActionList.java +++ b/src/org/tizen/emulator/manager/console/ActionList.java @@ -690,7 +690,7 @@ class Launch extends Action { commandList.add(new Command("n", Actions.OP_NAME, Actions.DESC_LAUNCH_NAME,"", true, true)); commandList.add(new Command("p", Actions.OP_PATH, - Actions.DESC_LAUNCH_PATH, FilePathResources.getEmulatorBinPath(""), false, true)); + Actions.DESC_LAUNCH_PATH, FilePathResources.getPlatformEmulatorBinPath(""), false, true)); commandList.add(new Command("t", Actions.OP_TEST, Actions.DESC_TEST, "", false, false)); /* @@ -745,7 +745,7 @@ class RemoteLaunch extends Action { commandList.add(new Command("n", Actions.OP_NAME, Actions.DESC_LAUNCH_NAME,"", true, true)); commandList.add(new Command("p", Actions.OP_PATH, - Actions.DESC_LAUNCH_PATH, FilePathResources.getBinPath(), false, true)); + Actions.DESC_LAUNCH_PATH, FilePathResources.getPlatformEmulatorBinPath(""), false, true)); commandList.add(new Command("t", Actions.OP_TEST, Actions.DESC_TEST, "", false, false)); commandList.add(new Command("s", Actions.OP_SPICE_PORT, diff --git a/src/org/tizen/emulator/manager/job/CheckGPU.java b/src/org/tizen/emulator/manager/job/CheckGPU.java index 0bcb263..6e77114 100644 --- a/src/org/tizen/emulator/manager/job/CheckGPU.java +++ b/src/org/tizen/emulator/manager/job/CheckGPU.java @@ -61,9 +61,9 @@ public class CheckGPU implements Job { @Override public void work() { List cmd = new ArrayList(); - cmd.add(FilePathResources.getEmulatorToolPath() + File.separator + GPU_CHECKER); + cmd.add(FilePathResources.getEmulatorCheckToolPath() + File.separator + GPU_CHECKER); ProcessResult result = HelperClass.runProcess(cmd, - new File(FilePathResources.getEmulatorToolPath())); + new File(FilePathResources.getEmulatorCheckToolPath())); switch (result.getExitValue()) { case 0: diff --git a/src/org/tizen/emulator/manager/job/CheckVT.java b/src/org/tizen/emulator/manager/job/CheckVT.java index 4edd2b2..d87d002 100644 --- a/src/org/tizen/emulator/manager/job/CheckVT.java +++ b/src/org/tizen/emulator/manager/job/CheckVT.java @@ -75,9 +75,9 @@ public class CheckVT implements Job { public void work() { if (EmulatorManager.isWin() || EmulatorManager.isMac()) { List cmd = new ArrayList(); - cmd.add(FilePathResources.getEmulatorToolPath() + File.separator + HAX_CHECKER); + cmd.add(FilePathResources.getEmulatorCheckToolPath() + File.separator + HAX_CHECKER); ProcessResult result = HelperClass.runProcess(cmd, - new File(FilePathResources.getEmulatorToolPath())); + new File(FilePathResources.getEmulatorCheckToolPath())); switch (result.getExitValue()) { case 0: diff --git a/src/org/tizen/emulator/manager/platform/Platform.java b/src/org/tizen/emulator/manager/platform/Platform.java index e7f274f..5d782e9 100644 --- a/src/org/tizen/emulator/manager/platform/Platform.java +++ b/src/org/tizen/emulator/manager/platform/Platform.java @@ -123,7 +123,7 @@ public class Platform { this.platformPath = plugin.getPlatformPath(); this.emulatorPath = plugin.getAttribute(PluginStringResources.EmulatorDir); if (this.emulatorPath == null) { - this.emulatorPath = FilePathResources.getEmulatorBinPath(version); + this.emulatorPath = FilePathResources.getPlatformEmulatorPath(version); } this.plugin = plugin; diff --git a/src/org/tizen/emulator/manager/platform/ProfileList.java b/src/org/tizen/emulator/manager/platform/ProfileList.java index 7155da4..f2a6840 100644 --- a/src/org/tizen/emulator/manager/platform/ProfileList.java +++ b/src/org/tizen/emulator/manager/platform/ProfileList.java @@ -187,7 +187,7 @@ public class ProfileList { return; } - File images = new File(platformPath + FilePathResources.getDefaultImagePath()); + File images = new File(platformPath + FilePathResources.getPlatformImagesPath()); BaseImage image = null; if(images.exists() && images.isDirectory()) { diff --git a/src/org/tizen/emulator/manager/platform/SkinList.java b/src/org/tizen/emulator/manager/platform/SkinList.java index 4ac38a4..e61823c 100644 --- a/src/org/tizen/emulator/manager/platform/SkinList.java +++ b/src/org/tizen/emulator/manager/platform/SkinList.java @@ -35,7 +35,6 @@ import java.io.IOException; import java.util.ArrayList; import org.tizen.emulator.manager.logging.EMLogger; -import org.tizen.emulator.manager.resources.FilePathResources; import org.tizen.emulator.manager.resources.StringResources; import org.tizen.emulator.manager.vms.RESOLUTION; import org.tizen.emulator.manager.vms.SKIN_SHAPE; @@ -54,11 +53,6 @@ public class SkinList { } private SkinList() { - try { - makeSkinList(new File(FilePathResources.getSkinPath())); - } catch (IOException e) { - EMLogger.getLogger().warning(e.getMessage()); - } } private void makeSkinList(File dir) throws IOException { diff --git a/src/org/tizen/emulator/manager/resources/FilePathResources.java b/src/org/tizen/emulator/manager/resources/FilePathResources.java index d4a66c9..81a6bff 100644 --- a/src/org/tizen/emulator/manager/resources/FilePathResources.java +++ b/src/org/tizen/emulator/manager/resources/FilePathResources.java @@ -52,12 +52,8 @@ public class FilePathResources { private final static String platform_suffix = File.separator + "platforms"; private final static String em_images_suffix = File.separator + "emulator-images"; private final static String resource_suffix = File.separator + "emulator-resources"; - private final static String old_default_suffix = File.separator + "default"; private final static String common_suffix = File.separator + "common"; private final static String platform_prefix = File.separator + "tizen-"; -// private final static String addons_suffix = File.separator + "add-ons"; -// private final static String x86_extension = ".x86"; -// private final static String arm_extension = ".arm"; private final static String sdkinfo_suffix = File.separator + "sdk.info"; private final static String etc_suffix = File.separator + "etc"; @@ -66,6 +62,7 @@ public class FilePathResources { private final static String kernel_suffix = File.separator +"kernel"; private final static String swap_suffix = File.separator + "swap"; private final static String data_suffix = File.separator +"data"; + private final static String images_suffix = File.separator + "images"; private final static String win_sdb_exec = File.separator + "sdb.exe"; private final static String sdb_exec = File.separator + "sdb"; @@ -77,58 +74,42 @@ public class FilePathResources { private final static String skins_suffix = File.separator + "skins"; private final static String template_suffix = File.separator + "template"; private final static String plugins_suffix = File.separator + "plugins"; - private final static String images_suffix = File.separator + "images"; - private final static String sdkdata_old_emulator_suffix = File.separator + "emulator-vms"; private final static String sdkdata_new_emulator_suffix = File.separator + "emulator"; private final static String vms_suffix = File.separator + "vms"; - private final static String qemuImg_suffic = File.separator + "qemu-img"; + private final static String qemuImg_suffix = File.separator + "qemu-img"; private final static String checkCam_suffix = File.separator + "check-cam" + (EmulatorManager.isWin() ? ".exe" : "") ; + // Tizen SDK private static String currentPath; private static String sdkPath = null; private static String platformsPath; - private static String toolsPath; - private static String emulatorPath; + private static String toolEmulatorPath; private static String sdbPath; - // Emulator - private static String binPath; - private static String etcPath; - private static String remotePath; - private static String dataPath; - private static String defaultSkinPath; - private static String defaultTemplatePath; - - private static String defaultImagePath; - private static String oldDefaultImagePath; + // Common Emulator + private static String toolEmulatorBinPath; + private static String toolEmulatorEtcPath; + private static String toolEmulatorRemotePath; + // Platform private static String platformSkinsPath; private static String platformTemplatePath; private static String platformPluginsPath; private static String platformImagesPath; - - private static String kernelPath; - private static String biosPath; private static String sdcardPath; private static String swapPath; - private static String sdkDataSdcardPath; private static String sdkDataSwapPath; private final static String log_suffix = File.separator +"logs"; private static String tizensdkdataPath; - private static String tizensdkdataEmulatorPath; - private static String tizensdkdataOldEmulatorPath; + private static String tizensdkdataEmulatorPath;; private static String sdkDataVmsPath; - private static String oldSdcardPath; - private static String oldSwapPath; - private static String oldSdkDataVmsPath; - static { // emulator-manager.jar file path { @@ -155,6 +136,7 @@ public class FilePathResources { sdkPath = currentPath; } + String toolsPath = ""; try { toolsPath = new File(sdkPath + tool_suffix).getCanonicalPath(); } catch (IOException e) { @@ -162,24 +144,20 @@ public class FilePathResources { } try { - emulatorPath = new File(toolsPath + emulator_suffix).getCanonicalPath(); + toolEmulatorPath = new File(toolsPath + emulator_suffix).getCanonicalPath(); } catch (IOException e) { - emulatorPath = toolsPath + emulator_suffix; + toolEmulatorPath = toolsPath + emulator_suffix; } platformsPath = sdkPath + platform_suffix; // default Image path // -> platforms/profile-version/emulator-images/ - // old Image path - // -> platforms/profile-version/emulator-images/default - defaultImagePath = em_images_suffix; - oldDefaultImagePath = em_images_suffix + old_default_suffix; + platformImagesPath = em_images_suffix; platformSkinsPath = resource_suffix + skins_suffix; platformTemplatePath = resource_suffix + template_suffix; platformPluginsPath = resource_suffix + plugins_suffix; - platformImagesPath = resource_suffix + images_suffix; // SDB path { @@ -192,20 +170,13 @@ public class FilePathResources { sdbPath = toolsPath + sdb_suffix; } - binPath = emulatorPath + bin_suffix; - - etcPath = emulatorPath + etc_suffix; - remotePath = emulatorPath + remote_suffix; - dataPath = emulatorPath + data_suffix; - - kernelPath = dataPath + kernel_suffix; - biosPath = dataPath + bios_suffix; + toolEmulatorBinPath = toolEmulatorPath + bin_suffix; - sdkDataSdcardPath = emulatorPath + storages_suffix + sdcard_suffix; - sdkDataSwapPath = emulatorPath + storages_suffix + swap_suffix; + toolEmulatorEtcPath = toolEmulatorPath + etc_suffix; + toolEmulatorRemotePath = toolEmulatorPath + remote_suffix; - defaultSkinPath = emulatorPath + skins_suffix; -// defaultTemplatePath = emulatorPath + template_suffix; + sdkDataSdcardPath = toolEmulatorPath + storages_suffix + sdcard_suffix; + sdkDataSwapPath = toolEmulatorPath + storages_suffix + swap_suffix; tizensdkdataEmulatorPath = tizensdkdataPath + sdkdata_new_emulator_suffix; sdcardPath = tizensdkdataEmulatorPath + sdcard_suffix; @@ -213,11 +184,6 @@ public class FilePathResources { swapPath = sdkDataSwapPath; sdkDataVmsPath = tizensdkdataEmulatorPath + vms_suffix; - tizensdkdataOldEmulatorPath = tizensdkdataPath + sdkdata_old_emulator_suffix; - oldSdcardPath = tizensdkdataOldEmulatorPath + sdcard_suffix; - oldSwapPath = tizensdkdataOldEmulatorPath + swap_suffix; - oldSdkDataVmsPath = tizensdkdataOldEmulatorPath + vms_suffix; - EmulatorVMList.makeSDKDataPath(sdkDataVmsPath); testPrintPath(); } @@ -354,45 +320,61 @@ public class FilePathResources { return sdbPath; } - public static String getBinPath(){ - return binPath; + // tools/emulator + public static String getToolEmulatorPath() { + return toolEmulatorPath; + } + + public static String getToolEmulatorBinPath(){ + return toolEmulatorBinPath; } - public static String getEmulatorBinPath(String platformVersion) { - return getEmulatorPath(platformVersion) + bin_suffix; + public static String getToolEmulatorEtcPath() { + return toolEmulatorEtcPath; } - public static String getEmulatorKernelPath(String platformVersion) { - return getEmulatorDataPath(platformVersion) + kernel_suffix; + public static String getToolEmulatorRemotePath() { + return toolEmulatorRemotePath; } - public static String getEmulatorBiosPath(String platformVersion) { - return getEmulatorDataPath(platformVersion) + bios_suffix; + // emulator common check tool + public static String getEmulatorCheckToolPath() { + // return getToolEmulatorBinPath(); + return getPlatformEmulatorBinPath(""); } public static String getEmulatorQemuImgPath() { - return getEmulatorToolPath() + qemuImg_suffic; + return getEmulatorCheckToolPath() + qemuImg_suffix; } public static String getCheckCamPath() { - return getEmulatorToolPath() + checkCam_suffix; + return getEmulatorCheckToolPath() + checkCam_suffix; + } + + // emulator platform path + public static String getEmulatorBinPath(String emulatorPath) { + return emulatorPath + bin_suffix; + } + + public static String getEmulatorDataPath(String emulatorPath) { + return emulatorPath + data_suffix; } - public static String getEmulatorImagePath(String platformVersion) { - return getEmulatorPath(platformVersion) + images_suffix; + public static String getEmulatorKernelPath(String emulatorPath) { + return getEmulatorDataPath(emulatorPath) + kernel_suffix; } - public static String getEmulatorDataPath(String platformVersion) { - return getEmulatorPath(platformVersion) + data_suffix; + public static String getEmulatorBiosPath(String emulatorPath) { + return getEmulatorDataPath(emulatorPath) + bios_suffix; } - public static String getEmulatorToolPath() { - // TODO return /tools/emulator/bin - return getEmulatorPath(getLatestPlatformVersion()) + bin_suffix; + public static String getEmulatorImagesPath(String emulatorPath) { + return emulatorPath + images_suffix; } - public static String getEmulatorPath(String platformVersion) { - String emulatorPath = ""; + // platforms/tizen-{version}/common/emulator + public static String getPlatformEmulatorPath(String platformVersion) { + String emulatorPath; if (platformVersion == null || platformVersion.isEmpty()) { platformVersion = getLatestPlatformVersion(); } @@ -406,6 +388,12 @@ public class FilePathResources { return emulatorPath; } + public static String getPlatformEmulatorBinPath(String platformVersion) { + String emulatorPath; + emulatorPath = getPlatformEmulatorPath(platformVersion) + bin_suffix; + return emulatorPath; + } + // Return latest platform version in whole profile. private static String getLatestPlatformVersion() { String latestVersion = "0"; @@ -421,28 +409,6 @@ public class FilePathResources { return latestVersion; } -/* - public String getArchPath(){ - return arcPath; - } - - // ~/tizen_sdk/Emulator/skins/icons/vtm.ico - public String getIconPath(){ - return iconPath; - } - - public String getSkinPath() { - return skinPath; - } -*/ - public static String getDataPath(){ - return dataPath; - } -/* - public String getConfPath(){ - return confPath; - } -*/ public static String getTizenVmsPath() { return sdkDataVmsPath; } @@ -451,25 +417,10 @@ public class FilePathResources { return tizensdkdataEmulatorPath; } - public static String getOldTizenSdkDataEmulatorPath() { - return tizensdkdataOldEmulatorPath; - } - - // ~/tizen_sdk/Emulator/x86/data/pc-bios/bios.bin - public static String getBiosPath() { - return biosPath; - } - public static String getVirtualTargetPath(String name) { return getTizenVmsPath() + File.separator + name; } - /* - public String getVirtualTargetImagePath(String name) { - return getTizenVmsArchPath() + File.separator + name + File.separator + "emulimg-" + name + arch_extension; - } - */ - public static String getVirtualTargetLogPath(String name) { return getVirtualTargetPath(name) + log_suffix; } @@ -493,18 +444,6 @@ public class FilePathResources { return platformsPath; } - public static String getKernelPath() { - return kernelPath; - } - - public static String getOldDefaultImagePath() { - return oldDefaultImagePath; - } - - public static String getDefaultImagePath() { - return defaultImagePath; - } - public static String getPlatformSkinsPath() { return platformSkinsPath; } @@ -521,43 +460,7 @@ public class FilePathResources { return platformImagesPath; } - public static String getSkinPath() { - return defaultSkinPath; - } - - public static String getTemplatePath() { - return defaultTemplatePath; - } - - public static String getEtcPath() { - return etcPath; - } - - public static String getRemotePath() { - return remotePath; - } - public static String getTizenSdkDataPath() { return tizensdkdataPath; } - - public static String getOldSdcardPath() { - return oldSdcardPath; - } - - public static String getOldSwapPath() { - return oldSwapPath; - } - - public static String getOldSdkDataVmsPath() { - return oldSdkDataVmsPath; - } - - public static String getEmulatorPath() { - return emulatorPath; - } - - public static String getResourceSuffix() { - return resource_suffix; - } } diff --git a/src/org/tizen/emulator/manager/tool/About.java b/src/org/tizen/emulator/manager/tool/About.java index 2d50254..bbb8dc4 100644 --- a/src/org/tizen/emulator/manager/tool/About.java +++ b/src/org/tizen/emulator/manager/tool/About.java @@ -120,7 +120,7 @@ public class About { if(ver == null){ BufferedReader about = null; try { - about = new BufferedReader(new FileReader(new File(FilePathResources.getEtcPath() + about = new BufferedReader(new FileReader(new File(FilePathResources.getToolEmulatorEtcPath() + File.separator + "version"))); if (about != null) { ver = about.readLine(); diff --git a/src/org/tizen/emulator/manager/tool/TapUtil.java b/src/org/tizen/emulator/manager/tool/TapUtil.java index c0f824a..325af17 100644 --- a/src/org/tizen/emulator/manager/tool/TapUtil.java +++ b/src/org/tizen/emulator/manager/tool/TapUtil.java @@ -66,7 +66,7 @@ public class TapUtil { private static String BRIDGE_NAME = "bridge1"; public static String getDevconPath(String platformVersion) { - return FilePathResources.getEmulatorBinPath(platformVersion) + return FilePathResources.getPlatformEmulatorBinPath(platformVersion) + File.separator + "devcon.exe"; } @@ -1048,7 +1048,7 @@ public class TapUtil { public static boolean isWinBridgeExist() { String proxyCommand = "check-net.exe"; boolean isExist = false; - List cmd = Arrays.asList(FilePathResources.getEmulatorToolPath() + List cmd = Arrays.asList(FilePathResources.getEmulatorCheckToolPath() + File.separator + proxyCommand, "--bridge"); ProcessResult res = HelperClass.runProcess(cmd); boolean isCommandSuccess = false; @@ -1228,7 +1228,7 @@ public class TapUtil { } EMLogger.getLogger().info("bind interface to bridge"); - cmd = Arrays.asList(FilePathResources.getEmulatorBinPath(platformVersion) + cmd = Arrays.asList(FilePathResources.getPlatformEmulatorBinPath(platformVersion) + File.separator + "bindbridge.exe", "ms_bridge", CompatibleIDs, "bind"); res = HelperClass.runProcess(cmd); @@ -1249,7 +1249,7 @@ public class TapUtil { // Create new tap EMLogger.getLogger().info("Create new tap."); cmd = Arrays.asList(getDevconPath(platformVersion), "install", - FilePathResources.getEmulatorBinPath(platformVersion) + File.separator + FilePathResources.getPlatformEmulatorBinPath(platformVersion) + File.separator + "OemWin2k.inf", "Tap0901"); res = HelperClass.runProcess(cmd); @@ -1295,7 +1295,7 @@ public class TapUtil { EMLogger.getLogger().info("bind host network to bridge"); String tapPnpInstanceID = getPnpInstanceIDFromName(tapName); - cmd = Arrays.asList(FilePathResources.getEmulatorBinPath(platformVersion) + cmd = Arrays.asList(FilePathResources.getPlatformEmulatorBinPath(platformVersion) + File.separator + "bindbridge.exe", "ms_bridge", tapPnpInstanceID, "bind"); res = HelperClass.runProcess(cmd); @@ -1306,7 +1306,7 @@ public class TapUtil { EMLogger.getLogger().info( "wait while finishing bridged network setting"); String proxyCommand = "check-net.exe"; - cmd = Arrays.asList(FilePathResources.getEmulatorToolPath() + cmd = Arrays.asList(FilePathResources.getEmulatorCheckToolPath() + File.separator + proxyCommand, "--bridge"); res = HelperClass.runProcess(cmd); while (!res.getStdOutMsg().isEmpty()) { diff --git a/src/org/tizen/emulator/manager/ui/detail/item/property/CameraImageSubViewItem.java b/src/org/tizen/emulator/manager/ui/detail/item/property/CameraImageSubViewItem.java index 57a611b..bb319dd 100644 --- a/src/org/tizen/emulator/manager/ui/detail/item/property/CameraImageSubViewItem.java +++ b/src/org/tizen/emulator/manager/ui/detail/item/property/CameraImageSubViewItem.java @@ -44,7 +44,7 @@ import org.tizen.emulator.manager.vms.xml.template.Item; public class CameraImageSubViewItem extends FileSubViewItem { private final CameraViewItem cameraViewItem; - String platformVersion; + String emulatorPath; private static final String DEFAULT_FRONT_IMG = "default-image1.gif"; private static final String DEFAULT_REAR_IMG = "default-image2.gif"; @@ -58,7 +58,7 @@ public class CameraImageSubViewItem extends FileSubViewItem { @Override public boolean settingModifyItem(VMPropertyValue value) { - platformVersion = value.baseImage.getVersion(); + emulatorPath = value.baseImage.getPlatform().getEmulatorPath(); newValue = getModifyValue(value); setPathLabel(); @@ -84,7 +84,7 @@ public class CameraImageSubViewItem extends FileSubViewItem { public void activate() { setEnabled(true); if (newValue == null || newValue.isEmpty()) { - newValue = FilePathResources.getEmulatorImagePath(platformVersion) + newValue = FilePathResources.getEmulatorImagesPath(emulatorPath) + File.separator + (CameraViewItem.ITEM_FRONT_IMAGE.equals(name) ? DEFAULT_FRONT_IMG : DEFAULT_REAR_IMG); diff --git a/src/org/tizen/emulator/manager/ui/dialog/TapDeviceDialogForWin.java b/src/org/tizen/emulator/manager/ui/dialog/TapDeviceDialogForWin.java index 58cd688..1e985b7 100644 --- a/src/org/tizen/emulator/manager/ui/dialog/TapDeviceDialogForWin.java +++ b/src/org/tizen/emulator/manager/ui/dialog/TapDeviceDialogForWin.java @@ -88,7 +88,7 @@ public class TapDeviceDialogForWin { // Get intereface list ProcessResult res; ArrayList ifList = new ArrayList(); - List cmd = Arrays.asList(FilePathResources.getEmulatorBinPath(platformVersion) + List cmd = Arrays.asList(FilePathResources.getPlatformEmulatorBinPath(platformVersion) + File.separator + "devcon.exe", "find", "=net", "@pci*"); res = HelperClass.runProcess(cmd); boolean isCommandSuccess = false; diff --git a/src/org/tizen/emulator/manager/vms/VMLauncher.java b/src/org/tizen/emulator/manager/vms/VMLauncher.java index 4a2dea1..0ae7047 100644 --- a/src/org/tizen/emulator/manager/vms/VMLauncher.java +++ b/src/org/tizen/emulator/manager/vms/VMLauncher.java @@ -63,8 +63,8 @@ public class VMLauncher { CheckingRunningEmulator.addEmulator(property); MonitoringEmulator monitor = new MonitoringEmulator(property); - Process process = launch(property.getName(), property.getPropertyValue().baseImage.getVersion(), - cmd, path); + String emulatorPath = property.getPropertyValue().baseImage.getPlatform().getEmulatorPath(); + Process process = launch(property.getName(), emulatorPath, cmd, path); if (process != null) { monitor.setProcess(process); monitor.start(); @@ -100,7 +100,8 @@ public class VMLauncher { private static List getCommand(VMProperty property) throws VMLauncherException { - String binaryPath = FilePathResources.getEmulatorBinPath(property.getPropertyValue().baseImage.getVersion()) + String emulatorPath = property.getPropertyValue().baseImage.getPlatform().getEmulatorPath(); + String binaryPath = FilePathResources.getEmulatorBinPath(emulatorPath) + File.separator + getBinary(); String configPath = LaunchConfig .getLaunchConfigPath(property.getName()); @@ -175,7 +176,7 @@ public class VMLauncher { } } - public static Process launch(String vmName, String platformVersion, + public static Process launch(String vmName, String emulatorPath, List cmd, String binPath) { ProcessBuilder pb = new ProcessBuilder(cmd); @@ -183,7 +184,7 @@ public class VMLauncher { // LogUtil.makeVMBackupLog(vmName); if (binPath == null || binPath.isEmpty()) { - pb.directory(new File(FilePathResources.getEmulatorBinPath(platformVersion))); + pb.directory(new File(FilePathResources.getEmulatorBinPath(emulatorPath))); } else { pb.directory(new File(binPath)); } diff --git a/src/org/tizen/emulator/manager/vms/helper/QemuImgProc.java b/src/org/tizen/emulator/manager/vms/helper/QemuImgProc.java index cc7aba7..8d40afe 100644 --- a/src/org/tizen/emulator/manager/vms/helper/QemuImgProc.java +++ b/src/org/tizen/emulator/manager/vms/helper/QemuImgProc.java @@ -54,7 +54,7 @@ public class QemuImgProc { isError = false; ProcessBuilder pb = new ProcessBuilder(cmd); - pb.directory(new File(FilePathResources.getEmulatorToolPath())); + pb.directory(new File(FilePathResources.getEmulatorCheckToolPath())); try { Process process = pb.start(); if (process != null) { @@ -162,7 +162,7 @@ public class QemuImgProc { isError = false; ProcessBuilder pb = new ProcessBuilder(cmd); - pb.directory(new File(FilePathResources.getEmulatorToolPath())); + pb.directory(new File(FilePathResources.getEmulatorCheckToolPath())); try { Process process = pb.start(); if (process != null) { diff --git a/src/org/tizen/emulator/manager/vms/option/CommonOption.java b/src/org/tizen/emulator/manager/vms/option/CommonOption.java index 3077e79..d5ae563 100644 --- a/src/org/tizen/emulator/manager/vms/option/CommonOption.java +++ b/src/org/tizen/emulator/manager/vms/option/CommonOption.java @@ -66,13 +66,13 @@ public class CommonOption extends Option { config.addQemuOption("#-device virtconsole,chardev=virtcon1"); } - String platformVersion = property.getPropertyValue().baseImage.getVersion(); + String emulatorPath = property.getPropertyValue().baseImage.getPlatform().getEmulatorPath(); // bios - config.addVariable(VAR_BIOS_PATH, FilePathResources.getEmulatorBiosPath(platformVersion)); + config.addVariable(VAR_BIOS_PATH, FilePathResources.getEmulatorBiosPath(emulatorPath)); config.addQemuOption("-L", varForm(VAR_BIOS_PATH)); // kernel image - config.addVariable(VAR_KERNEL, FilePathResources.getEmulatorKernelPath(platformVersion) + config.addVariable(VAR_KERNEL, FilePathResources.getEmulatorKernelPath(emulatorPath) + File.separator + "bzImage." + property.getArch().toString()); config.addQemuOption("-kernel", varForm(VAR_KERNEL)); diff --git a/src/org/tizen/emulator/manager/vms/option/NetProxyOption.java b/src/org/tizen/emulator/manager/vms/option/NetProxyOption.java index d22263c..aa26c6e 100644 --- a/src/org/tizen/emulator/manager/vms/option/NetProxyOption.java +++ b/src/org/tizen/emulator/manager/vms/option/NetProxyOption.java @@ -121,7 +121,7 @@ public class NetProxyOption extends Option { proxyCommand = "check-net.exe"; } - List cmd = Arrays.asList(FilePathResources.getEmulatorToolPath() + List cmd = Arrays.asList(FilePathResources.getEmulatorCheckToolPath() + File.separator + proxyCommand, "--proxy"); ProcessResult res = HelperClass.runProcess(cmd); boolean isCommandSuccess = false;