LAUNCH: fix launch to support 3.0 platform
authorByeongki Shin <bk0121.shin@samsung.com>
Wed, 5 Apr 2017 02:00:30 +0000 (11:00 +0900)
committerByeongki Shin <bk0121.shin@samsung.com>
Wed, 5 Apr 2017 07:13:41 +0000 (16:13 +0900)
Since the 3.0 platform was changed in the rootstrap, pkgcmd and so on,
the platform IDE should support the changes of platform.
More detailed modification is like followings;

1. Before platform ide pushes the output rpm files,
   it checks not only i586 arch but also i686.
2. If target platform's version is 3.0,
   platform ide doesn't expose the pkgcmd install UI,
   because 3.0 platform's pkgcmd doesn't support rpm type any more.
3. Unused code and some convention are trimmed.

Change-Id: Ifc170b198799c72ad64a19332673d4dc36d63dc5
Signed-off-by: Byeongki Shin <bk0121.shin@samsung.com>
org.tizen.nativeplatform.launcher/src/org/tizen/nativeplatform/launcher/delegate/AttachLaunchConfigurationProcessor.java
org.tizen.nativeplatform.launcher/src/org/tizen/nativeplatform/launcher/delegate/ITizenLaunchConfigurationConstants.java
org.tizen.nativeplatform.launcher/src/org/tizen/nativeplatform/launcher/delegate/LaunchConfigurationProcessor.java
org.tizen.nativeplatform.launcher/src/org/tizen/nativeplatform/launcher/delegate/PlatformLaunchDelegate.java
org.tizen.nativeplatform.launcher/src/org/tizen/nativeplatform/launcher/delegate/PlatformLaunchDelegateForInstallAs.java
org.tizen.nativeplatform.launcher/src/org/tizen/nativeplatform/launcher/wizard/pages/PlatformLaunchSettingPkgPage.java
org.tizen.nativeplatform.launcher/src/org/tizen/nativeplatform/launcher/wizards/PlatformAttachLaunchWizard.java
org.tizen.nativeplatform.launcher/src/org/tizen/nativeplatform/launcher/wizards/PlatformCommonLaunchWizard.java
org.tizen.nativeplatform.launcher/src/org/tizen/nativeplatform/launcher/wizards/PlatformInstallAsWizard.java
org.tizen.nativeplatform.launcher/src/org/tizen/nativeplatform/launcher/wizards/PlatformLaunchWizard.java
org.tizen.nativeplatform.linux/src/org/tizen/nativeplatform/linux/util/PackageUtil.java

index bc0a964..ae2cd7b 100644 (file)
@@ -1,10 +1,8 @@
 package org.tizen.nativeplatform.launcher.delegate;
 
-import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
 import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
 import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
@@ -20,6 +18,8 @@ import org.eclipse.debug.core.ILaunchManager;
 import org.eclipse.jface.window.Window;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Shell;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.tizen.common.util.DialogUtil;
 import org.tizen.common.util.SWTUtil;
 import org.tizen.common.util.log.UserInteraction;
@@ -35,13 +35,11 @@ import org.tizen.nativeplatform.launcher.rpm.RpmPackageLauncher;
 import org.tizen.nativeplatform.launcher.wizards.PlatformAttachLaunchWizard;
 import org.tizen.nativeplatform.launcher.wizards.PlatformLaunchWizardDialog;
 import org.tizen.nativeplatform.pkg.commander.IPkgCommander;
-import org.tizen.nativeplatform.pkg.commander.IPkgModelMaker;
 import org.tizen.nativeplatform.pkg.commander.PkgCommandTarget;
 import org.tizen.nativeplatform.pkg.model.IPackage;
 import org.tizen.nativeplatform.pkg.tools.RpmTool;
 import org.tizen.nativeplatform.types.CmdTargetTypes;
 import org.tizen.nativeplatform.types.LaunchTypes;
-import org.tizen.nativeplatform.util.CommonPackageUtil;
 import org.tizen.nativeplatform.util.IPackageUtil;
 import org.tizen.nativeplatform.util.PlatformLaunchUtil;
 import org.tizen.nativeplatform.util.PlatformProjectUtil;
@@ -62,6 +60,8 @@ public class AttachLaunchConfigurationProcessor implements ILaunchConfigurationP
     private String deviceInstallLog = "";
     private boolean continueLaunch = true;
 
