LOG: Added logger code to check performance
authordonghyuk.yang <donghyuk.yang@samsung.com>
Sat, 26 Apr 2014 14:58:55 +0000 (23:58 +0900)
committerdonghyuk.yang <donghyuk.yang@samsung.com>
Sat, 26 Apr 2014 14:58:55 +0000 (23:58 +0900)
Need to check performance for creating, building, launching a project

Change-Id: Ifa20dd909704855bb214c5f7732b221cbb929b30
Signed-off-by: donghyuk.yang <donghyuk.yang@samsung.com>
12 files changed:
org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformExternalBuildRunner.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/gbs/GBSBuildResultProcessor.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/LaunchConfigurationProcessor.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/PlatformLaunchDelegate.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/shortcut/PlatformProjectLaunchShortcut.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkg/commander/rpm/RpmPackageLauncher.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/RootstrapSyncronizer.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/rootstrap/RootstrapManager.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/util/PlatformUserInteraction.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/views/ui/RemoteConnectionDialog.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/views/ui/RootstrapView.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/wizards/TizenPlatformProjectWizard.java

index 218fbc9..cc1df88 100644 (file)
@@ -85,6 +85,7 @@ import org.eclipse.core.runtime.QualifiedName;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.SubProgressMonitor;
 import org.eclipse.swt.widgets.Display;
+import org.tizen.common.util.OSChecker;
 import org.tizen.common.util.log.UserInteraction;
 import org.tizen.common.util.log.UserLogger;
 import org.tizen.nativecommon.build.SmartBuildInterface;
@@ -117,8 +118,8 @@ public class PlatformExternalBuildRunner extends ExternalBuildRunner {
         String targetId = PlatformConfigurationManager.getBuildTargetName(configuration);
         String rootId = SmartBuildInterface.getInstance().getRootstrapIDFromTargetID(targetId);
         final PlatformRootstrap rootstrap = RootstrapManager.getRootstrap(rootId);
-        boolean isCleanOption = buildArgs[0].equals("clean");
-        if (!isCleanOption) {
+        boolean needRemoteSync = OSChecker.isWindows() && buildArgs[0].equals("clean");
+        if (needRemoteSync) {
             syncWorkspace(project, configuration, monitor);
             readySyncRootstrap(rootstrap);
         }
@@ -134,14 +135,18 @@ public class PlatformExternalBuildRunner extends ExternalBuildRunner {
             }
         });
         
-        if (!isCleanOption) {
+        if (needRemoteSync) {
+            /*
             Display.getDefault().asyncExec(new Runnable() {
                 public void run() {
                     syncRootstrap(rootstrap);
                 }
             });
+            */
+        } else {
+            CCorePlugin.getIndexManager().reindex(CoreModel.getDefault().create(project));
         }
-        CCorePlugin.getIndexManager().reindex(CoreModel.getDefault().create(project));
+        
         return isClean;
     }
     