+    private final Logger logger = LoggerFactory.getLogger(getClass());
+
     public AttachLaunchConfigurationProcessor(Shell shell, ILaunchConfiguration launchConfig,
             IProject project, String mode, PkgCommandTarget target, IProgressMonitor monitor) {
         this.shell = shell;
@@ -166,8 +166,15 @@ public class AttachLaunchConfigurationProcessor implements ILaunchConfigurationP
             SWTUtil.syncExec(new Runnable() {
                 @Override
                 public void run() {
-                    PlatformAttachLaunchWizard wizard = new PlatformAttachLaunchWizard(shell, launchConfig, 
-                            project, buildConfig, target, mode);
+                    boolean isPlatformVersion3 = false;
+                    try {
+                        isPlatformVersion3 = wc.getAttribute(ITizenLaunchConfigurationConstants.ATTR_TARGET_PLATFORM_VERSION, false);
+                    } catch (CoreException e) {
+                        logger.error("Failed to get platform version from config", e);
+                    }
+
+                    PlatformAttachLaunchWizard wizard = new PlatformAttachLaunchWizard(shell, launchConfig,
+                            project, buildConfig, target, mode, isPlatformVersion3);
                     PlatformLaunchWizardDialog dlg = new PlatformLaunchWizardDialog(shell, wizard);
                     dlg.create();
                     if (Window.OK == dlg.open()) {
@@ -177,7 +184,7 @@ public class AttachLaunchConfigurationProcessor implements ILaunchConfigurationP
                         boolean selectPkgOp = false;
                         String procName = dlg.getProcName();
                         int pid = dlg.getProcId();
-                        
+
                         setOptionAttributes(wc, programPath, procName, pid, reinstallOp,
                                 selectPkgOp);
                     }
@@ -196,7 +203,7 @@ public class AttachLaunchConfigurationProcessor implements ILaunchConfigurationP
             return false;
         }
     }
-    
+
     protected void setOptionAttributes(ILaunchConfigurationWorkingCopy wc, String programPath,
             String procName, int pid, boolean reinstallOp, boolean selectPkgOp) {
         if (programPath != null) {
index a27c529..ae484f7 100644 (file)
@@ -51,4 +51,6 @@ public interface ITizenLaunchConfigurationConstants {
     public static final String ATTR_ROOTSTRAP_NAME = PLATFORM_LAUNCH_ID + ".ROOTSTRAP_ATTR"; //$NON-NLS-1$
     public static final String ATTR_COREFILE_LOCATION = PLATFORM_LAUNCH_ID + ".COREFILE_LOC_ATTR"; //$NON-NLS-1$
     public static final String ATTR_FORWARD_TARGET_PORT = PLATFORM_LAUNCH_ID + ".DEBUG_REALPORT";
+
+    public static final String ATTR_TARGET_PLATFORM_VERSION = PLATFORM_LAUNCH_ID + ".TARGET_PLATFORM_VERSION";
 }
index 13a87f9..af56b87 100644 (file)
@@ -21,6 +21,8 @@ import org.eclipse.debug.core.ILaunchManager;
 import org.eclipse.jface.window.Window;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Shell;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.tizen.common.util.DialogUtil;
 import org.tizen.common.util.SWTUtil;
 import org.tizen.common.util.log.UserInteraction;
@@ -66,6 +68,8 @@ public class LaunchConfigurationProcessor implements ILaunchConfigurationProcess
     private boolean continueLaunch = true;
     private boolean onlyInstall = false;
 
+    private final Logger logger = LoggerFactory.getLogger(getClass());
+
     public LaunchConfigurationProcessor() {
 
     }
@@ -249,16 +253,22 @@ public class LaunchConfigurationProcessor implements ILaunchConfigurationProcess
                 public void run() {
                     PlatformLaunchWizard wizard;
                     PlatformLaunchWizardDialog wizardDlg;
-
                     PlatformInstallAsWizard installWizard;
 
+                    boolean isPlatformVersion3 = false;
+                    try {
+                        isPlatformVersion3 = wc.getAttribute(ITizenLaunchConfigurationConstants.ATTR_TARGET_PLATFORM_VERSION, false);
+                    } catch (CoreException e) {
+                        logger.error("Failed to get platform version from config", e);
+                    }
+
                     if (onlyInstall) {
                         installWizard = new PlatformInstallAsWizard(shell, launchConfig, project,
-                                buildConfig, target, mode, isEflApp);
+                                buildConfig, target, mode, isEflApp, isPlatformVersion3);
                         wizardDlg = new PlatformLaunchWizardDialog(shell, installWizard);
                     } else {
                         wizard = new PlatformLaunchWizard(shell, launchConfig, project,
-                                buildConfig, target, mode, isEflApp);
+                                buildConfig, target, mode, isEflApp, isPlatformVersion3);
 
                         wizardDlg = new PlatformLaunchWizardDialog(shell, wizard);
                     }
index a19793c..75a5b19 100644 (file)
@@ -195,6 +195,22 @@ public class PlatformLaunchDelegate extends AbstractCLaunchDelegate {
             }
             */
 
+            String targetPlatformVersion = null;
+            boolean isPlatformVersion3 = false;
+
+            try {
+                targetPlatformVersion = currentDevice.getPlatformInfo().getPlatformVersion();
+            } catch (IOException e) {
+                logger.error("Failed to get platform version", e);
+            }
+
+            if ("3.0".equals(targetPlatformVersion)) {
+                isPlatformVersion3 = true;
+            }
+            ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
+            wc.setAttribute(ITizenLaunchConfigurationConstants.ATTR_TARGET_PLATFORM_VERSION, isPlatformVersion3);
+            config = wc.doSave();
+
             ILaunchConfigurationProcessor processor = getConfigurationProcessor(shell, config,
                     project, mode, target, new SubProgressMonitor(monitor, 1));
             if (!processor.process()) {
index f244789..74f5e6e 100644 (file)
@@ -1,6 +1,7 @@
 package org.tizen.nativeplatform.launcher.delegate;
 
 import java.io.File;
+import java.io.IOException;
 import java.util.List;
 
 import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
@@ -17,6 +18,7 @@ import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.SubProgressMonitor;
 import org.eclipse.debug.core.ILaunch;
 import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
 import org.eclipse.debug.core.ILaunchManager;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
@@ -51,7 +53,7 @@ import org.tizen.sdblib.IDevice;
  * PlatformLaunchDelegateForInstallAs
  *
  * InstallAs feature in Context menu
- *  
+ *
  * @author jm.jaemin.kim{@literal <jm.jaemin.kim>} (S-Core)
  *
  */
@@ -82,6 +84,8 @@ public class PlatformLaunchDelegateForInstallAs extends AbstractCLaunchDelegate
     protected static final String EMULATOR_CLI_BIN = EMULATOR_PATH + File.separatorChar + "bin"
             + File.separatorChar + "ecp-cli";
 
+    private final Logger logger = LoggerFactory.getLogger(getClass());
+
     @Override
     protected String getPluginID() {
         return null;
@@ -117,6 +121,22 @@ public class PlatformLaunchDelegateForInstallAs extends AbstractCLaunchDelegate
                         target.getRootstrap());
             }
 
+            String targetPlatformVersion = null;
+            boolean isPlatformVersion3 = false;
+
+            try {
+                targetPlatformVersion = currentDevice.getPlatformInfo().getPlatformVersion();
+            } catch (IOException e) {
+                logger.error("Failed to get platform version", e);
+            }
+
+            if ("3.0".equals(targetPlatformVersion)) {
+                isPlatformVersion3 = true;
+            }
+            ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
+            wc.setAttribute(ITizenLaunchConfigurationConstants.ATTR_TARGET_PLATFORM_VERSION, isPlatformVersion3);
+            config = wc.doSave();
+
             ILaunchConfigurationProcessor processor = getConfigurationProcessor(shell, config,
                     project, mode, target, new SubProgressMonitor(monitor, 1));
             if (!processor.process()) {
@@ -141,11 +161,11 @@ public class PlatformLaunchDelegateForInstallAs extends AbstractCLaunchDelegate
             PkgCommandTarget target, IProgressMonitor monitor) {
         return new LaunchConfigurationProcessor(shell, launchConfig, project, mode, target, monitor, true);
     }
-    
+
     protected void setPkgCommandTarget() {
         target = new PkgCommandTarget(PlatformProjectUtil.getPkgType(), currentDevice, rootstrap);
     }
-    
+
     protected void activateProgressView() {
         Display.getDefault().syncExec(new Runnable() {
             public void run() {
@@ -158,6 +178,7 @@ public class PlatformLaunchDelegateForInstallAs extends AbstractCLaunchDelegate
             }
         });
     }
+
     protected void checkPackageFiles(IProject project, IConfiguration config) throws CoreException {
 
         String selectedRootstrapArch = RootstrapProxy.getProxy().getSelectedRootstrap()
@@ -181,10 +202,11 @@ public class PlatformLaunchDelegateForInstallAs extends AbstractCLaunchDelegate
             }
         }
     }
-    
+
     protected IConfiguration getBuildConfiguration(IProject project) {
         return PlatformConfigurationManager.getDefaultConfiguration(project);
     }
+
     protected IProject getProject(ILaunchConfiguration config) throws CoreException {
         String projectName = config.getAttribute(
                 ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, "");
@@ -192,5 +214,5 @@ public class PlatformLaunchDelegateForInstallAs extends AbstractCLaunchDelegate
             newCoreException(PlatformLaunchMessages.CANNOT_FIND_PROJECT_NAME, null);
         }
         return ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
-    }    
+    }
 }
index ac20921..7f5e310 100644 (file)
@@ -159,9 +159,13 @@ public class PlatformLaunchSettingPkgPage extends PlatformLaunchCommonPage {
     private void createButtons(Composite parent) {
         Composite composite = new Composite(parent, SWT.NONE);
         GridLayout gridLayout = new GridLayout();
-        gridLayout.numColumns = 3;
         gridLayout.marginWidth = 0;
         gridLayout.marginHeight = 0;
+        if (wizard.isPlatformVersion3()) {
+            gridLayout.numColumns = 2;
+        } else {
+            gridLayout.numColumns = 3;
+        }
         composite.setLayout(gridLayout);
         composite.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
                 | GridData.HORIZONTAL_ALIGN_FILL));
@@ -182,20 +186,22 @@ public class PlatformLaunchSettingPkgPage extends PlatformLaunchCommonPage {
             }
         });
 
-        Button selectPkgcmdBt = new Button(composite, SWT.NONE);
-        selectPkgcmdBt.setText(resources.getString("PkgSelectionPage.Button.SelectPkgcmd"));
-        selectPkgcmdBt.setLayoutData(gridData);
-        selectPkgcmdBt.addSelectionListener(new SelectionListener() {
+        if (!wizard.isPlatformVersion3()) {
+            Button selectPkgcmdBt = new Button(composite, SWT.NONE);
+            selectPkgcmdBt.setText(resources.getString("PkgSelectionPage.Button.SelectPkgcmd"));
+            selectPkgcmdBt.setLayoutData(gridData);
+            selectPkgcmdBt.addSelectionListener(new SelectionListener() {
 
-            @Override
-            public void widgetDefaultSelected(SelectionEvent arg0) {
-            }
+                @Override
+                public void widgetDefaultSelected(SelectionEvent arg0) {
+                }
 
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                toolButtonClickHandler(PkgcmdTool.NAME);
-            }
-        });
+                @Override
+                public void widgetSelected(SelectionEvent arg0) {
+                    toolButtonClickHandler(PkgcmdTool.NAME);
+                }
+            });
+        }
 
         Button notInstallBt = new Button(composite, SWT.NONE);
         notInstallBt.setText(resources.getString("PkgSelectionPage.Button.NotInstAll"));