index 932e160..cf3fcb6 100644 (file)
@@ -71,6 +71,11 @@ public class GBSBuildResultProcessor implements IBuildResultProcessor {
 
     @Override
     public boolean process(String[] buildArguments) {
+        if (buildArguments != null && buildArguments.length > 0) {
+            if (buildArguments[0].equals("clean")) {
+                return true;
+            }
+        }
         boolean result = false;
         UserLogger.start(PlatformUserInteraction.CATE_SYNCRONIZE, PlatformUserInteraction.SYNC_OUTPUT);
         if (OSChecker.isWindows()) {
@@ -83,11 +88,6 @@ public class GBSBuildResultProcessor implements IBuildResultProcessor {
     }
 
     private boolean localProcess(String[] buildArguments) {
-        if (buildArguments != null && buildArguments.length > 0) {
-            if (buildArguments[0].equals("clean")) {
-                return true;
-            }
-        }
         String targetId = PlatformConfigurationManager.getBuildTargetName(config);
         String rootId = SmartBuildInterface.getInstance().getRootstrapIDFromTargetID(targetId);
         PlatformRootstrap rootstrap = RootstrapManager.getRootstrap(rootId);
index a69824b..39cf959 100644 (file)
@@ -20,6 +20,8 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Shell;
 import org.tizen.common.util.DialogUtil;
 import org.tizen.common.util.SWTUtil;
+import org.tizen.common.util.log.UserInteraction;
+import org.tizen.common.util.log.UserLogger;
 import org.tizen.nativeplatform.Activator;
 import org.tizen.nativeplatform.build.PlatformConfigurationManager;
 import org.tizen.nativeplatform.launch.wizards.PlatformLaunchWizard;
@@ -37,6 +39,7 @@ import org.tizen.nativeplatform.types.CmdTargetTypes;
 import org.tizen.nativeplatform.types.LaunchTypes;
 import org.tizen.nativeplatform.util.PackageUtil;
 import org.tizen.nativeplatform.util.PlatformProjectUtil;
+import org.tizen.nativeplatform.util.PlatformUserInteraction;
 
 public class LaunchConfigurationProcessor implements ILaunchConfigurationProcessor {
     private ILaunchConfiguration launchConfig;
@@ -75,7 +78,9 @@ public class LaunchConfigurationProcessor implements ILaunchConfigurationProcess
                         ITizenLaunchConfigurationConstants.ATTR_APPLICATION_ID, "");
                 killIfRunningApplication(appId);
             }
-            return installPackages(configurationIsSet, monitor);
+            boolean result = installPackages(configurationIsSet, monitor);
+            UserLogger.end(UserInteraction.CATE_PLATFORM_LAUNCH, PlatformUserInteraction.PRE_LAUNCH);
+            return result;
         } else {
             monitor.beginTask("", 2);
             try {
@@ -83,8 +88,8 @@ public class LaunchConfigurationProcessor implements ILaunchConfigurationProcess
                 if (!installPackages(configurationIsSet, new SubProgressMonitor(monitor, 1))) {
                     descMsg = "Installation seems to be failed. Check package installation log.";
                 }
-                if (!setLaunchConfigurationForEFL(new SubProgressMonitor(monitor, 1), descMsg,
-                        isEflApp)) {
+                UserLogger.end(UserInteraction.CATE_PLATFORM_LAUNCH, PlatformUserInteraction.PRE_LAUNCH);
+                if (!setLaunchConfigurationForEFL(new SubProgressMonitor(monitor, 1), descMsg, isEflApp)) {
                     return false;
                 }
             } finally {
@@ -158,6 +163,7 @@ public class LaunchConfigurationProcessor implements ILaunchConfigurationProcess
 
     private boolean setLaunchConfigurationForEFL(IProgressMonitor monitor, final String descMsg,
             final boolean isEflApp) throws CoreException {
+        
         monitor.beginTask("", 1);
         final ILaunchConfigurationWorkingCopy wc = launchConfig.getWorkingCopy();
         try {
@@ -181,7 +187,7 @@ public class LaunchConfigurationProcessor implements ILaunchConfigurationProcess
         } finally {
             monitor.done();
         }
-
+        
         if (isSetProgramPath(launchConfig)) {
             if (applicationId != null && !applicationId.isEmpty()) {
                 killIfRunningApplication(applicationId);
index b0f5ced..1994fbf 100644 (file)
@@ -120,6 +120,7 @@ import org.tizen.nativeplatform.types.CmdTargetTypes;
 import org.tizen.nativeplatform.util.PackageUtil;
 import org.tizen.nativeplatform.util.PlatformLaunchUtil;
 import org.tizen.nativeplatform.util.PlatformProjectUtil;
+import org.tizen.nativeplatform.util.PlatformUserInteraction;
 import org.tizen.nativeplatform.util.RootstrapUtil;
 import org.tizen.nativeplatform.views.model.PlatformRootstrap;
 import org.tizen.sdblib.Arch;
@@ -162,7 +163,7 @@ public class PlatformLaunchDelegate extends AbstractCLaunchDelegate {
     public void launch(ILaunchConfiguration config, String mode, ILaunch launch,
             IProgressMonitor monitor) throws CoreException {
         UserLogger.start(UserInteraction.CATE_PLATFORM_LAUNCH);
-
+        UserLogger.start(UserInteraction.CATE_PLATFORM_LAUNCH, PlatformUserInteraction.PRE_LAUNCH);
         isLaunchFailed = false;
         shell = LaunchUIPlugin.getShell();
         if (monitor == null) {
index 3d803e1..b72dc25 100644 (file)
@@ -38,11 +38,13 @@ import org.eclipse.debug.core.ILaunchConfigurationType;
 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.tizen.common.util.SWTUtil;
+import org.tizen.common.util.log.UserLogger;
 import org.tizen.nativecommon.launch.LaunchUtils;
 import org.tizen.nativecommon.launch.TizenLaunchConfiguration;
 import org.tizen.nativecommon.launch.TizenLaunchConfigurationConstants;
 import org.tizen.nativecommon.launch.TizenLaunchMessages;
 import org.tizen.nativeplatform.launch.PlatformLaunchMessages;
+import org.tizen.nativeplatform.util.PlatformUserInteraction;
 import org.tizen.sdblib.IDevice;
 
 @SuppressWarnings("restriction")
index 4ac2241..4fda6a6 100644 (file)
@@ -57,6 +57,7 @@ import org.tizen.nativeplatform.types.LaunchTypes;
 import org.tizen.nativeplatform.types.PkgInstallTypes;
 import org.tizen.nativeplatform.util.PlatformLaunchUtil;
 import org.tizen.nativeplatform.util.PlatformProjectUtil;
+import org.tizen.nativeplatform.util.PlatformUserInteraction;
 import org.tizen.sdblib.util.DeviceUtil;
 
 public class RpmPackageLauncher implements IPkgLauncher {
@@ -165,7 +166,9 @@ public class RpmPackageLauncher implements IPkgLauncher {
                 PlatformLaunchMessages.INSTALL_PACKAGES_TO_BUILDSYSTEM, selectBsPkgs);
         monitor.subTask(taskMsg);
         if (selectBsPkgs != null && !selectBsPkgs.isEmpty()) {
+            UserLogger.start(UserInteraction.CATE_PLATFORM_LAUNCH, PlatformUserInteraction.INSTALL_ROOTSTRAP);
             installPkgsToRootstrap(selectBsPkgs, IPkgCommander.TOOL.ZYPPER, monitor, bsAvailableRds);
+            UserLogger.end(UserInteraction.CATE_PLATFORM_LAUNCH, PlatformUserInteraction.INSTALL_ROOTSTRAP);
             monitor.worked(1);
         }
         // 3. install packages to device.
@@ -175,12 +178,14 @@ public class RpmPackageLauncher implements IPkgLauncher {
                 selectDvPkgs);
         monitor.subTask(taskMsg);
         if (selectDvPkgs != null && !selectDvPkgs.isEmpty()) {
+            UserLogger.start(UserInteraction.CATE_PLATFORM_LAUNCH, PlatformUserInteraction.INSTALL_DEVICE);
             if (isEflApp) {
                 installPkgsToDevice(selectDvPkgs, IPkgCommander.TOOL.PKGCMD, monitor,
                         dvAvailableRds);
             } else {
                 installPkgsToDevice(selectDvPkgs, IPkgCommander.TOOL.RPM, monitor, dvAvailableRds);
             }
+            UserLogger.end(UserInteraction.CATE_PLATFORM_LAUNCH, PlatformUserInteraction.INSTALL_DEVICE);
             monitor.worked(1);
         }
         monitor.done();
@@ -247,8 +252,10 @@ public class RpmPackageLauncher implements IPkgLauncher {
                     PlatformLaunchMessages.IS_NOT_INITIALIZED_ROOTSTRAP, target.getRootstrap()
                             .getId()));
         } else {
+            UserLogger.start(UserInteraction.CATE_PLATFORM_LAUNCH, PlatformUserInteraction.INIT_ROOTSTRAP_REPO);
             PkgMgrInitializer initializer = new PkgMgrInitializer(target, CmdTargetTypes.ROOTSTRAP);
             initializer.initRootstrapRepoInfo();
+            UserLogger.end(UserInteraction.CATE_PLATFORM_LAUNCH, PlatformUserInteraction.INIT_ROOTSTRAP_REPO);
         }
         IPkgCommander commander = target.getCommander(CmdTargetTypes.ROOTSTRAP);
         boolean installResult = false;
@@ -272,8 +279,10 @@ public class RpmPackageLauncher implements IPkgLauncher {
         } else if (!PlatformLaunchUtil.checkDeviceRootOn(target.getDevice())) {
             newInterruptedException(PlatformLaunchMessages.DEVICE_IS_NOT_ROOT_ON);
         } else {
+            UserLogger.start(UserInteraction.CATE_PLATFORM_LAUNCH, PlatformUserInteraction.INIT_DEVICE_REPO);
             PkgMgrInitializer initializer = new PkgMgrInitializer(target, CmdTargetTypes.DEVICE);
             initializer.initDeviceRepoInfo();
+            UserLogger.end(UserInteraction.CATE_PLATFORM_LAUNCH, PlatformUserInteraction.INIT_DEVICE_REPO);
         }
         IPkgCommander commander = target.getCommander(CmdTargetTypes.DEVICE);
         boolean installResult = false;
index 7a0d859..aa2d4de 100644 (file)
@@ -4,6 +4,15 @@ import java.io.File;
 import java.util.ArrayList;\r
 import java.util.List;\r
 \r
+import org.eclipse.cdt.core.CCorePlugin;\r
+import org.eclipse.cdt.core.model.CoreModel;\r
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;\r
+import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;\r
+import org.eclipse.cdt.managedbuilder.core.IManagedProject;\r
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;\r
+import org.eclipse.core.resources.IProject;\r
+import org.eclipse.core.resources.IWorkspace;\r
+import org.eclipse.core.resources.ResourcesPlugin;\r
 import org.eclipse.core.runtime.IProgressMonitor;\r
 import org.eclipse.core.runtime.NullProgressMonitor;\r
 import org.eclipse.core.runtime.Path;\r
@@ -14,6 +23,8 @@ import org.eclipse.ptp.remotetools.exception.RemoteConnectionException;
 import org.eclipse.ptp.remotetools.exception.RemoteOperationException;\r
 import org.tizen.common.util.FileUtil;\r
 import org.tizen.common.util.log.UserLogger;\r
+import org.tizen.nativecommon.build.SmartBuildInterface;\r
+import org.tizen.nativeplatform.build.PlatformConfigurationManager;\r
 import org.tizen.nativeplatform.util.PlatformUserInteraction;\r
 import org.tizen.nativeplatform.util.RootstrapUtil;\r
 import org.tizen.nativeplatform.views.model.PlatformRootstrap;\r
@@ -85,12 +96,16 @@ public class RootstrapSyncronizer {
         List<PlatformRootstrap> list = new ArrayList<PlatformRootstrap>();\r
         list.add(rootstrap);\r
         syncronized(list, syncIncludes, syncDebugsrc, monitor);\r
+        if (syncIncludes) {\r
+            indexing(rootstrap);\r
+        }\r
     }\r
     \r
     public static void syncronize(PlatformRootstrap rootstrap, IProgressMonitor monitor) {\r
         List<PlatformRootstrap> list = new ArrayList<PlatformRootstrap>();\r
         list.add(rootstrap);\r
         syncronized(list, true, true, monitor);\r
+        indexing(rootstrap);\r
     }\r
 \r
     public static void syncronize(List<PlatformRootstrap> list, IProgressMonitor monitor) {\r
@@ -136,6 +151,37 @@ public class RootstrapSyncronizer {
             }\r
         }\r
     }\r
+    \r
+    private static void indexing(PlatformRootstrap rootstrap) {\r
+        IWorkspace works = ResourcesPlugin.getWorkspace();\r
+        IProject[] projs = works.getRoot().getProjects();\r
+        for (IProject proj : projs) {\r
+            IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(proj);\r
+            if (info == null) {\r
+                continue;\r
+            }\r
+            IConfiguration config = info.getDefaultConfiguration();\r
+            if (config == null) {\r
+                continue;\r
+            }\r
+            IManagedProject managedProject = config.getManagedProject();\r
+            if (managedProject == null) {\r
+                continue;\r
+            }\r
+            String projectArtifactType = managedProject.getProjectType() != null ? managedProject\r
+                    .getProjectType().getBuildArtefactType().getId()\r
+                    : null;\r
+            if (projectArtifactType != PlatformConfigurationManager.TIZEN_PLATFORM_ARTIFACT_TYPE) {\r
+                continue;\r
+            }\r
+            \r
+            String targetId = PlatformConfigurationManager.getBuildTargetName(config);\r
+            String rootId = SmartBuildInterface.getInstance().getRootstrapIDFromTargetID(targetId);\r
+            if (rootstrap.getId().equals(rootId)) {\r
+                CCorePlugin.getIndexManager().reindex(CoreModel.getDefault().create(proj));\r
+            }\r
+        }\r
+    }\r
 \r
     private static String getRemoteIncludePath(PlatformRootstrap rootstrap) {\r
         String scratchPath = RootstrapUtil.getRemoteRootstrapScratchPath(rootstrap.getId());\r
index 4e1eb24..6ffc5a3 100644 (file)
@@ -171,11 +171,13 @@ public class RootstrapManager {
     }
 
     public static void reinitialize(IProgressMonitor monitor) {
+        UserLogger.start(PlatformUserInteraction.INIT_ROOTSTRAP);
         if (OSChecker.isWindows()) {
             RemoteRootstrapManager.reinitialize(monitor);
         } else {
             LocalRootstrapManager.reinitialize(monitor);
         }
+        UserLogger.end(PlatformUserInteraction.INIT_ROOTSTRAP);
     }
 
     public static void updateRootstrap(PlatformRootstrap rootstrap) {
index b062aaf..e3d22ad 100644 (file)
@@ -1,10 +1,18 @@
 package org.tizen.nativeplatform.util;\r
 \r
 public class PlatformUserInteraction {\r
-    \r
+    public static final String CLONE_GITPROJECT = "clone.git";\r
     public static final String CATE_SYNCRONIZE = "syncronize";\r
     public static final String GEN_ROOTSTRAP = "gen.rootstrap";\r
     public static final String SYNC_INCLUDES = "sync.includes";\r
     public static final String SYNC_WORKSPACE = "sync.workspace";\r
     public static final String SYNC_OUTPUT = "sync.output";\r
+    public static final String CONNECT_SSH = "conn.ssh";\r
+    public static final String INIT_ROOTSTRAP = "init.rootstrap";\r
+    public static final String PRE_LAUNCH = "pre.launch";\r
+    public static final String POST_LAUNCH = "post.launch";\r
+    public static final String INSTALL_ROOTSTRAP = "install.rootstrap";\r
+    public static final String INSTALL_DEVICE = "install.device";\r
+    public static final String INIT_DEVICE_REPO = "init.device.repo";\r
+    public static final String INIT_ROOTSTRAP_REPO = "init.rootstrap.repo";\r
 }\r
index 70d4246..f8886a6 100644 (file)
@@ -63,7 +63,10 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Text;
 import org.tizen.common.util.DialogUtil;
+import org.tizen.common.util.log.UserInteraction;
+import org.tizen.common.util.log.UserLogger;
 import org.tizen.nativeplatform.remote.connection.RemoteConnectionManager;
+import org.tizen.nativeplatform.util.PlatformUserInteraction;
 
 public class RemoteConnectionDialog extends Dialog {
 
@@ -217,6 +220,42 @@ public class RemoteConnectionDialog extends Dialog {
         passText = new Text(composite, SWT.SINGLE | SWT.BORDER | SWT.PASSWORD);
         passText.setLayoutData(gridData);
     }
+    
+    private void registerAuthorizedKey(String publicKey) {
+        try {
+            FileReader fileReader = new FileReader(publicKey);
+            BufferedReader reader = new BufferedReader(fileReader);
+            String pubkey = reader.readLine();
+            IRemoteExecutionTools exectool = RemoteConnectionManager.getRemoteTools().getExecTool();
+            IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();
+            String userhome = RemoteConnectionManager.getRemoteTools().getUserhome();
+            String remoteAuthfile = new Path(userhome).append(".ssh").append("authorized_keys").toString();
+            boolean needSet = true;
+            if (filetool.hasFile(remoteAuthfile, new NullProgressMonitor())) {
+                String cmd = String.format("grep -rn \"%s\" %s", pubkey, remoteAuthfile);
+                String output = exectool.executeWithOutput(cmd);
+                if (!output.isEmpty()) {
+                    needSet = false;
+                }
+            }
+            if (needSet) {
+                String cmd = String.format("echo \"%s\" >> %s", pubkey, remoteAuthfile);
+                exectool.executeBashCommand(cmd);
+            }
+        } catch (FileNotFoundException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } catch (RemoteExecutionException e) {
+            e.printStackTrace();
+        } catch (RemoteConnectionException e) {
+            e.printStackTrace();
+        } catch (CancelException e) {
+            e.printStackTrace();
+        } catch (RemoteOperationException e) {
+            e.printStackTrace();
+        }
+    }
 
     @Override
     protected void okPressed() {
@@ -242,44 +281,14 @@ public class RemoteConnectionDialog extends Dialog {
                     InterruptedException {
                      monitor.beginTask(resources.getString("RemoteConnDlg.Progress.Creating"), 1);
                      try {
-                         if (!RemoteConnectionManager.createConnection(host, user, pass, publicKey, privateKey, 
-                                 new SubProgressMonitor(monitor, 1))) {
+                         UserLogger.start(PlatformUserInteraction.CONNECT_SSH);
+                         boolean result = RemoteConnectionManager.createConnection(host, user, pass, publicKey, privateKey, 
+                                 new SubProgressMonitor(monitor, 1));
+                         UserLogger.end(PlatformUserInteraction.CONNECT_SSH);
+                         if (!result) {
                              DialogUtil.openMessageDialog(getShell(), "Failed to connect");
                          } else {
-                             try {
-                                FileReader fileReader = new FileReader(publicKey);
-                                BufferedReader reader = new BufferedReader(fileReader);
-                                String pubkey = reader.readLine();
-                                IRemoteExecutionTools exectool = RemoteConnectionManager.getRemoteTools().getExecTool();
-                                IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();
-                                String userhome = RemoteConnectionManager.getRemoteTools().getUserhome();
-                                String remoteAuthfile = new Path(userhome).append(".ssh").append("authorized_keys").toString();
-                                boolean needSet = true;
-                                if (filetool.hasFile(remoteAuthfile, new NullProgressMonitor())) {
-                                    String cmd = String.format("grep -rn \"%s\" %s", pubkey, remoteAuthfile);
-                                    String output = exectool.executeWithOutput(cmd);
-                                    if (!output.isEmpty()) {
-                                        needSet = false;
-                                    }
-                                }
-                                if (needSet) {
-                                    String cmd = String.format("echo \"%s\" >> %s", pubkey, remoteAuthfile);
-                                    exectool.executeBashCommand(cmd);
-                                }
-                            } catch (FileNotFoundException e) {
-                                e.printStackTrace();
-                            } catch (IOException e) {
-                                e.printStackTrace();
-                            } catch (RemoteExecutionException e) {
-                                e.printStackTrace();
-                            } catch (RemoteConnectionException e) {
-                                e.printStackTrace();
-                            } catch (CancelException e) {
-                                e.printStackTrace();
-                            } catch (RemoteOperationException e) {
-                                e.printStackTrace();
-                            }
-                             
+                             registerAuthorizedKey(publicKey);
                          }
                      } finally {
                          monitor.done();
index 4a1efef..6085d0d 100644 (file)
@@ -528,11 +528,11 @@ public class RootstrapView extends ViewPart {
         manager.add(new Separator());
         manager.add(actionChangeConfFile);
         manager.add(new Separator());
-        manager.add(actionPkgMgr);
         if (OSChecker.isWindows()) {
-            manager.add(new Separator());
             manager.add(actionSync);
+            manager.add(new Separator());
         }
+        manager.add(actionPkgMgr);
     }
 
     private void activateContext() {
@@ -651,7 +651,6 @@ public class RootstrapView extends ViewPart {
                 return;
             }
         }
-        //RootstrapSyncronizer.Syncronize(RootstrapManager.getRootstraps());
     }
     
     private void syncIncludes() {
@@ -678,8 +677,7 @@ public class RootstrapView extends ViewPart {
                 } catch (Exception e) {
                     logger.error("Failed to syncronize includes", e);
                     DialogUtil.openErrorDialog(String.format("%s\n * %s",
-                            "Failed to syncronize includes",
-                            e.toString()));
+                            "Failed to syncronize includes", e.toString()));
                     return;
                 }
             }
@@ -942,7 +940,10 @@ public class RootstrapView extends ViewPart {
                     }
                     selected.setInitialized(true);
                 }
-                RootstrapSyncronizer.cacheModificationTime(selected);
+                final boolean needRemoteSync = OSChecker.isWindows();
+                if (needRemoteSync) {
+                    RootstrapSyncronizer.cacheModificationTime(selected);
+                }
                 // launch package manager
                 IDevice device = ConnectionPlugin.getDefault().getCurrentDevice();
                 final PkgCommandTarget cmdTarget = new PkgCommandTarget(
@@ -999,8 +1000,11 @@ public class RootstrapView extends ViewPart {
                                 monitor.subTask(resources
                                         .getString("Action.Msg.Progress.Refresh.rootstrap"));
                                 RootstrapManager.updateRootstrap(selected);
-                                monitor.worked(2);
-                                RootstrapSyncronizer.syncronizeIfChanges(selected, new SubProgressMonitor(monitor, 1));
+                                monitor.worked(1);
+                                if (needRemoteSync) {
+                                    RootstrapSyncronizer.syncronizeIfChanges(selected, new SubProgressMonitor(monitor, 1));
+                                }
+                                monitor.worked(1);
                             } finally {
                                 monitor.done();
                             }
index c4d10a2..15489f1 100644 (file)
@@ -56,6 +56,7 @@ import org.tizen.nativeplatform.PlatformProjectNature;
 import org.tizen.nativeplatform.git.GitCommander;
 import org.tizen.nativeplatform.git.model.GitDescription;
 import org.tizen.nativeplatform.preferences.PreferencesManager;
+import org.tizen.nativeplatform.util.PlatformUserInteraction;
 import org.tizen.nativeplatform.wizards.model.TizenPlatformTemplateModel;
 
 public class TizenPlatformProjectWizard extends TizenProjectWizard {
@@ -110,9 +111,7 @@ public class TizenPlatformProjectWizard extends TizenProjectWizard {
 
     @Override
     public boolean performFinish() {
-        long start = 0;
-        long end = 0;
-        start = System.currentTimeMillis();
+        UserLogger.start(PlatformUserInteraction.CLONE_GITPROJECT);
         boolean result = false;
 
         IPath projectPath = ResourcesPlugin.getWorkspace().getRoot().getLocation()
@@ -174,8 +173,7 @@ public class TizenPlatformProjectWizard extends TizenProjectWizard {
             }
             commander.ApplySharedProject(newProject, getContainer());
         }
-        end = System.currentTimeMillis();
-        System.out.print("time :" + (end-start)/1000.0);
+        UserLogger.end(PlatformUserInteraction.CLONE_GITPROJECT);
         return result;
     }