@@ -239,7 +245,12 @@ public class PlatformLaunchSettingPkgPage extends PlatformLaunchCommonPage {
                 | SWT.FULL_SELECTION);
         packageTableDevice.setData("target", "device");
         Table table = packageTableDevice.getTable();
-        createPackageTableColumns(deviceGroup, packageTableDevice, true);
+
+        /* W/A for 3.0 platform support
+         * Since pkgcmd of 3.0 platform doesn't support rpm file any more,
+         * Platform IDE doesn't expose rpm selection UI.
+         */
+        createPackageTableColumns(deviceGroup, packageTableDevice, !wizard.isPlatformVersion3());
         table.setHeaderVisible(true);
         table.setLinesVisible(true);
 
index be62e59..f34f540 100644 (file)
@@ -28,7 +28,6 @@
 package org.tizen.nativeplatform.launcher.wizards;
 
 import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
 import java.util.List;
 
 import org.eclipse.cdt.managedbuilder.core.IConfiguration;
@@ -77,10 +76,11 @@ public class PlatformAttachLaunchWizard extends PlatformCommonLaunchWizard {
     }
 
     public PlatformAttachLaunchWizard(Shell shell, ILaunchConfiguration launchConfig,
-            IProject project, IConfiguration config, PkgCommandTarget target, String mode) {
+            IProject project, IConfiguration config, PkgCommandTarget target, String mode, boolean isPlatformVersion3) {
         super(shell, launchConfig, project, config, target, mode);
 
         this.pkgFilter = PkgFilterFactory.getFilter(PlatformProjectUtil.getPkgType());
+        this.isPlatformVersion3 = isPlatformVersion3;
     }
 
     @Override
@@ -90,7 +90,7 @@ public class PlatformAttachLaunchWizard extends PlatformCommonLaunchWizard {
                 target);
         page1.disableDeviceGroup();
         addPage(page1);
-        
+
         // set page 2
         addPage(new PlatformLaunchSettingProcPage(this, shell, SETTING_PROC_PAGE, project, config,
                 target));
@@ -120,10 +120,10 @@ public class PlatformAttachLaunchWizard extends PlatformCommonLaunchWizard {
         }
         programPath = page.getProgramPath();
         pid = page.getPid();
-        //packages = page.getPackages();
+        // packages = page.getPackages();
         IWizardContainer container = getContainer();
         reinstallOp = page.getReinstallOp();
-        //selectPkgOp = page.getSelectPkgOp();
+        // selectPkgOp = page.getSelectPkgOp();
         procName = page.getProcName();
         pid = page.getPid();
 
@@ -175,7 +175,7 @@ public class PlatformAttachLaunchWizard extends PlatformCommonLaunchWizard {
                 && targetPage.getName().equals(SETTING_PROC_PAGE)) {
             PlatformLaunchSettingPkgPage pkgPage = (PlatformLaunchSettingPkgPage) currentPage;
             PlatformLaunchSettingProcPage procPage = (PlatformLaunchSettingProcPage) targetPage;
-            
+
             // save package install information
             pkgPage.savePkgInstallInfo();
 
@@ -219,7 +219,7 @@ public class PlatformAttachLaunchWizard extends PlatformCommonLaunchWizard {
             } catch (Exception e) {
                 e.printStackTrace();
                 openErrorDialog(e.toString());
-                //currentPage.setMessage(e.toString());
+                // currentPage.setMessage(e.toString());
                 cancelChanging(event);
                 return;
             }
index 0691392..5813d5b 100644 (file)
@@ -70,6 +70,7 @@ public class PlatformCommonLaunchWizard extends Wizard implements IPageChangingL
     protected String deviceLog = "";
     protected String rootstrapLog = "";
     protected boolean loadSharedLib = true;
+    protected boolean isPlatformVersion3 = false;
 
     public PlatformCommonLaunchWizard() {
     }
@@ -122,6 +123,10 @@ public class PlatformCommonLaunchWizard extends Wizard implements IPageChangingL
         return programPath;
     }
 
+    public boolean isPlatformVersion3() {
+        return isPlatformVersion3;
+    }
+
     public String getArguments() {
         return arguments;
     }
@@ -145,9 +150,9 @@ public class PlatformCommonLaunchWizard extends Wizard implements IPageChangingL
     public Map<String, String> getEnvironments() {
         return envs;
     }
-    
+
     public boolean loadSharedLibAutomatically() {
-       return loadSharedLib;
+        return loadSharedLib;
     }
 
     @Override
index db6feff..fe18510 100644 (file)
 package org.tizen.nativeplatform.launcher.wizards;
 
 import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
 
 import org.eclipse.cdt.managedbuilder.core.IConfiguration;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.SubProgressMonitor;
 import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchManager;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.wizard.IWizardContainer;
 import org.eclipse.jface.wizard.WizardDialog;
@@ -51,8 +48,6 @@ import org.tizen.nativeplatform.pkg.commander.IPkgCommander;
 import org.tizen.nativeplatform.pkg.commander.PkgCommandTarget;
 import org.tizen.nativeplatform.pkg.model.IPackage;
 import org.tizen.nativeplatform.types.CmdTargetTypes;
-import org.tizen.nativeplatform.types.LaunchTypes;
-import org.tizen.nativeplatform.util.PlatformLaunchUtil;
 import org.tizen.nativeplatform.util.PlatformProjectUtil;
 
 /**
@@ -75,9 +70,10 @@ public class PlatformInstallAsWizard extends PlatformCommonLaunchWizard {
 
     public PlatformInstallAsWizard(Shell shell, ILaunchConfiguration launchConfig,
             IProject project, IConfiguration config, PkgCommandTarget target, String mode,
-            boolean isEFL) {
+            boolean isEFL, boolean isPlatformVersion3) {
         super(shell, launchConfig, project, config, target, mode);
         setWindowTitle("Install Packages Configuration");
+        this.isPlatformVersion3 = isPlatformVersion3;
         this.target = target;
         this.pkgFilter = PkgFilterFactory.getFilter(PlatformProjectUtil.getPkgType());
     }
@@ -95,7 +91,7 @@ public class PlatformInstallAsWizard extends PlatformCommonLaunchWizard {
             pkgPage.savePkgInstallInfo();
 
             final List<IPackage> checkedDevicePkgs = pkgPage.getCheckedDevicePackage();
-            final List<IPackage> checkedRootstrapPkgs = pkgPage.getCheckedRootstrapPackage();            
+            final List<IPackage> checkedRootstrapPkgs = pkgPage.getCheckedRootstrapPackage();
             IWizardContainer container = getContainer();
             try {
                 container.run(true, true, new IRunnableWithProgress() {
@@ -156,37 +152,4 @@ public class PlatformInstallAsWizard extends PlatformCommonLaunchWizard {
         dialog.addPageChangedListener(this);
         dialog.addPageChangingListener(this);
     }
-
-    private void setSmackRule() {
-        String[] programPaths = PlatformLaunchUtil.getProgramPath(project);
-        if (programPaths == null || programPaths.length <= 0) {
-            return;
-        }
-        IPkgCommander commander = target.getDeviceCommander();
-        StringBuffer pathlist = new StringBuffer();
-        for (String path : programPaths) {
-            pathlist.append(path);
-            pathlist.append(" ");
-        }
-        String list = pathlist.toString().trim();
-        Map<String, String[]> smackInfo = PlatformLaunchUtil.getSmackInfo(commander, list);
-        if (smackInfo == null) {
-            return;
-        }
-        for (String filepath : smackInfo.keySet()) {
-            String[] labels = smackInfo.get(filepath);
-            String a_label = labels[0];
-            if (a_label != null && !a_label.isEmpty()) {
-                commander.executeBinaryBySudo(getSmackRuleCommand(a_label));
-            }
-            commander.setSmackExecute(filepath, "\"\"");
-        }
-    }
-
-    private String getSmackRuleCommand(String value) {
-        value = value.replaceAll("\"", "");
-        String cmd = String.format("echo \"sdbd::home %s rwx\" | smackload", value);
-        return cmd;
-    }
-
 }
index 4554cea..29fd6fc 100644 (file)
@@ -29,7 +29,6 @@ package org.tizen.nativeplatform.launcher.wizards;
 
 import java.lang.reflect.InvocationTargetException;
 import java.util.List;
-import java.util.Map;
 
 import org.eclipse.cdt.managedbuilder.core.IConfiguration;
 import org.eclipse.core.resources.IProject;
@@ -53,12 +52,10 @@ import org.tizen.nativeplatform.launcher.rpm.RpmPackageLauncher;
 import org.tizen.nativeplatform.launcher.wizard.pages.PlatformEFLLaunchSettingPage;
 import org.tizen.nativeplatform.launcher.wizard.pages.PlatformLaunchSettingPage;
 import org.tizen.nativeplatform.launcher.wizard.pages.PlatformLaunchSettingPkgPage;
-import org.tizen.nativeplatform.pkg.commander.IPkgCommander;
 import org.tizen.nativeplatform.pkg.commander.PkgCommandTarget;
 import org.tizen.nativeplatform.pkg.model.IPackage;
 import org.tizen.nativeplatform.types.CmdTargetTypes;
 import org.tizen.nativeplatform.types.LaunchTypes;
-import org.tizen.nativeplatform.util.PlatformLaunchUtil;
 import org.tizen.nativeplatform.util.PlatformProjectUtil;
 
 public class PlatformLaunchWizard extends PlatformCommonLaunchWizard {
@@ -74,8 +71,9 @@ public class PlatformLaunchWizard extends PlatformCommonLaunchWizard {
     }
 
     public PlatformLaunchWizard(Shell shell, ILaunchConfiguration launchConfig, IProject project,
-            IConfiguration config, PkgCommandTarget target, String mode, boolean isEFL) {
+            IConfiguration config, PkgCommandTarget target, String mode, boolean isEFL, boolean isPlatformVersion3) {
         super(shell, launchConfig, project, config, target, mode);
+        this.isPlatformVersion3 = isPlatformVersion3;
         this.isEFL = isEFL;
         this.pkgFilter = PkgFilterFactory.getFilter(PlatformProjectUtil.getPkgType());
     }
@@ -103,7 +101,7 @@ public class PlatformLaunchWizard extends PlatformCommonLaunchWizard {
         // set page 1
         PlatformLaunchSettingPkgPage page1 = new PlatformLaunchSettingPkgPage(this, shell, SETTING_PKG_PAGE, project, config,
                 target);
-        // if launch mode is run, disable rootstrap group 
+        // if launch mode is run, disable rootstrap group
         if (mode.equals("run")) {
             page1.disableRootstrapGroup();
         }
@@ -180,7 +178,7 @@ public class PlatformLaunchWizard extends PlatformCommonLaunchWizard {
                             if (mode.equals(ILaunchManager.DEBUG_MODE)) {
                                 pkgLauncher.debugLaunchPkgs(LaunchTypes.NONE, shell,
                                         new SubProgressMonitor(monitor, 1));
-                                //setSmackRule();
+                                // setSmackRule();
                             } else {
                                 pkgLauncher.launchPkgs(shell, new SubProgressMonitor(monitor, 1));
                             }
@@ -196,42 +194,10 @@ public class PlatformLaunchWizard extends PlatformCommonLaunchWizard {
             } catch (Exception e) {
                 e.printStackTrace();
                 openErrorDialog(e.toString());
-                //currentPage.setMessage(e.toString());
+                // currentPage.setMessage(e.toString());
                 cancelChanging(event);
             }
             settingPage.validate();
         }
     }
-
-    private void setSmackRule() {
-        String[] programPaths = PlatformLaunchUtil.getProgramPath(project);
-        if (programPaths == null || programPaths.length <= 0) {
-            return;
-        }
-        IPkgCommander commander = target.getDeviceCommander();
-        StringBuffer pathlist = new StringBuffer();
-        for (String path : programPaths) {
-            pathlist.append(path);
-            pathlist.append(" ");
-        }
-        String list = pathlist.toString().trim();
-        Map<String, String[]> smackInfo = PlatformLaunchUtil.getSmackInfo(commander, list);
-        if (smackInfo == null) {
-            return;
-        }
-        for (String filepath : smackInfo.keySet()) {
-            String[] labels = smackInfo.get(filepath);
-            String a_label = labels[0];
-            if (a_label != null && !a_label.isEmpty()) {
-                commander.executeBinaryBySudo(getSmackRuleCommand(a_label));
-            }
-            commander.setSmackExecute(filepath, "\"\"");
-        }
-    }
-
-    private String getSmackRuleCommand(String value) {
-        value = value.replaceAll("\"", "");
-        String cmd = String.format("echo \"sdbd::home %s rwx\" | smackload", value);
-        return cmd;
-    }
 }
index 2d9c031..e16ecef 100644 (file)
@@ -74,8 +74,11 @@ public class PackageUtil implements IPackageUtil {
 
         List<IPackage> cached = PackageStoreManager.get(project, config);
 
-        if (cached != null) {
-            if (cached.get(0).getArch().equals(selectedRootstrapArch)) {
+        if ((cached != null) && (cached.get(0) != null)) {
+            String cachedArch = cached.get(0).getArch();
+            // For i686 rootstrap, we can't know its naming rule.
+            // Therefore, we support rpm files for i686 named.
+            if (cachedArch.equals(selectedRootstrapArch) || cachedArch.equals("i686")) {
                 return cached;
             } else {
                 return null;